From 93545f04fa4851a5c9db0ab645684e291ff73d6f Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Wed, 27 Oct 2021 19:16:06 +0300 Subject: [PATCH 01/26] Web: Files: fixed files upload --- .../ASC.Files/Client/src/store/FilesStore.js | 2 +- .../Client/src/store/UploadDataStore.js | 72 +++++++++++-------- 2 files changed, 45 insertions(+), 29 deletions(-) diff --git a/products/ASC.Files/Client/src/store/FilesStore.js b/products/ASC.Files/Client/src/store/FilesStore.js index c860e29708..bdeef3406e 100644 --- a/products/ASC.Files/Client/src/store/FilesStore.js +++ b/products/ASC.Files/Client/src/store/FilesStore.js @@ -340,7 +340,7 @@ class FilesStore { const selectedFolder = { selectedFolder: { ...this.selectedFolderStore }, }; - this.createThumbnails(); + this.viewAs === "tile" && this.createThumbnails(); return Promise.resolve(selectedFolder); }) .catch((err) => { diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index c64ad3e77f..560c74deaa 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -8,6 +8,7 @@ import { ConflictResolveType } from "@appserver/common/constants"; import { getFolder, getFileInfo, + getFolderInfo, getProgress, uploadFile, convertFile, @@ -450,37 +451,46 @@ class UploadDataStore { } }; - refreshFiles = (folderId, needUpdateTree = true) => { - const { setTreeFolders } = this.treeFoldersStore; + refreshFiles = (folderId, needUpdateTree = true, currentFile, folderInfo) => { if ( this.selectedFolderStore.id === folderId && window.location.pathname.indexOf("/history") === -1 ) { - return this.filesStore.fetchFiles( - this.selectedFolderStore.id, - this.filesStore.filter.clone(), - false, - true - ); - } else if (needUpdateTree) { - return getFolder(folderId, this.filesStore.filter.clone()).then( - (data) => { - const path = data.pathParts; - const newTreeFolders = this.treeFoldersStore.treeFolders; - const folders = data.folders; - const foldersCount = data.count; - loopTreeFolders(path, newTreeFolders, folders, foldersCount); - setTreeFolders(newTreeFolders); + const { files, setFiles, folders, setFolders, filter } = this.filesStore; + + const addNewFile = () => { + if (folderInfo) { + newFolders.push(folderInfo); + setFolders(newFolders); + } else { + newFiles.push(currentFile.fileInfo); + setFiles(newFiles); } - ); + }; + + const newFiles = files; + const newFolders = folders; + + if (filter.total >= filter.pageCount) { + if (files.length) { + newFiles.pop(); + addNewFile(); + } else { + newFolders.pop(); + addNewFile(); + } + } else { + addNewFile(); + } + } else if (needUpdateTree) { + const { expandedKeys, setExpandedKeys } = this.treeFoldersStore; + const newExpandedKeys = expandedKeys.filter((x) => x !== folderId + ""); + setExpandedKeys(newExpandedKeys); } }; - throttleRefreshFiles = throttle((toFolderId) => { - return this.refreshFiles(toFolderId).catch((err) => { - console.log("RefreshFiles failed", err); - return Promise.resolve(); - }); + throttleRefreshFiles = throttle((toFolderId, currentFile, folderInfo) => { + return this.refreshFiles(toFolderId, true, currentFile, folderInfo); }, 1000); uploadFileChunks = async ( @@ -489,7 +499,7 @@ class UploadDataStore { fileSize, indexOfFile, file, - t + path ) => { const length = requestsDataArray.length; for (let index = 0; index < length; index++) { @@ -546,6 +556,11 @@ class UploadDataStore { if (!currentFile) return Promise.resolve(); const { toFolderId, needConvert } = currentFile; + let folderInfo = null; + if (path[path.length - 2] === this.selectedFolderStore.id) { + folderInfo = await getFolderInfo(path[path.length - 1]); + } + if (needConvert) { runInAction(() => (currentFile.action = "convert")); if (!this.filesToConversion.length || this.converted) { @@ -556,7 +571,7 @@ class UploadDataStore { } return Promise.resolve(); } else { - return this.throttleRefreshFiles(toFolderId); + return this.throttleRefreshFiles(toFolderId, currentFile, folderInfo); } }; @@ -646,6 +661,7 @@ class UploadDataStore { ) .then((res) => { const location = res.data.location; + const path = res.data.path; const requestsDataArray = []; @@ -659,9 +675,9 @@ class UploadDataStore { chunk++; } - return { location, requestsDataArray, fileSize }; + return { location, requestsDataArray, fileSize, path }; }) - .then(({ location, requestsDataArray, fileSize }) => { + .then(({ location, requestsDataArray, fileSize, path }) => { this.primaryProgressDataStore.setPrimaryProgressBarData({ icon: "upload", visible: true, @@ -678,7 +694,7 @@ class UploadDataStore { fileSize, indexOfFile, file, - t + path ); }) .catch((err) => { From f923786cf4c7d88cdc0dcb0d5d0995741f39e1b6 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Wed, 27 Oct 2021 19:55:21 +0300 Subject: [PATCH 02/26] Web: Files: fixed upload --- .../Client/src/store/UploadDataStore.js | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index 560c74deaa..b90ca90b16 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -318,7 +318,8 @@ class UploadDataStore { file.inConversion = false; } }); - this.refreshFiles(toFolderId, false); + + //this.refreshFiles(toFolderId, false); break; } @@ -336,7 +337,7 @@ class UploadDataStore { } }); - this.refreshFiles(toFolderId, false); + this.refreshFiles(toFolderId, false, file); const percent = this.getConversationPercent(index + 1); this.setConversionPercent(percent, !!error); } @@ -456,21 +457,35 @@ class UploadDataStore { this.selectedFolderStore.id === folderId && window.location.pathname.indexOf("/history") === -1 ) { - const { files, setFiles, folders, setFolders, filter } = this.filesStore; + const { + files, + setFiles, + folders, + setFolders, + filter, + setFilter, + } = this.filesStore; const addNewFile = () => { if (folderInfo) { - newFolders.push(folderInfo); + folderInfo && newFolders.unshift(folderInfo); setFolders(newFolders); } else { - newFiles.push(currentFile.fileInfo); + currentFile && + currentFile.fileInfo && + newFiles.unshift(currentFile.fileInfo); setFiles(newFiles); } + + const newFilter = filter; + newFilter.total = newFilter.total += 1; }; const newFiles = files; const newFolders = folders; + if (!currentFile && !folderInfo) return; + if (filter.total >= filter.pageCount) { if (files.length) { newFiles.pop(); @@ -489,9 +504,9 @@ class UploadDataStore { } }; - throttleRefreshFiles = throttle((toFolderId, currentFile, folderInfo) => { + throttleRefreshFiles = (toFolderId, currentFile, folderInfo) => { return this.refreshFiles(toFolderId, true, currentFile, folderInfo); - }, 1000); + }; uploadFileChunks = async ( location, From ca52c409c286b93e6ca637ad31740e94234936d7 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Wed, 27 Oct 2021 20:41:54 +0300 Subject: [PATCH 03/26] Web: Files: fixed folders upload --- .../Client/src/store/UploadDataStore.js | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index b90ca90b16..3ff54c81bc 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -466,24 +466,27 @@ class UploadDataStore { setFilter, } = this.filesStore; + const newFiles = files; + const newFolders = folders; + const addNewFile = () => { if (folderInfo) { folderInfo && newFolders.unshift(folderInfo); setFolders(newFolders); + const newFilter = filter; + newFilter.total = newFilter.total += 1; + setFilter(newFilter); } else { currentFile && currentFile.fileInfo && newFiles.unshift(currentFile.fileInfo); setFiles(newFiles); + const newFilter = filter; + newFilter.total = newFilter.total += 1; + setFilter(newFilter); } - - const newFilter = filter; - newFilter.total = newFilter.total += 1; }; - const newFiles = files; - const newFolders = folders; - if (!currentFile && !folderInfo) return; if (filter.total >= filter.pageCount) { @@ -586,7 +589,11 @@ class UploadDataStore { } return Promise.resolve(); } else { - return this.throttleRefreshFiles(toFolderId, currentFile, folderInfo); + //TODO: + if (currentFile.action === "uploaded") { + return this.throttleRefreshFiles(toFolderId, currentFile, folderInfo); + } + return Promise.resolve(); } }; From 6d62e5481323b51ab2d5ece060726f525c3b4c49 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Thu, 28 Oct 2021 10:57:15 +0300 Subject: [PATCH 04/26] Web: Files: fixed files upload if filter is set --- products/ASC.Files/Client/src/store/UploadDataStore.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index 3ff54c81bc..621f720f59 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -487,7 +487,13 @@ class UploadDataStore { } }; - if (!currentFile && !folderInfo) return; + const isFiltered = + filter.filterType || + filter.authorType || + filter.search || + filter.page !== 0; + + if ((!currentFile && !folderInfo) || isFiltered) return; if (filter.total >= filter.pageCount) { if (files.length) { From dcb8f108b8a971b334aae13c9c133a0c410a0aa5 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Thu, 28 Oct 2021 11:30:23 +0300 Subject: [PATCH 05/26] Web: Files: fixed Paging re-render --- .../PageLayout/sub-components/section-paging.js | 6 +++--- .../Client/src/pages/Home/Section/Paging/index.js | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/asc-web-common/components/PageLayout/sub-components/section-paging.js b/packages/asc-web-common/components/PageLayout/sub-components/section-paging.js index d13cf2aa6c..16d0447734 100644 --- a/packages/asc-web-common/components/PageLayout/sub-components/section-paging.js +++ b/packages/asc-web-common/components/PageLayout/sub-components/section-paging.js @@ -7,9 +7,9 @@ const StyledSectionPaging = styled.div` `; class SectionPaging extends React.Component { - shouldComponentUpdate(nextProps) { - return !equal(this.props, nextProps); - } + // shouldComponentUpdate(nextProps) { + // return !equal(this.props, nextProps); + // } render() { return ; diff --git a/products/ASC.Files/Client/src/pages/Home/Section/Paging/index.js b/products/ASC.Files/Client/src/pages/Home/Section/Paging/index.js index 108b3a8d69..e5a833b1bb 100644 --- a/products/ASC.Files/Client/src/pages/Home/Section/Paging/index.js +++ b/products/ASC.Files/Client/src/pages/Home/Section/Paging/index.js @@ -13,6 +13,7 @@ const SectionPagingContent = ({ selectedCount, selectedFolderId, tReady, + filterTotal, }) => { const { t } = useTranslation("Home"); const onNextClick = useCallback( @@ -104,8 +105,8 @@ const SectionPagingContent = ({ ); const pageItems = useMemo(() => { - if (filter.total < filter.pageCount) return []; - const totalPages = Math.ceil(filter.total / filter.pageCount); + if (filterTotal < filter.pageCount) return []; + const totalPages = Math.ceil(filterTotal / filter.pageCount); return [...Array(totalPages).keys()].map((item) => { return { key: item, @@ -115,7 +116,7 @@ const SectionPagingContent = ({ }), }; }); - }, [filter.total, filter.pageCount, t]); + }, [filterTotal, filter.pageCount, t]); const emptyPageSelection = { key: 0, @@ -137,11 +138,11 @@ const SectionPagingContent = ({ const showCountItem = useMemo(() => { if (files && folders) return ( - files.length + folders.length === filter.pageCount || filter.total > 25 + files.length + folders.length === filter.pageCount || filterTotal > 25 ); }, [files, folders, filter, pageItems]); - return !tReady || (filter.total < filter.pageCount && filter.total < 26) ? ( + return !tReady || (filterTotal < filter.pageCount && filterTotal < 26) ? ( <> ) : ( { folders, selectedFolderId: selectedFolderStore.id, filter, + filterTotal: filter.total, setIsLoading, fetchFiles, From a1d8a700c0253b9a8f12dcbac3a2ffc04ff7109c Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Thu, 28 Oct 2021 12:11:53 +0300 Subject: [PATCH 06/26] Web: Files: fixed Paging re-render --- .../Client/src/pages/Home/Section/Paging/index.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/products/ASC.Files/Client/src/pages/Home/Section/Paging/index.js b/products/ASC.Files/Client/src/pages/Home/Section/Paging/index.js index e5a833b1bb..5c4c89df33 100644 --- a/products/ASC.Files/Client/src/pages/Home/Section/Paging/index.js +++ b/products/ASC.Files/Client/src/pages/Home/Section/Paging/index.js @@ -13,7 +13,7 @@ const SectionPagingContent = ({ selectedCount, selectedFolderId, tReady, - filterTotal, + totalPages, }) => { const { t } = useTranslation("Home"); const onNextClick = useCallback( @@ -105,8 +105,7 @@ const SectionPagingContent = ({ ); const pageItems = useMemo(() => { - if (filterTotal < filter.pageCount) return []; - const totalPages = Math.ceil(filterTotal / filter.pageCount); + if (filter.total < filter.pageCount) return []; return [...Array(totalPages).keys()].map((item) => { return { key: item, @@ -116,7 +115,7 @@ const SectionPagingContent = ({ }), }; }); - }, [filterTotal, filter.pageCount, t]); + }, [filter.total, filter.pageCount, t, totalPages]); const emptyPageSelection = { key: 0, @@ -138,11 +137,11 @@ const SectionPagingContent = ({ const showCountItem = useMemo(() => { if (files && folders) return ( - files.length + folders.length === filter.pageCount || filterTotal > 25 + files.length + folders.length === filter.pageCount || filter.total > 25 ); }, [files, folders, filter, pageItems]); - return !tReady || (filterTotal < filter.pageCount && filterTotal < 26) ? ( + return !tReady || (filter.total < filter.pageCount && filter.total < 26) ? ( <> ) : ( { const { files, folders, fetchFiles, filter, setIsLoading } = filesStore; + const totalPages = Math.ceil(filter.total / filter.pageCount); + return { files, folders, selectedFolderId: selectedFolderStore.id, filter, - filterTotal: filter.total, + totalPages, setIsLoading, fetchFiles, From b72ef823418e333d5b0c86c304501f7164a7429c Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Thu, 28 Oct 2021 16:30:00 +0300 Subject: [PATCH 07/26] Web: Files: fixed folder upload --- products/ASC.Files/Client/src/store/UploadDataStore.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index 621f720f59..935869fd2f 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -495,6 +495,14 @@ class UploadDataStore { if ((!currentFile && !folderInfo) || isFiltered) return; + if (folderInfo) { + const folderIndex = folders.findIndex((f) => f.id === folderInfo.id); + if (folderIndex !== -1) { + folders[folderIndex] = folderInfo; + return; + } + } + if (filter.total >= filter.pageCount) { if (files.length) { newFiles.pop(); From b30ae5818536013794b986b854e065be70ec58e7 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Thu, 28 Oct 2021 16:44:46 +0300 Subject: [PATCH 08/26] Web: Files: fixed upload folder hierarchy --- products/ASC.Files/Client/src/store/UploadDataStore.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index 935869fd2f..9600a59adb 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -605,7 +605,11 @@ class UploadDataStore { } else { //TODO: if (currentFile.action === "uploaded") { - return this.throttleRefreshFiles(toFolderId, currentFile, folderInfo); + const file = + path[path.length - 2] === this.selectedFolderStore.id + ? currentFile + : null; + return this.throttleRefreshFiles(toFolderId, file, folderInfo); } return Promise.resolve(); } From fc93266964e54e1f3e6e9599c64941df5e45a956 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Tue, 2 Nov 2021 10:54:35 +0300 Subject: [PATCH 09/26] Web: Files: fixed folder update after upload --- products/ASC.Files/Client/src/store/UploadDataStore.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index 9600a59adb..1f9afd902d 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -606,9 +606,7 @@ class UploadDataStore { //TODO: if (currentFile.action === "uploaded") { const file = - path[path.length - 2] === this.selectedFolderStore.id - ? currentFile - : null; + toFolderId === this.selectedFolderStore.id ? currentFile : null; return this.throttleRefreshFiles(toFolderId, file, folderInfo); } return Promise.resolve(); From 93fae1580ebf236b2f8adf70b95b14dcc067c7c3 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Tue, 2 Nov 2021 13:14:52 +0300 Subject: [PATCH 10/26] Web: Files: fixed files upload --- .../Client/src/store/UploadDataStore.js | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index 1f9afd902d..90e929fd8f 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -337,7 +337,7 @@ class UploadDataStore { } }); - this.refreshFiles(toFolderId, false, file); + this.refreshFiles(file.fileInfo.folderId, false, file); const percent = this.getConversationPercent(index + 1); this.setConversionPercent(percent, !!error); } @@ -471,19 +471,26 @@ class UploadDataStore { const addNewFile = () => { if (folderInfo) { - folderInfo && newFolders.unshift(folderInfo); - setFolders(newFolders); - const newFilter = filter; - newFilter.total = newFilter.total += 1; - setFilter(newFilter); + const isFolderExist = newFolders.find((x) => x.id === folderInfo.id); + if (!isFolderExist && folderInfo) { + newFolders.unshift(folderInfo); + setFolders(newFolders); + const newFilter = filter; + newFilter.total = newFilter.total += 1; + setFilter(newFilter); + } } else { - currentFile && - currentFile.fileInfo && + const isFileExist = newFiles.find( + (x) => x.id === currentFile.fileInfo.id + ); + + if (!isFileExist && currentFile && currentFile.fileInfo) { newFiles.unshift(currentFile.fileInfo); - setFiles(newFiles); - const newFilter = filter; - newFilter.total = newFilter.total += 1; - setFilter(newFilter); + setFiles(newFiles); + const newFilter = filter; + newFilter.total = newFilter.total += 1; + setFilter(newFilter); + } } }; @@ -494,6 +501,7 @@ class UploadDataStore { filter.page !== 0; if ((!currentFile && !folderInfo) || isFiltered) return; + if (folderInfo && this.selectedFolderStore.id === folderInfo.id) return; if (folderInfo) { const folderIndex = folders.findIndex((f) => f.id === folderInfo.id); @@ -522,7 +530,7 @@ class UploadDataStore { }; throttleRefreshFiles = (toFolderId, currentFile, folderInfo) => { - return this.refreshFiles(toFolderId, true, currentFile, folderInfo); + return this.refreshFiles(toFolderId, !!folderInfo, currentFile, folderInfo); }; uploadFileChunks = async ( @@ -605,9 +613,12 @@ class UploadDataStore { } else { //TODO: if (currentFile.action === "uploaded") { - const file = - toFolderId === this.selectedFolderStore.id ? currentFile : null; - return this.throttleRefreshFiles(toFolderId, file, folderInfo); + const toFolder = + currentFile.fileInfo.folderId === this.selectedFolderStore.id + ? currentFile.fileInfo.folderId + : toFolderId; + + return this.throttleRefreshFiles(toFolder, currentFile, folderInfo); } return Promise.resolve(); } From 5ba3df944c95344d49640a4b5be1465c485d1e6e Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Tue, 2 Nov 2021 14:21:45 +0300 Subject: [PATCH 11/26] Web: Files: fixed upload folder hierarchy --- products/ASC.Files/Client/src/store/UploadDataStore.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index 90e929fd8f..8aad370d9c 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -616,7 +616,9 @@ class UploadDataStore { const toFolder = currentFile.fileInfo.folderId === this.selectedFolderStore.id ? currentFile.fileInfo.folderId - : toFolderId; + : folderInfo + ? toFolderId + : null; return this.throttleRefreshFiles(toFolder, currentFile, folderInfo); } From fc28c971c80127bf984ee65afdc05dc5a3edcc76 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Tue, 2 Nov 2021 14:43:15 +0300 Subject: [PATCH 12/26] Web: Files: fixed upload folder hierarchy --- products/ASC.Files/Client/src/store/UploadDataStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index 8aad370d9c..cfbd644ce5 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -617,7 +617,7 @@ class UploadDataStore { currentFile.fileInfo.folderId === this.selectedFolderStore.id ? currentFile.fileInfo.folderId : folderInfo - ? toFolderId + ? folderInfo.parentId : null; return this.throttleRefreshFiles(toFolder, currentFile, folderInfo); From 96d12d3afc121a5c4b6efd1bdfa379bbc5209462 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Tue, 2 Nov 2021 15:26:43 +0300 Subject: [PATCH 13/26] Web: Files: fixed updating the folder tree after upload --- .../Client/src/store/UploadDataStore.js | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index cfbd644ce5..347ea631fa 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -2,7 +2,6 @@ import { makeAutoObservable, runInAction } from "mobx"; import { TIMEOUT } from "../helpers/constants"; import { loopTreeFolders } from "../helpers/files-helpers"; import uniqueid from "lodash/uniqueId"; -import throttle from "lodash/throttle"; import sumBy from "lodash/sumBy"; import { ConflictResolveType } from "@appserver/common/constants"; import { @@ -453,19 +452,18 @@ class UploadDataStore { }; refreshFiles = (folderId, needUpdateTree = true, currentFile, folderInfo) => { + const { + files, + setFiles, + folders, + setFolders, + filter, + setFilter, + } = this.filesStore; if ( this.selectedFolderStore.id === folderId && window.location.pathname.indexOf("/history") === -1 ) { - const { - files, - setFiles, - folders, - setFolders, - filter, - setFilter, - } = this.filesStore; - const newFiles = files; const newFolders = folders; @@ -523,14 +521,23 @@ class UploadDataStore { addNewFile(); } } else if (needUpdateTree) { - const { expandedKeys, setExpandedKeys } = this.treeFoldersStore; + const { + expandedKeys, + setExpandedKeys, + treeFolders, + } = this.treeFoldersStore; const newExpandedKeys = expandedKeys.filter((x) => x !== folderId + ""); setExpandedKeys(newExpandedKeys); - } - }; - throttleRefreshFiles = (toFolderId, currentFile, folderInfo) => { - return this.refreshFiles(toFolderId, !!folderInfo, currentFile, folderInfo); + let path = this.selectedFolderStore.pathParts.slice(0); + + loopTreeFolders( + path, + treeFolders, + this.filesStore.folders, + this.filesStore.folders.length + ); + } }; uploadFileChunks = async ( @@ -594,9 +601,10 @@ class UploadDataStore { const currentFile = this.files[indexOfFile]; if (!currentFile) return Promise.resolve(); - const { toFolderId, needConvert } = currentFile; + const { needConvert } = currentFile; let folderInfo = null; + if (path[path.length - 2] === this.selectedFolderStore.id) { folderInfo = await getFolderInfo(path[path.length - 1]); } @@ -620,7 +628,7 @@ class UploadDataStore { ? folderInfo.parentId : null; - return this.throttleRefreshFiles(toFolder, currentFile, folderInfo); + this.refreshFiles(toFolder, true, currentFile, folderInfo); } return Promise.resolve(); } From 21419325be47073c956d6bb796f6dda5aec09c68 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Tue, 2 Nov 2021 15:42:49 +0300 Subject: [PATCH 14/26] Web: Files: fixed updating the folder tree after upload --- .../Client/src/store/UploadDataStore.js | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index 347ea631fa..1ee90c9e59 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -520,23 +520,25 @@ class UploadDataStore { } else { addNewFile(); } - } else if (needUpdateTree) { - const { - expandedKeys, - setExpandedKeys, - treeFolders, - } = this.treeFoldersStore; - const newExpandedKeys = expandedKeys.filter((x) => x !== folderId + ""); - setExpandedKeys(newExpandedKeys); - let path = this.selectedFolderStore.pathParts.slice(0); + if (needUpdateTree) { + const { + expandedKeys, + setExpandedKeys, + treeFolders, + } = this.treeFoldersStore; + const newExpandedKeys = expandedKeys.filter((x) => x !== folderId + ""); + setExpandedKeys(newExpandedKeys); - loopTreeFolders( - path, - treeFolders, - this.filesStore.folders, - this.filesStore.folders.length - ); + let path = this.selectedFolderStore.pathParts.slice(0); + + loopTreeFolders( + path, + treeFolders, + this.filesStore.folders, + this.filesStore.folders.length + ); + } } }; From 49a0490df7849ff1e6e40c5bd75b495c68a39210 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Wed, 3 Nov 2021 12:30:15 +0300 Subject: [PATCH 15/26] Web: Files: fixed updating the folder tree after upload --- .../Client/src/store/UploadDataStore.js | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index 1ee90c9e59..e39bc86c6a 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -460,10 +460,7 @@ class UploadDataStore { filter, setFilter, } = this.filesStore; - if ( - this.selectedFolderStore.id === folderId && - window.location.pathname.indexOf("/history") === -1 - ) { + if (window.location.pathname.indexOf("/history") === -1) { const newFiles = files; const newFolders = folders; @@ -527,15 +524,17 @@ class UploadDataStore { setExpandedKeys, treeFolders, } = this.treeFoldersStore; - const newExpandedKeys = expandedKeys.filter((x) => x !== folderId + ""); + + const newExpandedKeys = expandedKeys.filter( + (x) => x !== folderInfo.path[folderInfo.path.length - 1] + "" + ); + setExpandedKeys(newExpandedKeys); - let path = this.selectedFolderStore.pathParts.slice(0); - loopTreeFolders( - path, + folderInfo.path, treeFolders, - this.filesStore.folders, + this.filesStore.folders.length === 1 ? this.filesStore.folders : [], this.filesStore.folders.length ); } @@ -606,10 +605,9 @@ class UploadDataStore { const { needConvert } = currentFile; let folderInfo = null; - - if (path[path.length - 2] === this.selectedFolderStore.id) { - folderInfo = await getFolderInfo(path[path.length - 1]); - } + const index = path.findIndex((x) => x === this.selectedFolderStore.id); + const folderId = path[index + 1]; + if (folderId) folderInfo = await getFolderInfo(folderId); if (needConvert) { runInAction(() => (currentFile.action = "convert")); @@ -621,16 +619,26 @@ class UploadDataStore { } return Promise.resolve(); } else { - //TODO: if (currentFile.action === "uploaded") { const toFolder = currentFile.fileInfo.folderId === this.selectedFolderStore.id ? currentFile.fileInfo.folderId : folderInfo - ? folderInfo.parentId + ? folderId : null; - this.refreshFiles(toFolder, true, currentFile, folderInfo); + if (folderInfo) { + const newPath = []; + + let i = 0; + while (path[i] && path[i] !== folderId) { + newPath.push(path[i]); + i++; + } + + folderInfo.path = newPath; + } + this.refreshFiles(toFolder, !!folderInfo, currentFile, folderInfo); } return Promise.resolve(); } From bc765dfb708d21b18a7daa688b40e4a8d01d5ba5 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Wed, 3 Nov 2021 12:57:35 +0300 Subject: [PATCH 16/26] Web: Files: fixed upload convertFiles --- .../Client/src/store/UploadDataStore.js | 52 ++++++++----------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index e39bc86c6a..7e17404877 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -336,7 +336,7 @@ class UploadDataStore { } }); - this.refreshFiles(file.fileInfo.folderId, false, file); + this.refreshFiles(file); const percent = this.getConversationPercent(index + 1); this.setConversionPercent(percent, !!error); } @@ -451,7 +451,7 @@ class UploadDataStore { } }; - refreshFiles = (folderId, needUpdateTree = true, currentFile, folderInfo) => { + refreshFiles = async (currentFile) => { const { files, setFiles, @@ -464,6 +464,22 @@ class UploadDataStore { const newFiles = files; const newFolders = folders; + let folderInfo = null; + const index = currentFile.path.findIndex( + (x) => x === this.selectedFolderStore.id + ); + const folderId = currentFile.path[index + 1]; + if (folderId) folderInfo = await getFolderInfo(folderId); + + const newPath = []; + if (folderInfo) { + let i = 0; + while (currentFile.path[i] && currentFile.path[i] !== folderId) { + newPath.push(currentFile.path[i]); + i++; + } + } + const addNewFile = () => { if (folderInfo) { const isFolderExist = newFolders.find((x) => x.id === folderInfo.id); @@ -518,7 +534,7 @@ class UploadDataStore { addNewFile(); } - if (needUpdateTree) { + if (!!folderInfo) { const { expandedKeys, setExpandedKeys, @@ -526,13 +542,13 @@ class UploadDataStore { } = this.treeFoldersStore; const newExpandedKeys = expandedKeys.filter( - (x) => x !== folderInfo.path[folderInfo.path.length - 1] + "" + (x) => x !== newPath[newPath.length - 1] + "" ); setExpandedKeys(newExpandedKeys); loopTreeFolders( - folderInfo.path, + newPath, treeFolders, this.filesStore.folders.length === 1 ? this.filesStore.folders : [], this.filesStore.folders.length @@ -601,14 +617,10 @@ class UploadDataStore { // All chuncks are uploaded const currentFile = this.files[indexOfFile]; + currentFile.path = path; if (!currentFile) return Promise.resolve(); const { needConvert } = currentFile; - let folderInfo = null; - const index = path.findIndex((x) => x === this.selectedFolderStore.id); - const folderId = path[index + 1]; - if (folderId) folderInfo = await getFolderInfo(folderId); - if (needConvert) { runInAction(() => (currentFile.action = "convert")); if (!this.filesToConversion.length || this.converted) { @@ -620,25 +632,7 @@ class UploadDataStore { return Promise.resolve(); } else { if (currentFile.action === "uploaded") { - const toFolder = - currentFile.fileInfo.folderId === this.selectedFolderStore.id - ? currentFile.fileInfo.folderId - : folderInfo - ? folderId - : null; - - if (folderInfo) { - const newPath = []; - - let i = 0; - while (path[i] && path[i] !== folderId) { - newPath.push(path[i]); - i++; - } - - folderInfo.path = newPath; - } - this.refreshFiles(toFolder, !!folderInfo, currentFile, folderInfo); + this.refreshFiles(currentFile); } return Promise.resolve(); } From 94fbdfae448f7609a255236e62a7142848c818f6 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Wed, 3 Nov 2021 13:50:44 +0300 Subject: [PATCH 17/26] Web: Files: fixed upload to tree menu --- .../ASC.Files/Client/src/store/UploadDataStore.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index 7e17404877..eb7766c3cc 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -463,19 +463,22 @@ class UploadDataStore { if (window.location.pathname.indexOf("/history") === -1) { const newFiles = files; const newFolders = folders; + const path = currentFile.path; + + if (path[path.length - 1] !== this.selectedFolderStore.id) { + return; + } let folderInfo = null; - const index = currentFile.path.findIndex( - (x) => x === this.selectedFolderStore.id - ); - const folderId = currentFile.path[index + 1]; + const index = path.findIndex((x) => x === this.selectedFolderStore.id); + const folderId = index !== -1 ? path[index + 1] : null; if (folderId) folderInfo = await getFolderInfo(folderId); const newPath = []; if (folderInfo) { let i = 0; - while (currentFile.path[i] && currentFile.path[i] !== folderId) { - newPath.push(currentFile.path[i]); + while (path[i] && path[i] !== folderId) { + newPath.push(path[i]); i++; } } From daf75937a4c43f68cae792d7bfa4dd1f7d70e2eb Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Wed, 3 Nov 2021 15:42:23 +0300 Subject: [PATCH 18/26] Web: Files: fixed upload folder --- products/ASC.Files/Client/src/store/UploadDataStore.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/products/ASC.Files/Client/src/store/UploadDataStore.js b/products/ASC.Files/Client/src/store/UploadDataStore.js index eb7766c3cc..36a04e7c00 100644 --- a/products/ASC.Files/Client/src/store/UploadDataStore.js +++ b/products/ASC.Files/Client/src/store/UploadDataStore.js @@ -465,10 +465,6 @@ class UploadDataStore { const newFolders = folders; const path = currentFile.path; - if (path[path.length - 1] !== this.selectedFolderStore.id) { - return; - } - let folderInfo = null; const index = path.findIndex((x) => x === this.selectedFolderStore.id); const folderId = index !== -1 ? path[index + 1] : null; @@ -483,6 +479,10 @@ class UploadDataStore { } } + if (newPath[newPath.length - 1] !== this.selectedFolderStore.id) { + return; + } + const addNewFile = () => { if (folderInfo) { const isFolderExist = newFolders.find((x) => x.id === folderInfo.id); From ffddbbe1bac501f72c325fe5e63614a4728d169b Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Mon, 8 Nov 2021 13:52:18 +0300 Subject: [PATCH 19/26] Web: Files: added tree menu update --- .../ASC.Files/Client/src/store/FilesStore.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/products/ASC.Files/Client/src/store/FilesStore.js b/products/ASC.Files/Client/src/store/FilesStore.js index 4ffbb8fb9d..3fb50d0eb7 100644 --- a/products/ASC.Files/Client/src/store/FilesStore.js +++ b/products/ASC.Files/Client/src/store/FilesStore.js @@ -310,6 +310,8 @@ class FilesStore { const isRecycleBinFolder = data.current.rootFolderType === FolderType.TRASH; + !isRecycleBinFolder && this.checkUpdateNode(data, folderId); + if (!isRecycleBinFolder && withSubfolders) { const path = data.pathParts.slice(0); const foldersCount = data.current.foldersCount; @@ -363,6 +365,31 @@ class FilesStore { return request(); }; + checkUpdateNode = async (data, folderId) => { + const { treeFolders, getSubfolders } = this.treeFoldersStore; + + const somePath = data.pathParts.slice(0); + const path = data.pathParts.slice(0); + let newItems = treeFolders; + + while (somePath.length !== 1) { + newItems = newItems.find((x) => x.id === somePath[0])?.folders; + if (!newItems) { + return; + } + + somePath.shift(); + } + + if (!newItems.find((x) => x.id == folderId)) { + //newItems.push(data.current); + + path.splice(data.pathParts.length - 1, 1); + const subfolders = await getSubfolders(data.current.parentId); + loopTreeFolders(path, treeFolders, subfolders, 0); + } + }; + isFileSelected = (fileId, parentId) => { const item = this.selection.find( (x) => x.id === fileId && x.parentId === parentId From 5c5db26dc44ef90f21b24caad24b1d22e453217b Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Mon, 8 Nov 2021 14:04:52 +0300 Subject: [PATCH 20/26] Web: Files: removed unused code --- .../components/PageLayout/sub-components/section-paging.js | 4 ---- products/ASC.Files/Client/src/store/FilesStore.js | 2 -- 2 files changed, 6 deletions(-) diff --git a/packages/asc-web-common/components/PageLayout/sub-components/section-paging.js b/packages/asc-web-common/components/PageLayout/sub-components/section-paging.js index 16d0447734..f644af01dc 100644 --- a/packages/asc-web-common/components/PageLayout/sub-components/section-paging.js +++ b/packages/asc-web-common/components/PageLayout/sub-components/section-paging.js @@ -7,10 +7,6 @@ const StyledSectionPaging = styled.div` `; class SectionPaging extends React.Component { - // shouldComponentUpdate(nextProps) { - // return !equal(this.props, nextProps); - // } - render() { return ; } diff --git a/products/ASC.Files/Client/src/store/FilesStore.js b/products/ASC.Files/Client/src/store/FilesStore.js index 3fb50d0eb7..4c3bde7f87 100644 --- a/products/ASC.Files/Client/src/store/FilesStore.js +++ b/products/ASC.Files/Client/src/store/FilesStore.js @@ -382,8 +382,6 @@ class FilesStore { } if (!newItems.find((x) => x.id == folderId)) { - //newItems.push(data.current); - path.splice(data.pathParts.length - 1, 1); const subfolders = await getSubfolders(data.current.parentId); loopTreeFolders(path, treeFolders, subfolders, 0); From 55b2f059f55998572cab8b14a16832ae98455267 Mon Sep 17 00:00:00 2001 From: Dmitry Sychugov Date: Mon, 8 Nov 2021 16:24:11 +0500 Subject: [PATCH 21/26] Fixed bug 52976 - Web: Components: added coloring of ui table header --- .../table-container/StyledTableContainer.js | 6 ++++++ .../asc-web-components/table-container/TableHeaderCell.js | 1 + 2 files changed, 7 insertions(+) diff --git a/packages/asc-web-components/table-container/StyledTableContainer.js b/packages/asc-web-components/table-container/StyledTableContainer.js index 6270c9b990..d4a57a2177 100644 --- a/packages/asc-web-components/table-container/StyledTableContainer.js +++ b/packages/asc-web-components/table-container/StyledTableContainer.js @@ -31,6 +31,9 @@ const StyledTableContainer = styled.div` margin: 14px 8px 0 auto; z-index: 1; border-right: 2px solid #d0d5da; + &:hover { + border-color: #657077; + } } .table-container_group-menu, @@ -175,6 +178,9 @@ const StyledTableHeaderCell = styled.div` height: 38px; display: flex; align-items: center; + &:hover { + color: #657077; + } } `; diff --git a/packages/asc-web-components/table-container/TableHeaderCell.js b/packages/asc-web-components/table-container/TableHeaderCell.js index 1389d84f98..16d93d9275 100644 --- a/packages/asc-web-components/table-container/TableHeaderCell.js +++ b/packages/asc-web-components/table-container/TableHeaderCell.js @@ -54,6 +54,7 @@ const TableHeaderCell = ({ iconName="/static/images/folder arrow.react.svg" className="header-container-text-icon" size="small" + hoverColor="#657077" /> {resizable && ( From cd897aa8f1fc09437dcc49ff0fd2bc5348122664 Mon Sep 17 00:00:00 2001 From: AlexeySafronov Date: Mon, 8 Nov 2021 15:33:27 +0300 Subject: [PATCH 22/26] Web: About: Fix DublicatesByContentTest translation issue --- web/ASC.Web.Client/public/locales/ru/About.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/ASC.Web.Client/public/locales/ru/About.json b/web/ASC.Web.Client/public/locales/ru/About.json index 8e95dcf618..3304bb8998 100644 --- a/web/ASC.Web.Client/public/locales/ru/About.json +++ b/web/ASC.Web.Client/public/locales/ru/About.json @@ -3,7 +3,7 @@ "DocumentManagement": "Управление документами", "OnlineEditors": "Онлайн редакторы", "SoftwareLicense": "Лицензия на ПО", - "AboutCompanyAddressTitle": "Адрес", - "AboutCompanyEmailTitle": "Email", - "AboutCompanyTelTitle": "Телефон" + "AboutCompanyAddressTitle": "адрес", + "AboutCompanyEmailTitle": "email", + "AboutCompanyTelTitle": "тел." } From 2a1adf83e77b0fc8bb922dc8467819bf0e267f48 Mon Sep 17 00:00:00 2001 From: AlexeySafronov Date: Mon, 8 Nov 2021 15:37:34 +0300 Subject: [PATCH 23/26] Web: About: Fix UselessTranslationKeysTest translation issue --- .../ASC.Files/Client/public/locales/de/EmptyTrashDialog.json | 3 --- products/ASC.Files/Client/public/locales/de/Home.json | 2 -- .../ASC.Files/Client/public/locales/en/EmptyTrashDialog.json | 5 ++--- products/ASC.Files/Client/public/locales/en/Home.json | 2 -- .../ASC.Files/Client/public/locales/it/EmptyTrashDialog.json | 3 --- products/ASC.Files/Client/public/locales/it/Home.json | 2 -- .../ASC.Files/Client/public/locales/lo/EmptyTrashDialog.json | 3 --- products/ASC.Files/Client/public/locales/lo/Home.json | 2 -- .../Client/public/locales/pt-BR/EmptyTrashDialog.json | 3 --- products/ASC.Files/Client/public/locales/pt-BR/Home.json | 2 -- .../ASC.Files/Client/public/locales/ro/EmptyTrashDialog.json | 3 --- products/ASC.Files/Client/public/locales/ro/Home.json | 2 -- .../ASC.Files/Client/public/locales/ru/EmptyTrashDialog.json | 5 ++--- products/ASC.Files/Client/public/locales/ru/Home.json | 2 -- 14 files changed, 4 insertions(+), 35 deletions(-) delete mode 100644 products/ASC.Files/Client/public/locales/de/EmptyTrashDialog.json delete mode 100644 products/ASC.Files/Client/public/locales/it/EmptyTrashDialog.json delete mode 100644 products/ASC.Files/Client/public/locales/lo/EmptyTrashDialog.json delete mode 100644 products/ASC.Files/Client/public/locales/pt-BR/EmptyTrashDialog.json delete mode 100644 products/ASC.Files/Client/public/locales/ro/EmptyTrashDialog.json diff --git a/products/ASC.Files/Client/public/locales/de/EmptyTrashDialog.json b/products/ASC.Files/Client/public/locales/de/EmptyTrashDialog.json deleted file mode 100644 index 9125c1a722..0000000000 --- a/products/ASC.Files/Client/public/locales/de/EmptyTrashDialog.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "SuccessEmptyTrash": "Papierkorb wurde geleert" -} \ No newline at end of file diff --git a/products/ASC.Files/Client/public/locales/de/Home.json b/products/ASC.Files/Client/public/locales/de/Home.json index 0bb979b4d5..eea76d5b6d 100644 --- a/products/ASC.Files/Client/public/locales/de/Home.json +++ b/products/ASC.Files/Client/public/locales/de/Home.json @@ -21,12 +21,10 @@ "EmptyFolderHeader": "Keine Dateien in diesem Ordner", "EmptyRecycleBin": "Papierkorb leeren", "FavoritesEmptyContainerDescription": "Benutzen Sie das Kontext-Menü, um Dateien als Favoriten zu kennzeichnen oder sie aus dieser Liste zu entfernen.", - "FileCreated": "Neue Datei {{itemTitle}}.{{exst}} wurde erstellt", "FileRemoved": "Die Datei wurde in den Papierkorb verschoben", "Filter": "Filter", "FinalizeVersion": "Version abschließen", "Folder": "Ordner", - "FolderCreated": "Neuer Ordner {{itemTitle}} wurde erstellt", "FolderRemoved": "Ordner wurde in den Papierkorb verschoben", "GoToMyButton": "Meine Dokumente öffnen", "Images": "Bilder", diff --git a/products/ASC.Files/Client/public/locales/en/EmptyTrashDialog.json b/products/ASC.Files/Client/public/locales/en/EmptyTrashDialog.json index f20034060a..93c10e199b 100644 --- a/products/ASC.Files/Client/public/locales/en/EmptyTrashDialog.json +++ b/products/ASC.Files/Client/public/locales/en/EmptyTrashDialog.json @@ -1,6 +1,5 @@ { "DeleteForeverButton": "Delete forever", "DeleteForeverNote": "All items from Trash will be deleted forever. You won’t be able to restore them.", - "DeleteForeverTitle": "Delete forever?", - "SuccessEmptyTrash": "Trash emptied" -} \ No newline at end of file + "DeleteForeverTitle": "Delete forever?" +} diff --git a/products/ASC.Files/Client/public/locales/en/Home.json b/products/ASC.Files/Client/public/locales/en/Home.json index dc952d67b4..3c1b8d44e6 100644 --- a/products/ASC.Files/Client/public/locales/en/Home.json +++ b/products/ASC.Files/Client/public/locales/en/Home.json @@ -21,13 +21,11 @@ "EmptyFolderHeader": "No files in this folder", "EmptyRecycleBin": "Empty Trash", "FavoritesEmptyContainerDescription": "To mark files as favorites or remove them from this list, use the context menu.", - "FileCreated": "New file {{itemTitle}}.{{exst}} is created", "FileRemoved": "File moved to Trash", "FileRenamed": "The document '{{oldTitle}}' is renamed to '{{newTitle}}'", "Filter": "Filter", "FinalizeVersion": "Finalize version", "Folder": "Folder", - "FolderCreated": "New folder {{itemTitle}} is created", "FolderRemoved": "Folder moved to Trash", "FolderRenamed": "The folder '{{folderTitle}}' is renamed to '{{newFoldedTitle}}'", "GoToMyButton": "Go to My Documents", diff --git a/products/ASC.Files/Client/public/locales/it/EmptyTrashDialog.json b/products/ASC.Files/Client/public/locales/it/EmptyTrashDialog.json deleted file mode 100644 index f92937f606..0000000000 --- a/products/ASC.Files/Client/public/locales/it/EmptyTrashDialog.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "SuccessEmptyTrash": "Cestino svuotato" -} \ No newline at end of file diff --git a/products/ASC.Files/Client/public/locales/it/Home.json b/products/ASC.Files/Client/public/locales/it/Home.json index 6c26c7e094..88eac97499 100644 --- a/products/ASC.Files/Client/public/locales/it/Home.json +++ b/products/ASC.Files/Client/public/locales/it/Home.json @@ -21,12 +21,10 @@ "EmptyFolderHeader": "Non ci sono file in questa cartella", "EmptyRecycleBin": "Svuota cestino", "FavoritesEmptyContainerDescription": "Non hai ancora preferiti. Per contrassegnare i file come preferiti o rimuoverli da questo elenco, utilizzare il menù contestuale.", - "FileCreated": "Nuovo file {{itemTitle}}.{{exst}} è stato creato", "FileRemoved": "File spostato nel Cestino", "Filter": "Filtro", "FinalizeVersion": "Finalizza versione", "Folder": "Cartella", - "FolderCreated": "Nuova cartella {{itemTitle}} è stata creata", "FolderRemoved": "Cartella spostata nel cestino", "GoToMyButton": "Vai ai Miei Documenti", "Images": "Immagini", diff --git a/products/ASC.Files/Client/public/locales/lo/EmptyTrashDialog.json b/products/ASC.Files/Client/public/locales/lo/EmptyTrashDialog.json deleted file mode 100644 index f5cb09c072..0000000000 --- a/products/ASC.Files/Client/public/locales/lo/EmptyTrashDialog.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "SuccessEmptyTrash": "ລ້າງຖັງຂີ້ເຫຍື້ອແລ້ວ" -} \ No newline at end of file diff --git a/products/ASC.Files/Client/public/locales/lo/Home.json b/products/ASC.Files/Client/public/locales/lo/Home.json index 25062c3160..6e1d2a6e52 100644 --- a/products/ASC.Files/Client/public/locales/lo/Home.json +++ b/products/ASC.Files/Client/public/locales/lo/Home.json @@ -21,12 +21,10 @@ "EmptyFolderHeader": "ບໍ່ມີເອກະສານຢູ່ໃນແຟ້ມນີ້", "EmptyRecycleBin": "ຖັງຂີ້ເຫຍື້ອຫວ່າງເປົ່າ", "FavoritesEmptyContainerDescription": "ຖ້າຕ້ອງການເຮັດເຄື່ອງໝາຍໄຟລ໌ເປັນລາຍການໂປດ ຫຼື ລົບອອກຈາກລາຍການນີ້ໃຫ້ໃຊ້ເມນູ context ", - "FileCreated": "ເອກະສານໃໝ່ {{itemTitle}}.{{exst}} ຖືກສ້າງຂື້ນ", "FileRemoved": "ຍ້າຍແຟ້ມໄປທີ່ຖັງຂີ້ເຫຍື້ອ", "Filter": "ຄັດກອງ", "FinalizeVersion": "ສະບັບສຸດທ້າຍ", "Folder": "ແຟ້ມ", - "FolderCreated": "ແຟ້ມໃໝ່ {{itemTitle}} ຖືກສ້າງຂຶ້ນ", "FolderRemoved": "ຍ້າຍແຟ້ມໄປທີ່ຖັງຂີ້ເຫຍື້ອ", "GoToMyButton": "ໄປທີ່ເອກະສານຂອງຂ້ອຍ", "Images": "ຮູບພາບ", diff --git a/products/ASC.Files/Client/public/locales/pt-BR/EmptyTrashDialog.json b/products/ASC.Files/Client/public/locales/pt-BR/EmptyTrashDialog.json deleted file mode 100644 index 3c664f89c8..0000000000 --- a/products/ASC.Files/Client/public/locales/pt-BR/EmptyTrashDialog.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "SuccessEmptyTrash": "Lixo esvaziado" -} \ No newline at end of file diff --git a/products/ASC.Files/Client/public/locales/pt-BR/Home.json b/products/ASC.Files/Client/public/locales/pt-BR/Home.json index 67afe115bc..e920cfd381 100644 --- a/products/ASC.Files/Client/public/locales/pt-BR/Home.json +++ b/products/ASC.Files/Client/public/locales/pt-BR/Home.json @@ -21,12 +21,10 @@ "EmptyFolderHeader": "Não há arquivos nesta pasta", "EmptyRecycleBin": "Esvaziar lixeira", "FavoritesEmptyContainerDescription": "Para marcar os arquivos como favoritos ou removê-los desta lista, use o menu de contexto.", - "FileCreated": "Novo arquivo {{itemTitle}}.{{exst}} é criado", "FileRemoved": "Arquivo movido para a lixeira", "Filter": "Filtro", "FinalizeVersion": "Finalizar versão", "Folder": "Pasta", - "FolderCreated": "Nova pasta {{itemTitle}} é criada", "FolderRemoved": "Pasta movida para a lixeira", "GoToMyButton": "Ir aos Meus Documentos", "Images": "Imagens", diff --git a/products/ASC.Files/Client/public/locales/ro/EmptyTrashDialog.json b/products/ASC.Files/Client/public/locales/ro/EmptyTrashDialog.json deleted file mode 100644 index 7f6fcbe6bc..0000000000 --- a/products/ASC.Files/Client/public/locales/ro/EmptyTrashDialog.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "SuccessEmptyTrash": "Coșul de gunoi a fost golit" -} \ No newline at end of file diff --git a/products/ASC.Files/Client/public/locales/ro/Home.json b/products/ASC.Files/Client/public/locales/ro/Home.json index d23b58f0c7..aaf0f0d682 100644 --- a/products/ASC.Files/Client/public/locales/ro/Home.json +++ b/products/ASC.Files/Client/public/locales/ro/Home.json @@ -21,12 +21,10 @@ "EmptyFolderHeader": "Niciun fișier în dosarul", "EmptyRecycleBin": "Golire Coş de gunoi", "FavoritesEmptyContainerDescription": "Marcați fișiere ca preferate sau le ștergeți din lista prin intermediu meniului contextual. ", - "FileCreated": "A fost creat un fișier nou {{itemTitle}}.{{exst}}", "FileRemoved": "Fișierul mutat în Coșul de gunoi", "Filter": "Filtrare", "FinalizeVersion": "Finalizarea versiunii", "Folder": "Dosar", - "FolderCreated": "A fost creat un dosar nou {{itemTitle}}", "FolderRemoved": "Dosarul mutat în Coșul de gunoi", "GoToMyButton": "Accesează Documentele mele", "Images": "Imagini", diff --git a/products/ASC.Files/Client/public/locales/ru/EmptyTrashDialog.json b/products/ASC.Files/Client/public/locales/ru/EmptyTrashDialog.json index de9d5a656d..d2030c355e 100644 --- a/products/ASC.Files/Client/public/locales/ru/EmptyTrashDialog.json +++ b/products/ASC.Files/Client/public/locales/ru/EmptyTrashDialog.json @@ -1,6 +1,5 @@ { "DeleteForeverButton": "Удалить навсегда", "DeleteForeverNote": "Все объекты из корзины будут удалены навсегда. Вы не сможете их восстановить.", - "DeleteForeverTitle": "Удалить навсегда?", - "SuccessEmptyTrash": "Корзина успешно очищена" -} \ No newline at end of file + "DeleteForeverTitle": "Удалить навсегда?" +} diff --git a/products/ASC.Files/Client/public/locales/ru/Home.json b/products/ASC.Files/Client/public/locales/ru/Home.json index df5f60a9fd..95d378aead 100644 --- a/products/ASC.Files/Client/public/locales/ru/Home.json +++ b/products/ASC.Files/Client/public/locales/ru/Home.json @@ -21,13 +21,11 @@ "EmptyFolderHeader": "В этой папке нет файлов", "EmptyRecycleBin": "Очистить корзину", "FavoritesEmptyContainerDescription": "Чтобы добавить файлы в избранное или удалить их из этого списка, используйте контекстное меню.", - "FileCreated": "Создан новый файл {{itemTitle}}.{{exst}}", "FileRemoved": "Файл перемещен в корзину", "FileRenamed": "Документ '{{oldTitle}}' переименован в '{{newTitle}}'", "Filter": "Фильтр", "FinalizeVersion": "Сформировать версию", "Folder": "Папка", - "FolderCreated": "Создана новая папка {{itemTitle}}", "FolderRemoved": "Папка перемещена в корзину", "FolderRenamed": "Папка '{{folderTitle}}' переименована в '{{newFoldedTitle}}'", "GoToMyButton": "Перейти к моим документам", From 90199126c79f01f9f8e407135ba12400df9062b9 Mon Sep 17 00:00:00 2001 From: AlexeySafronov Date: Mon, 8 Nov 2021 15:46:15 +0300 Subject: [PATCH 24/26] Tests: Skip Banner.js (translations from firebase) from NotFoundKeysTest --- common/Tests/Frontend.Translations.Tests/LocalesTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/common/Tests/Frontend.Translations.Tests/LocalesTest.cs b/common/Tests/Frontend.Translations.Tests/LocalesTest.cs index 499749d709..6b63db7a8b 100644 --- a/common/Tests/Frontend.Translations.Tests/LocalesTest.cs +++ b/common/Tests/Frontend.Translations.Tests/LocalesTest.cs @@ -428,6 +428,7 @@ namespace Frontend.Translations.Tests .Select(item => item.Key); var allJsTranslationKeys = JavaScriptFiles + .Where(f => !f.Path.Contains("Banner.js")) // skip Banner.js (translations from firebase) .SelectMany(j => j.TranslationKeys) .Select(k => k.Replace("Common:", "").Replace("Translations:", "")) .Distinct(); From bf80a38df04280e8527ca36fba03e8fb3be1ead5 Mon Sep 17 00:00:00 2001 From: AlexeySafronov Date: Mon, 8 Nov 2021 15:52:16 +0300 Subject: [PATCH 25/26] Tests: Fix NotFoundKeysTest for "Home:EmptyFolderHeader" and "Home:ContainsSpecCharacter" --- common/Tests/Frontend.Translations.Tests/LocalesTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/Tests/Frontend.Translations.Tests/LocalesTest.cs b/common/Tests/Frontend.Translations.Tests/LocalesTest.cs index 6b63db7a8b..07fdc7675d 100644 --- a/common/Tests/Frontend.Translations.Tests/LocalesTest.cs +++ b/common/Tests/Frontend.Translations.Tests/LocalesTest.cs @@ -430,7 +430,7 @@ namespace Frontend.Translations.Tests var allJsTranslationKeys = JavaScriptFiles .Where(f => !f.Path.Contains("Banner.js")) // skip Banner.js (translations from firebase) .SelectMany(j => j.TranslationKeys) - .Select(k => k.Replace("Common:", "").Replace("Translations:", "")) + .Select(k => k.Replace("Common:", "").Replace("Translations:", "").Replace("Home:", "")) .Distinct(); var notFoundJsKeys = allJsTranslationKeys.Except(allEnKeys); From df09343eb49c74d531057c951d42be582f1a6b3a Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Mon, 8 Nov 2021 16:35:17 +0300 Subject: [PATCH 26/26] Web: Files: fixed Tile styles --- .../Home/Section/Body/TilesView/sub-components/Tile.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/products/ASC.Files/Client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js b/products/ASC.Files/Client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js index 94a21032d4..934638ef75 100644 --- a/products/ASC.Files/Client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js +++ b/products/ASC.Files/Client/src/pages/Home/Section/Body/TilesView/sub-components/Tile.js @@ -196,7 +196,7 @@ const StyledFileTileTop = styled.div` justify-content: space-between; align-items: baseline; background-color: #f8f9f9; - padding: 13px; + padding-top: 21px; height: ${(props) => (props.checked || props.isActive ? "156px" : "156px")}; position: relative; border-bottom: ${(props) => @@ -213,6 +213,11 @@ const StyledFileTileTop = styled.div` bottom: 0; margin: auto; z-index: 0; + + min-width: 208px; + } + + .temporary-icon > .injected-svg { margin-bottom: 16px; } `;