Merge branch 'release/v2.5.0' of https://github.com/ONLYOFFICE/DocSpace-client into release/v2.5.0

This commit is contained in:
Vladimir Khvan 2024-03-26 14:35:23 +05:00
commit b41e0d05cf
10 changed files with 54 additions and 31 deletions

View File

@ -44,6 +44,7 @@
"RoleUserDescription": "Пользователи могут получить доступ только к тем комнатам, в которые их пригласили администраторы. Они не могут создавать собственные комнаты, папки или файлы.",
"RoleViewer": "Зритель",
"RoleViewerDescription": "Просмотр файлов",
"SearchByHeadOfGroup": "Искать по главе группы",
"SearchByOwner": "Поиск по владельцам",
"Spreadsheets": "Таблицы",
"SubNewForm": "Пустая",

View File

@ -162,7 +162,7 @@ class CommonStore {
};
getWhiteLabelLogoText = async () => {
const res = await api.settings.getLogoText();
const res = await api.settings.getLogoText(isManagement());
this.setLogoText(res);
this.defaultLogoTextWhiteLabel = res;
return res;
@ -178,7 +178,7 @@ class CommonStore {
};
getIsDefaultWhiteLabel = async () => {
const res = await api.settings.getIsDefaultWhiteLabel();
const res = await api.settings.getIsDefaultWhiteLabel(isManagement());
const enableRestoreButton = res.map((item) => item.default).includes(false);
this.enableRestoreButton = enableRestoreButton;
};

View File

@ -245,8 +245,8 @@ class MediaViewerDataStore {
if (filesList.length > 0) {
filesList.forEach((file) => {
const canOpenPlayer =
file.viewAccessibility.ImageView ||
file.viewAccessibility.MediaView ||
file.viewAccessibility?.ImageView ||
file.viewAccessibility?.MediaView ||
(file.fileExst === ".pdf" && window.DocSpaceConfig.pdfViewer);
if (canOpenPlayer) {
@ -266,7 +266,7 @@ class MediaViewerDataStore {
file.thumbnailStatus === thumbnailStatuses.WAITING;
const isVideoOrImage =
file.viewAccessibility.ImageView || isVideo(file.fileExst);
file.viewAccessibility?.ImageView || isVideo(file.fileExst);
if (thumbnailIsNotCreated && isVideoOrImage)
itemsWithoutThumb.push(file);

View File

@ -302,17 +302,24 @@ export function deleteAppearanceTheme(id) {
});
}
export function getLogoText() {
export function getLogoText(isManagement: boolean = false) {
const url = "/settings/whitelabel/logotext";
return request({
method: "get",
url: `/settings/whitelabel/logotext`,
url: isManagement ? `${url}?isDefault=true` : url,
});
}
export async function getLogoUrls(headers = null) {
export async function getLogoUrls(
headers = null,
isManagement: boolean = false,
) {
const url = "/settings/whitelabel/logos";
const options: AxiosRequestConfig = {
method: "get",
url: `/settings/whitelabel/logos`,
url: isManagement ? `${url}?isDefault=true` : url,
};
if (headers) options.headers = headers;
@ -324,7 +331,7 @@ export async function getLogoUrls(headers = null) {
return res;
}
export function setWhiteLabelSettings(data, isManagement) {
export function setWhiteLabelSettings(data, isManagement: boolean = false) {
const url = "/settings/whitelabel/save";
const options = {
@ -336,14 +343,16 @@ export function setWhiteLabelSettings(data, isManagement) {
return request(options);
}
export function getIsDefaultWhiteLabel() {
export function getIsDefaultWhiteLabel(isManagement: boolean = false) {
const url = "/settings/whitelabel/logos/isdefault";
return request({
method: "get",
url: `/settings/whitelabel/logos/isdefault`,
url: isManagement ? `${url}?isDefault=true` : url,
});
}
export function restoreWhiteLabelSettings(isManagement) {
export function restoreWhiteLabelSettings(isManagement: boolean = false) {
const url = "/settings/whitelabel/restore";
return request({

View File

@ -365,9 +365,10 @@ const compare = (
prevProps.displayType === nextProps.displayType &&
prevProps.isDisabled === nextProps.isDisabled
) {
return false;
return true;
}
return true;
return false;
};
export const ContextMenuButton = React.memo(ContextMenuButtonPure, compare);

View File

@ -645,6 +645,14 @@ const StyledBox = styled.div<{
grid-template-columns: minmax(1px, max-content) auto;
}
.title-block-text {
margin-top: 1px;
@media ${tablet} {
margin: 0;
}
}
@media ${tablet} {
width: ${({ dropBoxWidth }) => `${dropBoxWidth}px`};
${(props) =>

View File

@ -168,6 +168,7 @@ const Navigation = ({
<div className="title-block">
{titleIcon && <ReactSVG className="title-icon" src={titleIcon} />}
<Text
className="title-block-text"
title={title}
isOpen={isOpen}
isRootFolder={isRootFolder}

View File

@ -54,12 +54,14 @@ import {
getShowText,
isPublicRoom,
insertTagManager,
isManagement,
} from "../utils/common";
import { setCookie, getCookie } from "../utils/cookie";
import { combineUrl } from "../utils/combineUrl";
import FirebaseHelper from "../utils/firebase";
import SocketIOHelper from "../utils/socket";
import { TWhiteLabel } from "../utils/whiteLabelHelper";
import { ThemeKeys, TenantStatus, DeviceType, UrlActionType } from "../enums";
import {
LANGUAGE,
@ -726,7 +728,7 @@ class SettingsStore {
};
getWhiteLabelLogoUrls = async () => {
const res = await api.settings.getLogoUrls();
const res = await api.settings.getLogoUrls(null, isManagement());
this.setLogoUrls(Object.values(res));
this.setLogoUrl(Object.values(res));

View File

@ -895,22 +895,21 @@ export const toUrlParams = (
export function getObjectByLocation(location: Location) {
if (!location.search || !location.search.length) return null;
const searchUrl = location.search.substring(1);
const decodedString = decodeURIComponent(searchUrl)
.replace(/\["/g, '["')
.replace(/"\]/g, '"]')
.replace(/"/g, '\\"')
.replace(/&/g, '","')
.replace(/=/g, '":"')
.replace(/\\/g, "\\\\")
.replace(/\[\\\\"/g, '["')
.replace(/\\\\"\]/g, '"]')
.replace(/"\[/g, "[")
.replace(/\]"/g, "]")
.replace(/\\\\",\\\\"/g, '","')
.replace(/\\\\\\\\"/g, '\\"');
try {
const searchUrl = location.search.substring(1);
const decodedString = decodeURIComponent(searchUrl)
.replace(/\["/g, '["')
.replace(/"\]/g, '"]')
.replace(/"/g, '\\"')
.replace(/&/g, '","')
.replace(/=/g, '":"')
.replace(/\\/g, "\\\\")
.replace(/\[\\\\"/g, '["')
.replace(/\\\\"\]/g, '"]')
.replace(/"\[/g, "[")
.replace(/\]"/g, "]")
.replace(/\\\\",\\\\"/g, '","')
.replace(/\\\\\\\\"/g, '\\"');
const object = JSON.parse(`{"${decodedString}"}`);
return object;
} catch (e) {

View File

@ -159,6 +159,7 @@
"FullAccess": "Полный доступ",
"Gigabyte": "Гб",
"GoBack": "Назад",
"Group": "Группа",
"Groups": "Группы",
"HasFullAccess": "У него есть полный доступ в комнату",
"HeadOfGroup": "Глава группы",
@ -305,6 +306,7 @@
"SelectFile": "Выбрать файл",
"SelectFiles": "Выбрать файлы",
"SelectorEmptyScreenHeader": "Здесь пока нет файлов и папок",
"SelectRoom": "Выбрать комнату",
"SendButton": "Отправить",
"Sending": "Отправка...",
"SendRequest": "Отправить запрос",