From 137ae55648b3ab15f964d57dfa8a3597ce7178b3 Mon Sep 17 00:00:00 2001 From: MaksimChegulov Date: Mon, 3 Apr 2023 12:21:36 +0300 Subject: [PATCH 1/5] fixed Bug 61882 --- .../Resources/FilesCommonResource.Designer.cs | 15 ++++++++-- .../Core/Resources/FilesCommonResource.resx | 7 +++-- .../FileOperations/FileMoveCopyOperation.cs | 30 ++++++++++++++++--- 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/products/ASC.Files/Core/Resources/FilesCommonResource.Designer.cs b/products/ASC.Files/Core/Resources/FilesCommonResource.Designer.cs index 4451f769f6..242f0acae4 100644 --- a/products/ASC.Files/Core/Resources/FilesCommonResource.Designer.cs +++ b/products/ASC.Files/Core/Resources/FilesCommonResource.Designer.cs @@ -842,6 +842,15 @@ namespace ASC.Files.Core.Resources { } } + /// + /// Looks up a localized string similar to You don't have enough permission to archive the room. + /// + public static string ErrorMessage_SecurityException_ArchiveRoom { + get { + return ResourceManager.GetString("ErrorMessage_SecurityException_ArchiveRoom", resourceCulture); + } + } + /// /// Looks up a localized string similar to You don't have permission to copy to this folder. /// @@ -870,11 +879,11 @@ namespace ASC.Files.Core.Resources { } /// - /// Looks up a localized string similar to You don't have enough permission to archive the room. + /// Looks up a localized string similar to You don't have enough permission to unarchive the room. /// - public static string ErrorMessage_UnarchiveRoom { + public static string ErrorMessage_SecurityException_UnarchiveRoom { get { - return ResourceManager.GetString("ErrorMessage_UnarchiveRoom", resourceCulture); + return ResourceManager.GetString("ErrorMessage_SecurityException_UnarchiveRoom", resourceCulture); } } diff --git a/products/ASC.Files/Core/Resources/FilesCommonResource.resx b/products/ASC.Files/Core/Resources/FilesCommonResource.resx index bdd092d114..9aba67cada 100644 --- a/products/ASC.Files/Core/Resources/FilesCommonResource.resx +++ b/products/ASC.Files/Core/Resources/FilesCommonResource.resx @@ -375,8 +375,8 @@ You don't have permission to move to this folder - - You don't have enough permission to archive the room + + You don't have enough permission to unarchive the room You cannot edit archived rooms @@ -472,4 +472,7 @@ Highest compatibility with docx, xlsx, pptx. Collaborator + + You don't have enough permission to archive the room + \ No newline at end of file diff --git a/products/ASC.Files/Core/Services/WCFService/FileOperations/FileMoveCopyOperation.cs b/products/ASC.Files/Core/Services/WCFService/FileOperations/FileMoveCopyOperation.cs index 67868c97f7..0c79f3878e 100644 --- a/products/ASC.Files/Core/Services/WCFService/FileOperations/FileMoveCopyOperation.cs +++ b/products/ASC.Files/Core/Services/WCFService/FileOperations/FileMoveCopyOperation.cs @@ -146,6 +146,7 @@ class FileMoveCopyOperation : FileOperation, T> if (0 < Folders.Count) { var firstFolder = await FolderDao.GetFolderAsync(Folders[0]); + var isRoom = DocSpaceHelper.IsRoom(firstFolder.FolderType); if (_copy && !await FilesSecurity.CanCopyAsync(firstFolder)) { @@ -155,7 +156,17 @@ class FileMoveCopyOperation : FileOperation, T> } if (!_copy && !await FilesSecurity.CanMoveAsync(firstFolder)) { - this[Err] = FilesCommonResource.ErrorMassage_SecurityException_MoveFile; + if (isRoom) + { + this[Err] = toFolder.FolderType == FolderType.Archive + ? FilesCommonResource.ErrorMessage_SecurityException_ArchiveRoom + : FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom; + + } + else + { + this[Err] = FilesCommonResource.ErrorMassage_SecurityException_MoveFolder; + } return; } @@ -187,7 +198,9 @@ class FileMoveCopyOperation : FileOperation, T> } if (!_copy && !await fileSecurity.CanMoveToAsync(toFolder)) { - this[Err] = FilesCommonResource.ErrorMessage_SecurityException_MoveToFolder; + this[Err] = toFolder.FolderType == FolderType.VirtualRooms ? FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom : + toFolder.FolderType == FolderType.Archive ? FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom : + FilesCommonResource.ErrorMessage_SecurityException_MoveToFolder; return; } @@ -270,7 +283,16 @@ class FileMoveCopyOperation : FileOperation, T> } else if (!copy && checkPermissions && !canMoveOrCopy) { - this[Err] = FilesCommonResource.ErrorMassage_SecurityException_MoveFolder; + if (isRoom) + { + this[Err] = toFolder.FolderType == FolderType.Archive + ? FilesCommonResource.ErrorMessage_SecurityException_ArchiveRoom + : FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom; + } + else + { + this[Err] = FilesCommonResource.ErrorMassage_SecurityException_MoveFolder; + } } else if (!isRoom && (toFolder.FolderType == FolderType.VirtualRooms || toFolder.RootFolderType == FolderType.Archive)) { @@ -278,7 +300,7 @@ class FileMoveCopyOperation : FileOperation, T> } else if (isRoom && toFolder.FolderType != FolderType.VirtualRooms && toFolder.FolderType != FolderType.Archive) { - this[Err] = FilesCommonResource.ErrorMessage_UnarchiveRoom; + this[Err] = FilesCommonResource.ErrorMessage_SecurityException_UnarchiveRoom; } else if (!isRoom && folder.Private && !await CompliesPrivateRoomRulesAsync(folder, toFolderParents)) { From 3f0cf16193b29336e0005651aa9eb993c127107d Mon Sep 17 00:00:00 2001 From: Akmal Isomadinov Date: Mon, 3 Apr 2023 14:51:36 +0500 Subject: [PATCH 2/5] Web:Client:Pages:Home:Section:Body:TilesView:Sub-Components:Tile Fixed a bug that made it impossible to select multiple rooms using the checkbox in thumbnail mode --- .../Home/Section/Body/TilesView/sub-components/Tile.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js b/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js index 96c0f9065a..5cb4d70a1e 100644 --- a/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js +++ b/packages/client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js @@ -428,6 +428,7 @@ class Tile extends React.PureComponent { this.cm = React.createRef(); this.tile = React.createRef(); + this.checkboxContainerRef = React.createRef(); } onError = () => { @@ -503,7 +504,8 @@ class Tile extends React.PureComponent { e.target.nodeName !== "INPUT" && e.target.nodeName !== "rect" && e.target.nodeName !== "path" && - e.target.nodeName !== "svg" + e.target.nodeName !== "svg" && + !this.checkboxContainerRef.current?.contains(e.target) ) { setSelection && setSelection([]); } @@ -637,7 +639,10 @@ class Tile extends React.PureComponent { {renderElement && !(!fileExst && id === -1) && !isEdit && ( <> {!inProgress ? ( -
+
Date: Mon, 3 Apr 2023 13:19:57 +0300 Subject: [PATCH 3/5] Client: fix translate --- packages/client/public/locales/ru/Confirm.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/public/locales/ru/Confirm.json b/packages/client/public/locales/ru/Confirm.json index 49d835894b..f2d2a76a6d 100644 --- a/packages/client/public/locales/ru/Confirm.json +++ b/packages/client/public/locales/ru/Confirm.json @@ -26,7 +26,7 @@ "SetAppDescription": "Включена двухфакторная аутентификация. Чтобы продолжить работу в DocSpace, настройте приложение для аутентификации. Вы можете использовать Google Authenticator для <1>Android и <4>iOS или Authenticator для <8>Windows Phone.", "SetAppInstallDescription": "Для подключения приложения отсканируйте QR-код или вручную введите секретный ключ <1>{{ secretKey }}, а затем введите 6-значный код из приложения в поле ниже.", "SetAppTitle": "Настройте приложение для аутентификации", - "SuccessDeactivate": "Ваш аккаунт успешно деактивирован. Через 10 секунд вы будете перенаправлены на сайт <1>site.", - "SuccessReactivate": "Ваша учетная запись успешно повторно активирована. Через 10 секунд вы будете перенаправлены на <1>portal.", + "SuccessDeactivate": "Ваш аккаунт успешно деактивирован. Через 10 секунд вы будете перенаправлены на <1>сайт.", + "SuccessReactivate": "Ваша учетная запись успешно повторно активирована. Через 10 секунд вы будете перенаправлены на <1>портал.", "WelcomeUser": "Добро пожаловать на DocSpace!\nЧтобы приступить к работе зарегистрируйтесь, или войдите через социальную сеть." } From 3151e1bc1bd488341f0e6164e97d0eb806ddf132 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Mon, 3 Apr 2023 13:20:18 +0300 Subject: [PATCH 4/5] Client: Errors: Unavailable: add logo --- .../src/pages/Errors/Unavailable/index.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/client/src/pages/Errors/Unavailable/index.js b/packages/client/src/pages/Errors/Unavailable/index.js index 0e16ac98dc..1499f57303 100644 --- a/packages/client/src/pages/Errors/Unavailable/index.js +++ b/packages/client/src/pages/Errors/Unavailable/index.js @@ -1,13 +1,27 @@ import React from "react"; +import styled from "styled-components"; import ErrorContainer from "@docspace/common/components/ErrorContainer"; import { I18nextProvider, useTranslation } from "react-i18next"; import i18n from "./i18n"; +import DocspaceLogo from "../../../DocspaceLogo"; -const ErrorUnavailable = () => { +const StyledWrapper = styled.div` + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 64px; +`; + +const ErrorUnavailable = ({ logoUrl }) => { const { t, ready } = useTranslation("Errors"); return ready ? ( - + + + + ) : ( <> ); From a9355c4ea68fce2701731ea24ed512d988a25dbb Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Mon, 3 Apr 2023 14:43:01 +0400 Subject: [PATCH 5/5] Web: Added new LiveChat and BookTraining menu to Profile --- .../client/src/store/ProfileActionsStore.js | 66 ++++++++++++++++--- packages/common/store/SettingsStore.js | 3 + public/images/book.training.react.svg | 6 ++ public/locales/en/Common.json | 2 + 4 files changed, 67 insertions(+), 10 deletions(-) create mode 100644 public/images/book.training.react.svg diff --git a/packages/client/src/store/ProfileActionsStore.js b/packages/client/src/store/ProfileActionsStore.js index 8e09b82a28..d0a2d4151b 100644 --- a/packages/client/src/store/ProfileActionsStore.js +++ b/packages/client/src/store/ProfileActionsStore.js @@ -3,8 +3,10 @@ import HotkeysReactSvgUrl from "PUBLIC_DIR/images/hotkeys.react.svg?url"; import ProfileReactSvgUrl from "PUBLIC_DIR/images/profile.react.svg?url"; import PaymentsReactSvgUrl from "PUBLIC_DIR/images/payments.react.svg?url"; import HelpCenterReactSvgUrl from "PUBLIC_DIR/images/help.center.react.svg?url"; -import SupportReactSvgUrl from "PUBLIC_DIR/images/support.react.svg?url"; -import VideoGuidesReactSvgUrl from "PUBLIC_DIR/images/video.guides.react.svg?url"; +import EmailReactSvgUrl from "PUBLIC_DIR/images/email.react.svg?url"; +import LiveChatReactSvgUrl from "PUBLIC_DIR/images/support.react.svg?url"; +import BookTrainingReactSvgUrl from "PUBLIC_DIR/images/book.training.react.svg?url"; +//import VideoGuidesReactSvgUrl from "PUBLIC_DIR/images/video.guides.react.svg?url"; import InfoOutlineReactSvgUrl from "PUBLIC_DIR/images/info.outline.react.svg?url"; import LogoutReactSvgUrl from "PUBLIC_DIR/images/logout.react.svg?url"; import { makeAutoObservable } from "mobx"; @@ -93,6 +95,10 @@ class ProfileActionsStore { window.open(helpUrl, "_blank"); }; + onLiveChatClick = () => { + //window.open(supportUrl, "_blank"); + }; + onSupportClick = () => { const supportUrl = this.authStore.settingsStore.additionalResourcesData ?.feedbackAndSupportUrl; @@ -100,6 +106,13 @@ class ProfileActionsStore { window.open(supportUrl, "_blank"); }; + onBookTraining = () => { + const trainingEmail = this.authStore.settingsStore.additionalResourcesData + ?.trainingEmail; + + trainingEmail && window.open(`mailto:${trainingEmail}`, "_blank"); + }; + // onVideoGuidesClick = () => { // window.open(VIDEO_GUIDES_URL, "_blank"); // }; @@ -173,6 +186,29 @@ class ProfileActionsStore { }; } // } + + let liveChat = null; + + if (!isMobile) { + liveChat = { + key: "user-menu-live-chat", + icon: LiveChatReactSvgUrl, + label: t("Common:LiveChat"), + onClick: this.onLiveChatClick, + }; + } + + let bookTraining = null; + + if (!isMobile) { + bookTraining = { + key: "user-menu-book-training", + icon: BookTrainingReactSvgUrl, + label: t("Common:BookTraining"), + onClick: this.onBookTraining, + }; + } + const actions = [ { key: "user-menu-profile", @@ -187,18 +223,16 @@ class ProfileActionsStore { label: t("Common:PaymentsTitle"), onClick: this.onPaymentsClick, }, + { + isSeparator: true, + key: "separator1", + }, { key: "user-menu-help-center", icon: HelpCenterReactSvgUrl, label: t("Common:HelpCenter"), onClick: this.onHelpCenterClick, }, - { - key: "user-menu-support", - icon: SupportReactSvgUrl, - label: t("Common:FeedbackAndSupport"), - onClick: this.onSupportClick, - }, // { // key: "user-menu-video", // icon: VideoGuidesReactSvgUrl, @@ -206,6 +240,18 @@ class ProfileActionsStore { // onClick: this.onVideoGuidesClick, // }, hotkeys, + { + isSeparator: true, + key: "separator2", + }, + liveChat, + { + key: "user-menu-support", + icon: EmailReactSvgUrl, + label: t("Common:FeedbackAndSupport"), + onClick: this.onSupportClick, + }, + bookTraining, { key: "user-menu-about", icon: InfoOutlineReactSvgUrl, @@ -214,7 +260,7 @@ class ProfileActionsStore { }, { isSeparator: true, - key: "separator", + key: "separator3", }, { key: "user-menu-logout", @@ -226,7 +272,7 @@ class ProfileActionsStore { ]; if (debugInfo) { - actions.splice(3, 0, { + actions.splice(4, 0, { key: "user-menu-debug", icon: InfoOutlineReactSvgUrl, label: "Debug Info", diff --git a/packages/common/store/SettingsStore.js b/packages/common/store/SettingsStore.js index 392f38ed7f..caa622b8f1 100644 --- a/packages/common/store/SettingsStore.js +++ b/packages/common/store/SettingsStore.js @@ -389,6 +389,9 @@ class SettingsStore { setAdditionalResourcesData = (data) => { this.additionalResourcesData = data; + if (!this.additionalResourcesData?.trainingEmail) { + this.additionalResourcesData.trainingEmail = "training@onlyoffice.com"; + } }; setAdditionalResourcesIsDefault = (additionalResourcesIsDefault) => { diff --git a/public/images/book.training.react.svg b/public/images/book.training.react.svg new file mode 100644 index 0000000000..d5f35b93a6 --- /dev/null +++ b/public/images/book.training.react.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/locales/en/Common.json b/public/locales/en/Common.json index a69e60d2dc..668d40b64c 100644 --- a/public/locales/en/Common.json +++ b/public/locales/en/Common.json @@ -20,6 +20,7 @@ "Audio": "Audio", "BarMaintenanceDescription": "We apologize for any short-term technical issues in service functioning that may appear on {{targetDate}} during the update of {{productName}}.", "BarMaintenanceDisclaimer": "Please, make sure that all the changes are successfully saved during this day.", + "BookTraining": "Book a training", "ByFirstNameSorting": "By first name", "ByLastNameSorting": "By last name", "Bytes": "bytes", @@ -124,6 +125,7 @@ "LastName": "Last name", "LatePayment": "Late payment", "LearnMore": "Learn more", + "LiveChat": "Live chat", "Load": "Load", "LoadingDescription": "Please wait...", "LoadingProcessing": "Loading...",