From 017b9e912cca06f7bc48c5af621323a59c8ed75d Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Wed, 17 Nov 2021 17:41:46 +0300 Subject: [PATCH 1/6] Web: Files: add menu in trash --- .../src/pages/Home/Section/Header/index.js | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) 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 b7e3ff21c19..a2bdc075603 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 @@ -242,6 +242,7 @@ class SectionHeaderContent extends React.Component { }; onEmptyTrashAction = () => this.props.setEmptyTrashDialogVisible(true); + onRestoreAllAction = () => console.log("Restore all"); getContextOptionsFolder = () => { const { t } = this.props; @@ -292,6 +293,26 @@ class SectionHeaderContent extends React.Component { ]; }; + getContextOptionsTrash = () => { + const { t } = this.props; + return [ + { + key: "clear-trash", + label: t("EmptyRecycleBin"), + icon: "images/clear.active.react.svg", + onClick: this.onEmptyTrashAction, + disabled: false, + }, + { + key: "restore-all", + label: t("Translations:Restore"), + icon: "images/move.react.svg", + onClick: this.onRestoreAllAction, + disabled: false, + }, + ]; + }; + onBackToParentFolder = () => { const { setIsLoading, parentId, filter, fetchFiles } = this.props; setIsLoading(true); @@ -352,6 +373,7 @@ class SectionHeaderContent extends React.Component { isTabletView, personal, viewAs, + isRecycleBinFolder, } = this.props; const menuItems = this.getMenuItems(); @@ -449,6 +471,19 @@ class SectionHeaderContent extends React.Component { /> ) )} + {isRecycleBinFolder && ( + + )} )} @@ -468,6 +503,7 @@ export default inject( selectedFolderStore, filesActionsStore, settingsStore, + treeFoldersStore, }) => { const { setSelected, @@ -490,8 +526,10 @@ export default inject( setMoveToPanelVisible, setCopyPanelVisible, setDeleteDialogVisible, + setEmptyTrashDialogVisible, } = dialogsStore; + const { isRecycleBinFolder } = treeFoldersStore; const { deleteAction, downloadAction, getHeaderMenu } = filesActionsStore; return { @@ -524,6 +562,9 @@ export default inject( downloadAction, getHeaderMenu, getCheckboxItemLabel, + + isRecycleBinFolder, + setEmptyTrashDialogVisible, }; } )( From 4894779a1786018ce997145a8875b46084dcb390 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Wed, 17 Nov 2021 17:42:59 +0300 Subject: [PATCH 2/6] Web: Files: add restore all --- .../Client/src/pages/Home/Section/Header/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 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 a2bdc075603..38945c2e283 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 @@ -242,7 +242,10 @@ class SectionHeaderContent extends React.Component { }; onEmptyTrashAction = () => this.props.setEmptyTrashDialogVisible(true); - onRestoreAllAction = () => console.log("Restore all"); + onRestoreAllAction = () => { + this.props.setSelected("all"); + this.props.setMoveToPanelVisible(true); + }; getContextOptionsFolder = () => { const { t } = this.props; @@ -374,6 +377,7 @@ class SectionHeaderContent extends React.Component { personal, viewAs, isRecycleBinFolder, + isEmptyFilesList, } = this.props; const menuItems = this.getMenuItems(); @@ -471,7 +475,7 @@ class SectionHeaderContent extends React.Component { /> ) )} - {isRecycleBinFolder && ( + {isRecycleBinFolder && !isEmptyFilesList && ( Date: Wed, 17 Nov 2021 17:43:27 +0300 Subject: [PATCH 3/6] Web: Files: delete action --- products/ASC.Files/Client/src/store/FilesActionsStore.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/products/ASC.Files/Client/src/store/FilesActionsStore.js b/products/ASC.Files/Client/src/store/FilesActionsStore.js index da21f310cba..78a99d491eb 100644 --- a/products/ASC.Files/Client/src/store/FilesActionsStore.js +++ b/products/ASC.Files/Client/src/store/FilesActionsStore.js @@ -843,11 +843,7 @@ class FilesActionStore { label: t("Translations:Restore"), onClick: () => setMoveToPanelVisible(true), }) - .set("delete", deleteOption) - .set("emptyRecycleBin", { - label: t("EmptyRecycleBin"), - onClick: () => setEmptyTrashDialogVisible(true), - }); + .set("delete", deleteOption); return this.convertToArray(itemsCollection); }; getHeaderMenu = (t) => { From 8c8bf95faeb6e2bd851190ba86c307411818b0e9 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Thu, 18 Nov 2021 17:39:12 +0300 Subject: [PATCH 4/6] Web: Files: fixed empty trash --- .../src/pages/Home/Section/Header/index.js | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 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 38945c2e283..5253b983367 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 @@ -82,7 +82,21 @@ const StyledContainer = styled.div` @media ${tablet} { & > div:first-child { - padding: 8px 8px 8px 8px; + //padding: 8px 8px 8px 8px; + margin-right: -8px; + } + } + } + + .trash-button { + margin-bottom: -1px; + + @media (min-width: 1024px) { + margin-left: 8px; + } + + @media ${tablet} { + & > div:first-child { margin-right: -8px; } } @@ -242,6 +256,7 @@ class SectionHeaderContent extends React.Component { }; onEmptyTrashAction = () => this.props.setEmptyTrashDialogVisible(true); + //TODO: add restore all api method onRestoreAllAction = () => { this.props.setSelected("all"); this.props.setMoveToPanelVisible(true); @@ -476,17 +491,17 @@ class SectionHeaderContent extends React.Component { ) )} {isRecycleBinFolder && !isEmptyFilesList && ( - + + + )} )} From c3cc75401ca171a956734c3154955f43c4c8a579 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Thu, 18 Nov 2021 17:41:38 +0300 Subject: [PATCH 5/6] Web: Files: fix comment --- .../ASC.Files/Client/src/pages/Home/Section/Header/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5253b983367..aaa5667782a 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 @@ -82,7 +82,7 @@ const StyledContainer = styled.div` @media ${tablet} { & > div:first-child { - //padding: 8px 8px 8px 8px; + padding: 8px 8px 8px 8px; margin-right: -8px; } } From d5fb86fd41d0fb36502614f996ca920713d695c3 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Thu, 18 Nov 2021 17:47:11 +0300 Subject: [PATCH 6/6] Web: Files: delete useless --- .../src/pages/Home/Section/Header/index.js | 25 ------------------- 1 file changed, 25 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 aaa5667782a..4e3a30670d2 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 @@ -256,11 +256,6 @@ class SectionHeaderContent extends React.Component { }; onEmptyTrashAction = () => this.props.setEmptyTrashDialogVisible(true); - //TODO: add restore all api method - onRestoreAllAction = () => { - this.props.setSelected("all"); - this.props.setMoveToPanelVisible(true); - }; getContextOptionsFolder = () => { const { t } = this.props; @@ -311,26 +306,6 @@ class SectionHeaderContent extends React.Component { ]; }; - getContextOptionsTrash = () => { - const { t } = this.props; - return [ - { - key: "clear-trash", - label: t("EmptyRecycleBin"), - icon: "images/clear.active.react.svg", - onClick: this.onEmptyTrashAction, - disabled: false, - }, - { - key: "restore-all", - label: t("Translations:Restore"), - icon: "images/move.react.svg", - onClick: this.onRestoreAllAction, - disabled: false, - }, - ]; - }; - onBackToParentFolder = () => { const { setIsLoading, parentId, filter, fetchFiles } = this.props; setIsLoading(true);