From a42a6613d09e0983aa665001946ceeff64ed9ec8 Mon Sep 17 00:00:00 2001 From: Timofey Boyko Date: Fri, 12 Jul 2024 15:56:36 +0300 Subject: [PATCH 1/7] Doceditor:Components:Editor: remove setting type --- packages/doceditor/src/components/Editor.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/doceditor/src/components/Editor.tsx b/packages/doceditor/src/components/Editor.tsx index 3f54f34e7a..3559e75cf4 100644 --- a/packages/doceditor/src/components/Editor.tsx +++ b/packages/doceditor/src/components/Editor.tsx @@ -28,7 +28,6 @@ import React from "react"; import { useRouter, useSearchParams } from "next/navigation"; -import { isMobile } from "react-device-detect"; import { useTranslation } from "react-i18next"; import { DocumentEditor } from "@onlyoffice/document-editor-react"; @@ -142,14 +141,9 @@ const Editor = ({ if (config) newConfig.editorConfig = { ...config.editorConfig }; const search = typeof window !== "undefined" ? window.location.search : ""; - const editorType = new URLSearchParams(search).get("editorType"); //if (view && newConfig.editorConfig) newConfig.editorConfig.mode = "view"; - if (editorType) newConfig.type = editorType; - - if (isMobile) newConfig.type = "mobile"; - let goBack: TGoBack = {} as TGoBack; if (fileInfo) { From 01d64e683ffaa8f94c74efe09b3c3a73f7335a40 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Fri, 12 Jul 2024 19:12:32 +0300 Subject: [PATCH 2/7] Fixed Bug 69159 - Rooms: Public. Added "Copy link" action --- .../src/pages/Home/Section/Header/index.js | 13 ++----- .../client/src/store/ContextOptionsStore.js | 26 +++++++------- packages/client/src/store/FilesStore.js | 35 +++++++++++++------ packages/client/src/store/InfoPanelStore.js | 3 -- .../client/src/store/SelectedFolderStore.ts | 9 ----- 5 files changed, 39 insertions(+), 47 deletions(-) diff --git a/packages/client/src/pages/Home/Section/Header/index.js b/packages/client/src/pages/Home/Section/Header/index.js index 664438e466..60ebe7166b 100644 --- a/packages/client/src/pages/Home/Section/Header/index.js +++ b/packages/client/src/pages/Home/Section/Header/index.js @@ -646,7 +646,6 @@ export default inject( pathParts, navigationPath, security, - canCopyPublicLink, rootFolderType, shared, } = selectedFolderStore; @@ -663,8 +662,6 @@ export default inject( const isRoom = !!roomType; const isPublicRoomType = roomType === RoomsType.PublicRoom; - const isCustomRoomType = roomType === RoomsType.CustomRoom; - const isFormRoomType = roomType === RoomsType.FormRoom; const { onCreateAndCopySharedLink, @@ -717,14 +714,9 @@ export default inject( const sharedItem = navigationPath.find((r) => r.shared); const showNavigationButton = - isLoading || !security?.CopyLink + isLoading || !security?.CopyLink || isPublicRoom || isArchive ? false - : (!isPublicRoom && - !isArchive && - canCopyPublicLink && - (isPublicRoomType || isCustomRoomType || isFormRoomType) && - shared) || - (sharedItem && sharedItem.canCopyPublicLink); + : security?.Read && (shared || sharedItem); return { showText: settingsStore.showText, @@ -748,7 +740,6 @@ export default inject( setSelected, security, - canCopyPublicLink, getHeaderMenu, getCheckboxItemLabel, diff --git a/packages/client/src/store/ContextOptionsStore.js b/packages/client/src/store/ContextOptionsStore.js index ae5e4f62f1..4b087a521d 100644 --- a/packages/client/src/store/ContextOptionsStore.js +++ b/packages/client/src/store/ContextOptionsStore.js @@ -396,17 +396,14 @@ class ContextOptionsStore { }; onCopyLink = async (item, t) => { - const { shared, navigationPath, canCopyPublicLink } = - this.selectedFolderStore; + const { shared, navigationPath } = this.selectedFolderStore; const isArchive = item.rootFolderType === FolderType.Archive; const { href } = item; const sharedItem = navigationPath.find((r) => r.shared); - const isShared = - (sharedItem && sharedItem.canCopyPublicLink) || - (shared && canCopyPublicLink); + const isShared = shared || sharedItem; if (isShared && !isArchive) { try { @@ -1118,7 +1115,7 @@ class ContextOptionsStore { return [ { key: "public-room_share", - label: t("Files:CopyLink"), + label: t("Files:CopySharedLink"), icon: TabletLinkReactSvgUrl, onClick: () => { copy(window.location.href); @@ -1126,6 +1123,11 @@ class ContextOptionsStore { }, disabled: this.settingsStore.isFrame, }, + { + key: "separator0", + isSeparator: true, + disabled: !item.security?.Download, + }, { key: "public-room_edit", label: t("Common:Download"), @@ -1218,8 +1220,7 @@ class ContextOptionsStore { const hasInfoPanel = contextOptions.includes("show-info"); //const emailSendIsDisabled = true; - const showSeparator0 = - (hasInfoPanel || !isMedia) && !this.publicRoomStore.isPublicRoom; // || !emailSendIsDisabled; + const showSeparator0 = hasInfoPanel || !isMedia; // || !emailSendIsDisabled; const { isGroupMenuBlocked } = this.filesActionsStore; @@ -1553,8 +1554,7 @@ class ContextOptionsStore { icon: InvitationLinkReactSvgUrl, onClick: () => this.onCopyLink(item, t), disabled: - (isPublicRoomType && item.canCopyPublicLink && !isArchive) || - this.publicRoomStore.isPublicRoom || + (isPublicRoomType && item.security?.Read && !isArchive) || !item.security?.CopyLink, }, { @@ -1565,7 +1565,7 @@ class ContextOptionsStore { disabled: this.publicRoomStore.isPublicRoom || isArchive || - !item.canCopyPublicLink || + !item.security?.Read || !isPublicRoomType, onClick: () => this.onCreateAndCopySharedLink(item, t), // onLoad: () => this.onLoadLinks(t, item), @@ -1617,7 +1617,7 @@ class ContextOptionsStore { label: t("Common:Info"), icon: InfoOutlineReactSvgUrl, onClick: () => this.onShowInfoPanel(item), - disabled: this.publicRoomStore.isPublicRoom, + disabled: false, }, { id: "option_block-unblock-version", @@ -1627,7 +1627,7 @@ class ContextOptionsStore { onClick: () => this.lockFile(item, t), disabled: false, }, - !this.publicRoomStore.isPublicRoom && { + { key: "separator1", isSeparator: true, }, diff --git a/packages/client/src/store/FilesStore.js b/packages/client/src/store/FilesStore.js index c8e6da28a2..219714e767 100644 --- a/packages/client/src/store/FilesStore.js +++ b/packages/client/src/store/FilesStore.js @@ -1575,18 +1575,14 @@ class FilesStore { (data.current.rootFolderType === Rooms || data.current.rootFolderType === Archive); - let shared, canCopyPublicLink; + let shared; if (idx === 1) { let room = data.current; if (!isCurrentFolder) { room = await api.files.getFolderInfo(folderId); shared = room.shared; - canCopyPublicLink = - room.access === ShareAccessRights.RoomManager || - room.access === ShareAccessRights.None; - room.canCopyPublicLink = canCopyPublicLink; this.infoPanelStore.setInfoPanelRoom(room); } @@ -1604,7 +1600,6 @@ class FilesStore { roomType, isRootRoom, shared, - canCopyPublicLink, }; }), ).then((res) => { @@ -2129,6 +2124,20 @@ class FilesStore { fileOptions = this.removeOptions(fileOptions, optionsToRemove); } + if (this.publicRoomStore.isPublicRoom) { + fileOptions = this.removeOptions(fileOptions, [ + "separator0", + "sharing-settings", + "send-by-email", + "show-info", + "separator1", + "create-room", + "separator2", + "remove-from-recent", + "copy-general-link", + ]); + } + if (!canDownload) { fileOptions = this.removeOptions(fileOptions, ["download"]); } @@ -2545,6 +2554,15 @@ class FilesStore { folderOptions = this.removeOptions(folderOptions, optionsToRemove); } + if (this.publicRoomStore.isPublicRoom) { + folderOptions = this.removeOptions(folderOptions, [ + "show-info", + "sharing-settings", + "separator1", + "create-room", + ]); + } + if (!canDownload) { folderOptions = this.removeOptions(folderOptions, ["download"]); } @@ -3367,10 +3385,6 @@ class FilesStore { const isForm = fileExst === ".oform"; - const canCopyPublicLink = - access === ShareAccessRights.RoomManager || - access === ShareAccessRights.None; - return { availableExternalRights, access, @@ -3440,7 +3454,6 @@ class FilesStore { type, hasDraft, isForm, - canCopyPublicLink, requestToken, lastOpened, quotaLimit, diff --git a/packages/client/src/store/InfoPanelStore.js b/packages/client/src/store/InfoPanelStore.js index 5d8d5c7935..0a7e4c52c8 100644 --- a/packages/client/src/store/InfoPanelStore.js +++ b/packages/client/src/store/InfoPanelStore.js @@ -297,9 +297,6 @@ class InfoPanelStore { ...infoPanelSelection, isRoom: infoPanelSelection.isRoom || !!infoPanelSelection.roomType, icon: this.getInfoPanelItemIcon(infoPanelSelection, 32), - canCopyPublicLink: - infoPanelSelection.access === ShareAccessRights.RoomManager || - infoPanelSelection.access === ShareAccessRights.None, }; }; diff --git a/packages/client/src/store/SelectedFolderStore.ts b/packages/client/src/store/SelectedFolderStore.ts index 13cdab5ddd..e2a68942af 100644 --- a/packages/client/src/store/SelectedFolderStore.ts +++ b/packages/client/src/store/SelectedFolderStore.ts @@ -51,7 +51,6 @@ export type TNavigationPath = { roomType: RoomsType; isRootRoom: boolean; shared: boolean; - canCopyPublicLink: boolean; }; type ExcludeTypes = SettingsStore | Function; @@ -181,7 +180,6 @@ class SelectedFolderStore { private: this.private, canShare: this.canShare, isArchive: this.isArchive, - canCopyPublicLink: this.canCopyPublicLink, type: this.type, isRootFolder: this.isRootFolder, parentRoomType: this.parentRoomType, @@ -192,13 +190,6 @@ class SelectedFolderStore { return this.pathParts && this.pathParts.length <= 1; } - get canCopyPublicLink() { - return ( - this.access === ShareAccessRights.RoomManager || - this.access === ShareAccessRights.None - ); - } - toDefault = () => { this.folders = null; this.parentId = 0; From f134c00bc5cc84b75669421471f50b2aa84422ad Mon Sep 17 00:00:00 2001 From: DmitrySychugov Date: Sun, 14 Jul 2024 15:31:57 +0500 Subject: [PATCH 3/7] Client: added the ability to go to a group in a new tab --- .../Home/Section/AccountsBody/Groups/RowView/GroupsRow.js | 4 ++-- .../AccountsBody/Groups/TableView/GroupsTableItem.js | 4 ++-- packages/client/src/store/GroupsStore.ts | 8 +++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/client/src/pages/Home/Section/AccountsBody/Groups/RowView/GroupsRow.js b/packages/client/src/pages/Home/Section/AccountsBody/Groups/RowView/GroupsRow.js index fc722a9db3..908fe7fa2f 100644 --- a/packages/client/src/pages/Home/Section/AccountsBody/Groups/RowView/GroupsRow.js +++ b/packages/client/src/pages/Home/Section/AccountsBody/Groups/RowView/GroupsRow.js @@ -59,8 +59,8 @@ const GroupsRow = ({ changeGroupContextSelection(item, !rightMouseButtonClick); }; - const onOpenGroup = () => { - openGroupAction(item.id, true, item.name); + const onOpenGroup = (e) => { + openGroupAction(item.id, true, item.name, e); }; const nameColor = diff --git a/packages/client/src/pages/Home/Section/AccountsBody/Groups/TableView/GroupsTableItem.js b/packages/client/src/pages/Home/Section/AccountsBody/Groups/TableView/GroupsTableItem.js index aeb98574a8..be0209ee8f 100644 --- a/packages/client/src/pages/Home/Section/AccountsBody/Groups/TableView/GroupsTableItem.js +++ b/packages/client/src/pages/Home/Section/AccountsBody/Groups/TableView/GroupsTableItem.js @@ -62,8 +62,8 @@ const GroupsTableItem = ({ changeGroupContextSelection(item, !rightMouseButtonClick); }; - const onOpenGroup = () => { - openGroupAction(item.id, true, item.name); + const onOpenGroup = (e) => { + openGroupAction(item.id, true, item.name, e); }; const onRowClick = (e) => { diff --git a/packages/client/src/store/GroupsStore.ts b/packages/client/src/store/GroupsStore.ts index 6abc937e1c..910b6b42c6 100644 --- a/packages/client/src/store/GroupsStore.ts +++ b/packages/client/src/store/GroupsStore.ts @@ -40,6 +40,7 @@ import { combineUrl } from "@docspace/shared/utils/combineUrl"; import AccountsFilter from "@docspace/shared/api/people/filter"; import api from "@docspace/shared/api"; import { TGroup } from "@docspace/shared/api/groups/types"; +import { openingNewTab } from "@docspace/shared/utils/openingNewTab"; class GroupsStore { authStore; @@ -593,10 +594,15 @@ class GroupsStore { groupId: string, withBackURL: boolean, tempTitle: string, + e: React.MouseEvent, ) => { const { setIsSectionBodyLoading, setIsSectionFilterLoading } = this.clientLoadingStore; + const url = `/accounts/groups/${groupId}`; + + if (openingNewTab(url, e)) return; + this.setSelection([]); this.setBufferSelection(null); this.setCurrentGroup(null); @@ -610,7 +616,7 @@ class GroupsStore { this.setInsideGroupBackUrl(url); } - window.DocSpace.navigate(`/accounts/groups/${groupId}`); + window.DocSpace.navigate(url); }; updateGroup = async ( From 801bf4bf8666ce740e2f2e32492b2cd6fc63b64c Mon Sep 17 00:00:00 2001 From: DmitrySychugov Date: Sun, 14 Jul 2024 19:33:20 +0500 Subject: [PATCH 4/7] Fix Bug 69194 - fixed changeFilterValue when filtering by owner --- .../shared/components/filter/sub-components/FilterBlock.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/shared/components/filter/sub-components/FilterBlock.tsx b/packages/shared/components/filter/sub-components/FilterBlock.tsx index 0e1fb113ce..6a678c4e19 100644 --- a/packages/shared/components/filter/sub-components/FilterBlock.tsx +++ b/packages/shared/components/filter/sub-components/FilterBlock.tsx @@ -229,7 +229,7 @@ const FilterBlock = ({ }; }); - if (isSelected) { + if (isSelected && key !== "0") { if (isMultiSelect) { const groupIdx = value.findIndex( (item) => "group" in item && item.group === group, @@ -293,7 +293,7 @@ const FilterBlock = ({ ) { item.key.push(key); } else { - item.key = key; + item.key = isSelected && key === "0" ? "1" : key; if (label) { item.label = label; } From f06322abad639ea971b3b3b56a779a144c4b4b55 Mon Sep 17 00:00:00 2001 From: Timofey Boyko Date: Mon, 15 Jul 2024 10:55:58 +0300 Subject: [PATCH 5/7] Fixed Bug 69197 - Files.Info.History. The root folder is incorrectly highlighted in the left panel after clicking Open location on the History tab of a file deleted from the folder. --- .../Body/views/History/HistoryBlockContent/ItemList.tsx | 2 +- packages/client/src/store/FilesActionsStore.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/client/src/pages/Home/InfoPanel/Body/views/History/HistoryBlockContent/ItemList.tsx b/packages/client/src/pages/Home/InfoPanel/Body/views/History/HistoryBlockContent/ItemList.tsx index 5358d834b2..f26e217408 100644 --- a/packages/client/src/pages/Home/InfoPanel/Body/views/History/HistoryBlockContent/ItemList.tsx +++ b/packages/client/src/pages/Home/InfoPanel/Body/views/History/HistoryBlockContent/ItemList.tsx @@ -122,7 +122,7 @@ export const HistoryItemList = ({ iconName={FolderLocationReactSvgUrl} size="16" isFill - onClick={() => checkAndOpenLocationAction!(item)} + onClick={() => checkAndOpenLocationAction!(item, actionType)} title={t("Files:OpenLocation")} /> diff --git a/packages/client/src/store/FilesActionsStore.js b/packages/client/src/store/FilesActionsStore.js index 5380ebdc01..5d253db478 100644 --- a/packages/client/src/store/FilesActionsStore.js +++ b/packages/client/src/store/FilesActionsStore.js @@ -1470,7 +1470,7 @@ class FilesActionStore { return titleWithoutExtension; }; - checkAndOpenLocationAction = async (item) => { + checkAndOpenLocationAction = async (item, actionType) => { const { categoryType } = this.filesStore; const { myRoomsId, myFolderId, archiveRoomsId, recycleBinFolderId } = this.treeFoldersStore; @@ -1501,7 +1501,11 @@ class FilesActionStore { rootFolderType, }; - const url = getCategoryUrl(categoryType, parentId); + const isTrash = actionType === "delete"; + const url = getCategoryUrl( + isTrash ? CategoryType.Trash : categoryType, + parentId, + ); const newFilter = FilesFilter.getDefault(); From 2cbf6f4db9132c981f3f6bce23256f3cc603fad7 Mon Sep 17 00:00:00 2001 From: Timofey Boyko Date: Mon, 15 Jul 2024 11:33:06 +0300 Subject: [PATCH 6/7] Fixed Bug 69183 - Accounts. In the pop-up notification when the portal owner changes, the recipient of the letter is incorrectly specified --- .../src/components/dialogs/ChangePortalOwnerDialog/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/dialogs/ChangePortalOwnerDialog/index.js b/packages/client/src/components/dialogs/ChangePortalOwnerDialog/index.js index 2ce6a7a76e..38f7363b79 100644 --- a/packages/client/src/components/dialogs/ChangePortalOwnerDialog/index.js +++ b/packages/client/src/components/dialogs/ChangePortalOwnerDialog/index.js @@ -91,7 +91,7 @@ const ChangePortalOwnerDialog = ({ onClose && onClose(); toastr.success( t("Settings:ConfirmEmailSended", { - ownerName: selectedUser.label, + ownerName: displayName, }), ); }) From 7b9b9d9f2a358e927ca689e8f9699ca4e0e839cb Mon Sep 17 00:00:00 2001 From: Timofey Boyko Date: Mon, 15 Jul 2024 11:53:04 +0300 Subject: [PATCH 7/7] Fixed Bug 69183 - Accounts. In the pop-up notification when the portal owner changes, the recipient of the letter is incorrectly specified --- .../dialogs/ChangePortalOwnerDialog/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/client/src/components/dialogs/ChangePortalOwnerDialog/index.js b/packages/client/src/components/dialogs/ChangePortalOwnerDialog/index.js index 38f7363b79..66e1806b3e 100644 --- a/packages/client/src/components/dialogs/ChangePortalOwnerDialog/index.js +++ b/packages/client/src/components/dialogs/ChangePortalOwnerDialog/index.js @@ -52,6 +52,7 @@ import { StyledSelectedOwner, } from "./StyledDialog"; import { PRODUCT_NAME } from "@docspace/shared/constants"; +import { EmployeeActivationStatus } from "@docspace/shared/enums"; const ChangePortalOwnerDialog = ({ t, @@ -122,6 +123,14 @@ const ChangePortalOwnerDialog = ({ t("DeactivateOrDeletePortal", { productName: PRODUCT_NAME }), ]; + const filter = React.useMemo(() => { + const newFilter = new Filter(); + + newFilter.employeeStatus = EmployeeActivationStatus.Activated; + + return newFilter; + }, []); + return ( )}