From de653844c20ed51282e8cf4c74cd0437ad797f33 Mon Sep 17 00:00:00 2001 From: gazizova-vlada Date: Tue, 17 May 2022 11:07:36 +0300 Subject: [PATCH 1/6] Web:Files:Added storage of the names of the selected items for output to the toast in the SecondaryProgressDataStore. --- .../Client/src/store/SecondaryProgressDataStore.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/products/ASC.Files/Client/src/store/SecondaryProgressDataStore.js b/products/ASC.Files/Client/src/store/SecondaryProgressDataStore.js index dc540bcfcc..6a4472ce43 100644 --- a/products/ASC.Files/Client/src/store/SecondaryProgressDataStore.js +++ b/products/ASC.Files/Client/src/store/SecondaryProgressDataStore.js @@ -7,6 +7,8 @@ class SecondaryProgressDataStore { icon = "trash"; alert = false; filesCount = 0; + itemsSelectionLength = 0; + itemsSelectionTitle = null; constructor() { makeObservable(this, { @@ -16,11 +18,15 @@ class SecondaryProgressDataStore { icon: observable, alert: observable, filesCount: observable, + itemsSelectionLength: observable, + itemsSelectionTitle: observable, isSecondaryProgressFinished: computed, setSecondaryProgressBarData: action, clearSecondaryProgressData: action, + setItemsSelectionLength: action, + setItemsSelectionTitle: action, }); } @@ -33,6 +39,14 @@ class SecondaryProgressDataStore { } }; + setItemsSelectionTitle = (itemsSelectionTitle) => { + this.itemsSelectionTitle = itemsSelectionTitle; + }; + + setItemsSelectionLength = (itemsSelectionLength) => { + this.itemsSelectionLength = itemsSelectionLength; + }; + clearSecondaryProgressData = () => { this.percent = 0; this.label = ""; From cd69afbcd853bd873c4c0df1832caee739ebe2d8 Mon Sep 17 00:00:00 2001 From: gazizova-vlada Date: Tue, 17 May 2022 11:08:49 +0300 Subject: [PATCH 2/6] Web:Files:Added setSelectedItems method to write selected items. --- .../Client/src/store/FilesActionsStore.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/products/ASC.Files/Client/src/store/FilesActionsStore.js b/products/ASC.Files/Client/src/store/FilesActionsStore.js index 0278840c12..4f7d02e96c 100644 --- a/products/ASC.Files/Client/src/store/FilesActionsStore.js +++ b/products/ASC.Files/Client/src/store/FilesActionsStore.js @@ -740,10 +740,26 @@ class FilesActionStore { this.dialogsStore.setConflictResolveDialogVisible(true); }; + setSelectedItems = () => { + const selectionLength = this.filesStore.selection.length; + const selectionTitle = this.filesStore.selectionTitle; + + if (selectionLength && selectionTitle) { + this.uploadDataStore.secondaryProgressDataStore.setItemsSelectionLength( + selectionLength + ); + this.uploadDataStore.secondaryProgressDataStore.setItemsSelectionTitle( + selectionTitle + ); + } + }; + checkOperationConflict = async (operationData) => { const { destFolderId, folderIds, fileIds } = operationData; const { setBufferSelection } = this.filesStore; + this.setSelectedItems(); + this.filesStore.setSelected("none"); let conflicts; From 9229f97ed5514a4616a4aab43fef0c3f1c1d5ba0 Mon Sep 17 00:00:00 2001 From: gazizova-vlada Date: Tue, 17 May 2022 11:10:04 +0300 Subject: [PATCH 3/6] Web:Files:Display itemsSelectionLength and itemsSelectionTitle in a toast. --- products/ASC.Files/Client/src/pages/Home/index.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/products/ASC.Files/Client/src/pages/Home/index.js b/products/ASC.Files/Client/src/pages/Home/index.js index 728f3ca2d8..e11a130bfb 100644 --- a/products/ASC.Files/Client/src/pages/Home/index.js +++ b/products/ASC.Files/Client/src/pages/Home/index.js @@ -262,8 +262,8 @@ class PureHome extends React.Component { const { isProgressFinished, secondaryProgressDataStoreIcon, - selectionLength, - selectionTitle, + itemsSelectionLength, + itemsSelectionTitle, } = this.props; if (this.props.isHeaderVisible !== prevProps.isHeaderVisible) { @@ -275,8 +275,8 @@ class PureHome extends React.Component { ) { this.showOperationToast( secondaryProgressDataStoreIcon, - selectionLength, - selectionTitle + itemsSelectionLength, + itemsSelectionTitle ); } } @@ -440,6 +440,8 @@ export default inject( icon: secondaryProgressDataStoreIcon, alert: secondaryProgressDataStoreAlert, isSecondaryProgressFinished: isProgressFinished, + itemsSelectionLength, + itemsSelectionTitle, } = secondaryProgressDataStore; const { @@ -494,6 +496,9 @@ export default inject( isProgressFinished, selectionTitle, + itemsSelectionLength, + itemsSelectionTitle, + setExpandedKeys, setFirstLoad, setDragging, From 9a2243d915724097acea51da2de30ce143c20296 Mon Sep 17 00:00:00 2001 From: gazizova-vlada Date: Tue, 17 May 2022 11:10:48 +0300 Subject: [PATCH 4/6] Web:Files:Added setSelectedItems method to write selected items. --- .../src/components/panels/SelectFolderDialog/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/products/ASC.Files/Client/src/components/panels/SelectFolderDialog/index.js b/products/ASC.Files/Client/src/components/panels/SelectFolderDialog/index.js index 61a05a39df..f1af23a2e4 100644 --- a/products/ASC.Files/Client/src/components/panels/SelectFolderDialog/index.js +++ b/products/ASC.Files/Client/src/components/panels/SelectFolderDialog/index.js @@ -155,8 +155,11 @@ class SelectFolderDialog extends React.Component { providerKey, folderTitle, folderId, + setSelectedItems, } = this.props; + setSelectedItems(); + onSubmit && onSubmit(folderId, folderTitle, providerKey); onSave && onSave(e, folderId); onSetNewFolderPath && onSetNewFolderPath(folderId); @@ -285,10 +288,13 @@ export default inject( selectFolderDialogStore, filesStore, auth, + filesActionsStore, }) => { const { treeFolders, setExpandedPanelKeys } = treeFoldersStore; const { filter } = filesStore; + const { setSelectedItems } = filesActionsStore; + const { id } = selectedFolderStore; const { setFolderId, @@ -314,6 +320,7 @@ export default inject( setProviderKey, treeFolders, filter, + setSelectedItems, }; } )( From 3fd6c7bd896c2617f5d102303fa0529d8d2e34c8 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Tue, 17 May 2022 11:47:16 +0300 Subject: [PATCH 5/6] Web: Client: Files: Row: Fixed displaying context menu button inside editing container --- .../src/pages/Home/Section/Body/RowsView/SimpleFilesRow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/ASC.Files/Client/src/pages/Home/Section/Body/RowsView/SimpleFilesRow.js b/products/ASC.Files/Client/src/pages/Home/Section/Body/RowsView/SimpleFilesRow.js index 071d5ee7b1..e8ecd3c039 100644 --- a/products/ASC.Files/Client/src/pages/Home/Section/Body/RowsView/SimpleFilesRow.js +++ b/products/ASC.Files/Client/src/pages/Home/Section/Body/RowsView/SimpleFilesRow.js @@ -84,7 +84,7 @@ const StyledSimpleFilesRow = styled(Row)` } ${(props) => - !props.contextOptions && + (!props.contextOptions || props.isEdit) && ` & > div:last-child { width: 0px; From 5535bc870a62b7d888f34cafc17c0e6297404868 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Tue, 17 May 2022 12:49:28 +0300 Subject: [PATCH 6/6] Web: Client: Files: Fixed empty trash button click on already starting emptying trash operation --- .../Client/src/pages/Home/Section/Header/index.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 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 ec2d7b479e..df06c3075b 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 @@ -220,7 +220,14 @@ class SectionHeaderContent extends React.Component { } }; - onEmptyTrashAction = () => this.props.setEmptyTrashDialogVisible(true); + onEmptyTrashAction = () => { + const { activeFiles, activeFolders } = this.props; + const isExistActiveItems = [...activeFiles, ...activeFolders].length > 0; + + if (isExistActiveItems) return; + + this.props.setEmptyTrashDialogVisible(true); + }; getContextOptionsFolder = () => { const { t, personal } = this.props; @@ -447,6 +454,8 @@ export default inject( viewAs, setIsLoading, fetchFiles, + activeFiles, + activeFolders, } = filesStore; const { setAction } = fileActionStore; const { @@ -515,6 +524,9 @@ export default inject( setIsLoading, fetchFiles, + + activeFiles, + activeFolders, }; } )(