From 7628e195529a7deb5567ffab4550b1c6be6be0da Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Tue, 26 Mar 2024 11:49:00 +0300 Subject: [PATCH 1/6] Web: Files: fixed navigation jumping --- .../shared/components/navigation/Navigation.styled.ts | 8 ++++++++ packages/shared/components/navigation/Navigation.tsx | 1 + 2 files changed, 9 insertions(+) diff --git a/packages/shared/components/navigation/Navigation.styled.ts b/packages/shared/components/navigation/Navigation.styled.ts index 203dd8fb77..55ba2792b5 100644 --- a/packages/shared/components/navigation/Navigation.styled.ts +++ b/packages/shared/components/navigation/Navigation.styled.ts @@ -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) => diff --git a/packages/shared/components/navigation/Navigation.tsx b/packages/shared/components/navigation/Navigation.tsx index 08363b7a64..72218cf29b 100644 --- a/packages/shared/components/navigation/Navigation.tsx +++ b/packages/shared/components/navigation/Navigation.tsx @@ -168,6 +168,7 @@ const Navigation = ({
{titleIcon && } Date: Tue, 26 Mar 2024 13:49:40 +0500 Subject: [PATCH 2/6] Web: Shared: fixed URI malformed --- packages/shared/utils/common.ts | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/packages/shared/utils/common.ts b/packages/shared/utils/common.ts index 495f727958..a9c2722638 100644 --- a/packages/shared/utils/common.ts +++ b/packages/shared/utils/common.ts @@ -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) { From cd8584818198b76f1be6dd85ed4ce6f64e1b0a80 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Tue, 26 Mar 2024 12:09:46 +0300 Subject: [PATCH 3/6] Shared: ContextMenuButton: Fixed custom equality check of props. --- .../components/context-menu-button/ContextMenuButton.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/shared/components/context-menu-button/ContextMenuButton.tsx b/packages/shared/components/context-menu-button/ContextMenuButton.tsx index b2366ae880..e29a0e923c 100644 --- a/packages/shared/components/context-menu-button/ContextMenuButton.tsx +++ b/packages/shared/components/context-menu-button/ContextMenuButton.tsx @@ -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); From 8666c972573b4759f7c407b82d5d847965d6be41 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Tue, 26 Mar 2024 12:10:09 +0300 Subject: [PATCH 4/6] Fix Bug 67092 --- packages/client/src/store/CommonStore.js | 4 ++-- packages/shared/api/settings/index.ts | 25 ++++++++++++++++-------- packages/shared/store/SettingsStore.ts | 4 +++- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/packages/client/src/store/CommonStore.js b/packages/client/src/store/CommonStore.js index 3d767cb1a0..03b037def6 100644 --- a/packages/client/src/store/CommonStore.js +++ b/packages/client/src/store/CommonStore.js @@ -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; }; diff --git a/packages/shared/api/settings/index.ts b/packages/shared/api/settings/index.ts index 841f91fd5b..4c51a9fab1 100644 --- a/packages/shared/api/settings/index.ts +++ b/packages/shared/api/settings/index.ts @@ -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({ diff --git a/packages/shared/store/SettingsStore.ts b/packages/shared/store/SettingsStore.ts index 91918c01dd..130352629a 100644 --- a/packages/shared/store/SettingsStore.ts +++ b/packages/shared/store/SettingsStore.ts @@ -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)); From 2f083e844c30139d9ee8df455b15dcbe2e09346f Mon Sep 17 00:00:00 2001 From: Elyor Djalilov Date: Tue, 26 Mar 2024 14:21:54 +0500 Subject: [PATCH 5/6] Web: Client: fixed ImageView crash --- packages/client/src/store/MediaViewerDataStore.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/src/store/MediaViewerDataStore.js b/packages/client/src/store/MediaViewerDataStore.js index d7a7e6f963..040ab3ba6d 100644 --- a/packages/client/src/store/MediaViewerDataStore.js +++ b/packages/client/src/store/MediaViewerDataStore.js @@ -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); From b1a4cb158d81df8829869d8c110ab19c4d01d5d3 Mon Sep 17 00:00:00 2001 From: namushka Date: Tue, 26 Mar 2024 12:23:29 +0300 Subject: [PATCH 6/6] fix translations --- packages/client/public/locales/ru/Translations.json | 1 + public/locales/ru/Common.json | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/client/public/locales/ru/Translations.json b/packages/client/public/locales/ru/Translations.json index 825b673477..af7a64610e 100644 --- a/packages/client/public/locales/ru/Translations.json +++ b/packages/client/public/locales/ru/Translations.json @@ -44,6 +44,7 @@ "RoleUserDescription": "Пользователи могут получить доступ только к тем комнатам, в которые их пригласили администраторы. Они не могут создавать собственные комнаты, папки или файлы.", "RoleViewer": "Зритель", "RoleViewerDescription": "Просмотр файлов", + "SearchByHeadOfGroup": "Искать по главе группы", "SearchByOwner": "Поиск по владельцам", "Spreadsheets": "Таблицы", "SubNewForm": "Пустая", diff --git a/public/locales/ru/Common.json b/public/locales/ru/Common.json index b2ba8519b6..9f25bece15 100644 --- a/public/locales/ru/Common.json +++ b/public/locales/ru/Common.json @@ -159,6 +159,7 @@ "FullAccess": "Полный доступ", "Gigabyte": "Гб", "GoBack": "Назад", + "Group": "Группа", "Groups": "Группы", "HasFullAccess": "У него есть полный доступ в комнату", "HeadOfGroup": "Глава группы", @@ -305,6 +306,7 @@ "SelectFile": "Выбрать файл", "SelectFiles": "Выбрать файлы", "SelectorEmptyScreenHeader": "Здесь пока нет файлов и папок", + "SelectRoom": "Выбрать комнату", "SendButton": "Отправить", "Sending": "Отправка...", "SendRequest": "Отправить запрос",