From f96369f29375ae6e72e282147b79cf10b0743598 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Wed, 5 May 2021 17:20:24 +0300 Subject: [PATCH] Web: Files: Store: Fixed displaying move context option --- .../src/pages/Home/Section/Header/index.js | 3 +-- .../ASC.Files/Client/src/store/FilesStore.js | 25 ++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/products/ASC.Files/Client/src/pages/Home/Section/Header/index.js b/products/ASC.Files/Client/src/pages/Home/Section/Header/index.js index 811d62cd24..87e3bbb045 100644 --- a/products/ASC.Files/Client/src/pages/Home/Section/Header/index.js +++ b/products/ASC.Files/Client/src/pages/Home/Section/Header/index.js @@ -402,7 +402,6 @@ class SectionHeaderContent extends React.Component { disabled: isFavoritesFolder || isRecentFolder || - isShareFolder || !isAccessedSelected || !selectionCount || isThirdPartySelection, @@ -597,7 +596,7 @@ export default inject( isPrivacyFolder, isFavoritesFolder, isRecentFolder, - shareFolder: isShareFolder, + isShareFolder, } = treeFoldersStore; const { setAction } = fileActionStore; const { diff --git a/products/ASC.Files/Client/src/store/FilesStore.js b/products/ASC.Files/Client/src/store/FilesStore.js index f24788d1ce..e7376b999d 100644 --- a/products/ASC.Files/Client/src/store/FilesStore.js +++ b/products/ASC.Files/Client/src/store/FilesStore.js @@ -374,7 +374,7 @@ class FilesStore { const isFavorite = item.fileStatus === 32 || item.fileStatus === 34; const isFullAccess = item.access < 2; const withoutShare = false; //TODO: need this prop - const isThirdPartyItem = item.providerKey; + const isThirdPartyItem = !!item.providerKey; const hasNew = item.new > 0; const canConvert = false; //TODO: fix of added convert check; const isEncrypted = item.encrypted; @@ -388,12 +388,14 @@ class FilesStore { isCommon, isShare, isFavoritesFolder, - isThirdPartyFolder, - isMyFolder, } = this.treeFoldersStore; - const isShareFolder = isCommon(item.rootFolderType); - const isCommonFolder = isShare(item.rootFolderType); + const { isRootFolder } = this.selectedFolderStore; + + const isThirdPartyFolder = item.providerKey && isRootFolder; + + const isShareFolder = isShare(item.rootFolderType); + const isCommonFolder = isCommon(item.rootFolderType); const { isDesktopClient } = this.settingsStore; @@ -698,6 +700,14 @@ class FilesStore { folderOptions = this.removeOptions(folderOptions, ["unsubscribe"]); } + if (isThirdPartyFolder) { + folderOptions = this.removeOptions(folderOptions, ["move-to"]); + } else { + folderOptions = this.removeOptions(folderOptions, [ + "change-thirdparty-info", + ]); + } + if (isThirdPartyItem) { folderOptions = this.removeOptions(folderOptions, ["owner-change"]); @@ -712,10 +722,7 @@ class FilesStore { ]); } - folderOptions = this.removeOptions(folderOptions, [ - "remove", - "move-to", - ]); + folderOptions = this.removeOptions(folderOptions, ["remove"]); if (!item) { //For damaged items