From 53f510ae183b7161a94d9681418dd65debcfebe9 Mon Sep 17 00:00:00 2001 From: AlexeySafronov Date: Thu, 17 Dec 2020 21:00:36 +0300 Subject: [PATCH 01/99] Bump version to v0.0.4 --- products/ASC.Files/Client/package.json | 2 +- products/ASC.People/Client/package.json | 2 +- web/ASC.Web.Client/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/products/ASC.Files/Client/package.json b/products/ASC.Files/Client/package.json index 2a903688ef..1d89f06fe1 100644 --- a/products/ASC.Files/Client/package.json +++ b/products/ASC.Files/Client/package.json @@ -1,6 +1,6 @@ { "name": "asc-files-client", - "version": "0.0.3", + "version": "0.0.4", "private": true, "homepage": "/products/files", "dependencies": { diff --git a/products/ASC.People/Client/package.json b/products/ASC.People/Client/package.json index a58d13e162..532ada70a8 100644 --- a/products/ASC.People/Client/package.json +++ b/products/ASC.People/Client/package.json @@ -1,6 +1,6 @@ { "name": "asc-people-client", - "version": "0.0.3", + "version": "0.0.4", "private": true, "homepage": "/products/people", "dependencies": { diff --git a/web/ASC.Web.Client/package.json b/web/ASC.Web.Client/package.json index ce246afff7..6af0cf9659 100644 --- a/web/ASC.Web.Client/package.json +++ b/web/ASC.Web.Client/package.json @@ -1,6 +1,6 @@ { "name": "asc-web-client", - "version": "0.0.3", + "version": "0.0.4", "private": true, "dependencies": { "asc-web-common": "file:../../packages/asc-web-common", From 02949cc644fbf94c86b83a59ead27781bdc58eec Mon Sep 17 00:00:00 2001 From: TatianaLopaeva Date: Fri, 18 Dec 2020 09:47:15 +0300 Subject: [PATCH 02/99] Web: People: Article: Deleted useless console.log. --- .../ASC.People/Client/src/components/Article/Header/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/products/ASC.People/Client/src/components/Article/Header/index.js b/products/ASC.People/Client/src/components/Article/Header/index.js index 8ef3ae121f..d6eb59b91a 100644 --- a/products/ASC.People/Client/src/components/Article/Header/index.js +++ b/products/ASC.People/Client/src/components/Article/Header/index.js @@ -5,7 +5,6 @@ import { store, Headline, Loaders } from "asc-web-common"; const { getCurrentProductName } = store.auth.selectors; const ArticleHeaderContent = ({ currentModuleName }) => { - console.log("CurrentModuleName", currentModuleName); return currentModuleName ? ( {currentModuleName} ) : ( From 8886dd22a815f8ffc98799f746ee52f2c899df98 Mon Sep 17 00:00:00 2001 From: Artem Tarasov Date: Fri, 18 Dec 2020 11:30:17 +0300 Subject: [PATCH 03/99] Web: Files: VersionHistory: fixed filter reset after returning from verion page --- .../pages/VersionHistory/Section/Header/index.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/products/ASC.Files/Client/src/components/pages/VersionHistory/Section/Header/index.js b/products/ASC.Files/Client/src/components/pages/VersionHistory/Section/Header/index.js index 0a07fb4a82..a00844b095 100644 --- a/products/ASC.Files/Client/src/components/pages/VersionHistory/Section/Header/index.js +++ b/products/ASC.Files/Client/src/components/pages/VersionHistory/Section/Header/index.js @@ -1,13 +1,15 @@ import React from "react"; -import styled, { css } from "styled-components"; +import styled from "styled-components"; import { withRouter } from "react-router"; -import { Headline, store } from "asc-web-common"; +import { Headline } from "asc-web-common"; import { IconButton, utils } from "asc-web-components"; import { connect } from "react-redux"; import { withTranslation } from "react-i18next"; +import { setFilesFilter } from "../../../../../store/files/actions"; +import { getFilter } from "../../../../../store/files/selectors"; + const { tablet, desktop } = utils.device; -const { getSettings } = store.auth.selectors; const StyledContainer = styled.div` display: grid; @@ -73,8 +75,8 @@ const SectionHeaderContent = (props) => { const { title } = props; const onClickBack = () => { - const { history, settings } = props; - history.push(settings.homepage); + const { filter, setFilesFilter } = props; + setFilesFilter(filter); }; return ( @@ -98,10 +100,10 @@ const SectionHeaderContent = (props) => { const mapStateToProps = (state) => { return { - settings: getSettings(state), + filter: getFilter(state), }; }; -export default connect(mapStateToProps)( +export default connect(mapStateToProps, { setFilesFilter })( withTranslation()(withRouter(SectionHeaderContent)) ); From a2d97d2612f212166a6a54fd465fbfd4244519e3 Mon Sep 17 00:00:00 2001 From: AlexeySafronov Date: Fri, 18 Dec 2020 11:42:29 +0300 Subject: [PATCH 04/99] Web: About: Fixed SourceCode url --- web/ASC.Web.Client/src/components/pages/About/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/ASC.Web.Client/src/components/pages/About/index.js b/web/ASC.Web.Client/src/components/pages/About/index.js index 29adccf49c..2ec812f645 100644 --- a/web/ASC.Web.Client/src/components/pages/About/index.js +++ b/web/ASC.Web.Client/src/components/pages/About/index.js @@ -182,7 +182,7 @@ const Body = () => { {t("SourceCode")}:{" "} From c4a5bad014872d745ab0cdeba2d417feeb8d38e0 Mon Sep 17 00:00:00 2001 From: Alexey Kostenko Date: Fri, 18 Dec 2020 11:55:03 +0300 Subject: [PATCH 05/99] Web: Files: SharingSettings: Added internal link for folder --- .../panels/SharingPanel/SharingRow.js | 44 +++++++++---------- .../components/panels/SharingPanel/index.js | 22 ++++++++++ 2 files changed, 43 insertions(+), 23 deletions(-) diff --git a/products/ASC.Files/Client/src/components/panels/SharingPanel/SharingRow.js b/products/ASC.Files/Client/src/components/panels/SharingPanel/SharingRow.js index 7dcac44c9d..15c4d64356 100644 --- a/products/ASC.Files/Client/src/components/panels/SharingPanel/SharingRow.js +++ b/products/ASC.Files/Client/src/components/panels/SharingPanel/SharingRow.js @@ -29,14 +29,13 @@ const SharingRow = (props) => { onRemoveUserClick, onShowEmbeddingPanel, onToggleLink, - externalLinkData, + internalLink, } = props; + const externalLinkVisible = + selection && selection.length === 1 && item.shareLink; + const internalLinkVisible = index === 0 && internalLink; - const linkVisible = selection && selection.length === 1 && item.shareLink; const onCopyInternalLink = () => { - const internalLink = selection.webUrl - ? selection.webUrl - : selection[0].webUrl; copy(internalLink); toastr.success(t("LinkCopySuccess")); }; @@ -193,24 +192,23 @@ const SharingRow = (props) => { //console.log("SharingRow render"); return ( <> - {linkVisible && ( - <> - - - + {externalLinkVisible && ( + + )} + {internalLinkVisible && ( + )} {!item.shareLink && ( diff --git a/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js b/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js index 3c8c4d3ab7..214a07789c 100644 --- a/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js +++ b/products/ASC.Files/Client/src/components/panels/SharingPanel/index.js @@ -46,6 +46,7 @@ const { ShareAccessRights } = constants; const { getCurrentUserId, getSettingsCustomNamesGroupsCaption, + getSettings, } = store.auth.selectors; const SharingBodyStyle = { height: `calc(100vh - 156px)` }; @@ -526,6 +527,24 @@ class SharingPanelComponent extends React.Component { } }; + getInternalLink = () => { + const { settings, selectedItems } = this.props; + const item = selectedItems[0]; + const isFile = !!item.fileExst; + + if (selectedItems.length !== 1) return null; + + return isFile + ? item.canOpenPlayer + ? `${window.location.origin + settings.homepage}/filter?folder=${ + item.folderId + }&preview=${item.id}` + : item.webUrl + : `${window.location.origin + settings.homepage}/filter?folder=${ + item.id + }`; + }; + onShowEmbeddingPanel = (link) => this.setState({ showEmbeddingPanel: !this.state.showEmbeddingPanel, @@ -600,6 +619,7 @@ class SharingPanelComponent extends React.Component { const visible = showPanel; const zIndex = 310; + const internalLink = selectedItems && this.getInternalLink(); const advancedOptions = ( <> @@ -739,6 +759,7 @@ class SharingPanelComponent extends React.Component { isMyId={isMyId} accessOptions={accessOptions} externalAccessOptions={externalAccessOptions} + internalLink={internalLink} onFullAccessClick={this.onFullAccessItemClick} onReadOnlyClick={this.onReadOnlyItemClick} onReviewClick={this.onReviewItemClick} @@ -834,6 +855,7 @@ const mapStateToProps = (state) => { selectedItems: getSelection(state), groupsCaption: getSettingsCustomNamesGroupsCaption(state), sharingPanelVisible: getSharePanelVisible(state), + settings: getSettings(state), }; }; From d94c01cdd86b68bf89ce59a56ff1fca855821678 Mon Sep 17 00:00:00 2001 From: Vladislav Makhov Date: Fri, 18 Dec 2020 13:29:04 +0300 Subject: [PATCH 06/99] web: files: remove unused translations --- .../panels/OperationsPanel/locales/en/translation.json | 6 +----- .../panels/OperationsPanel/locales/ru/translation.json | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/products/ASC.Files/Client/src/components/panels/OperationsPanel/locales/en/translation.json b/products/ASC.Files/Client/src/components/panels/OperationsPanel/locales/en/translation.json index ff3ff9abc9..24ab334a74 100644 --- a/products/ASC.Files/Client/src/components/panels/OperationsPanel/locales/en/translation.json +++ b/products/ASC.Files/Client/src/components/panels/OperationsPanel/locales/en/translation.json @@ -4,9 +4,5 @@ "CopyOperation": "Copying", "MoveToOperation": "Moving", "Restore": "Restore", - "MoveToFolderMessage": "You cannot move the folder to its subfolder", - "MoveItem": "{{title}} moved", - "MoveItems": "{{qty}} elements has been moved", - "CopyItem": "{{title}} copied", - "CopyItems": "{{qty}} elements copied" + "MoveToFolderMessage": "You cannot move the folder to its subfolder" } diff --git a/products/ASC.Files/Client/src/components/panels/OperationsPanel/locales/ru/translation.json b/products/ASC.Files/Client/src/components/panels/OperationsPanel/locales/ru/translation.json index a61c801a15..8073758849 100644 --- a/products/ASC.Files/Client/src/components/panels/OperationsPanel/locales/ru/translation.json +++ b/products/ASC.Files/Client/src/components/panels/OperationsPanel/locales/ru/translation.json @@ -4,9 +4,5 @@ "CopyOperation": "Копирование", "MoveToOperation": "Перемещение", "Restore": "Восстановить", - "MoveToFolderMessage": "Нельзя перенести папку в свою дочернюю папку", - "MoveItem": "{{title}} перемещен", - "MoveItems": "Перемещено элементов: {{qty}}", - "CopyItem": "{{title}} скопирован", - "CopyItems": "Скопировано элементов: {{qty}}" + "MoveToFolderMessage": "Нельзя перенести папку в свою дочернюю папку" } From 3ab85035a026f0b1cae97f2261f77f7b840c6a94 Mon Sep 17 00:00:00 2001 From: Vladislav Makhov Date: Fri, 18 Dec 2020 13:30:12 +0300 Subject: [PATCH 07/99] web: files: fix icon of progress bar --- products/ASC.Files/Client/src/store/files/actions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/products/ASC.Files/Client/src/store/files/actions.js b/products/ASC.Files/Client/src/store/files/actions.js index 8fa0a7eddb..209bae7cb8 100644 --- a/products/ASC.Files/Client/src/store/files/actions.js +++ b/products/ASC.Files/Client/src/store/files/actions.js @@ -1373,7 +1373,7 @@ export const loopFilesOperations = (id, destFolderId, isCopy) => { if (currentItem && currentItem.progress !== 100) { dispatch( setSecondaryProgressBarData({ - icon: "move", + icon: isCopy ? "duplicate" : "move", label: progressData.label, percent: currentItem.progress, visible: true, @@ -1384,7 +1384,7 @@ export const loopFilesOperations = (id, destFolderId, isCopy) => { } else { dispatch( setSecondaryProgressBarData({ - icon: "move", + icon: isCopy ? "duplicate" : "move", label: progressData.label, percent: 100, visible: true, From f1bd691ed647fb20819f034e518c1d31a15812db Mon Sep 17 00:00:00 2001 From: Vladislav Makhov Date: Fri, 18 Dec 2020 13:31:26 +0300 Subject: [PATCH 08/99] web: files: add translations for move/copy operations --- .../src/components/pages/Home/locales/en/translation.json | 6 +++++- .../src/components/pages/Home/locales/ru/translation.json | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/products/ASC.Files/Client/src/components/pages/Home/locales/en/translation.json b/products/ASC.Files/Client/src/components/pages/Home/locales/en/translation.json index fb0238b753..1d5ba48716 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/locales/en/translation.json +++ b/products/ASC.Files/Client/src/components/pages/Home/locales/en/translation.json @@ -112,5 +112,9 @@ "FolderCreated": "New folder {{itemTitle}} is created", "FileCreated": "New file {{itemTitle}}.{{exst}} is created", "FolderRemoved": "Folder moved to recycle bin", - "FileRemoved": "File moved to recycle bin" + "FileRemoved": "File moved to recycle bin", + "MoveItem": "{{title}} moved", + "MoveItems": "{{qty}} elements has been moved", + "CopyItem": "{{title}} copied", + "CopyItems": "{{qty}} elements copied" } diff --git a/products/ASC.Files/Client/src/components/pages/Home/locales/ru/translation.json b/products/ASC.Files/Client/src/components/pages/Home/locales/ru/translation.json index 0d0a590267..7bdfaf0ab9 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/locales/ru/translation.json +++ b/products/ASC.Files/Client/src/components/pages/Home/locales/ru/translation.json @@ -112,5 +112,9 @@ "FolderCreated": "Создана новая папка {{itemTitle}}", "FileCreated": "Создан новый файл {{itemTitle}}.{{exst}}", "FolderRemoved": "Папка перемещена в корзину", - "FileRemoved": "Файл перемещен в корзину" + "FileRemoved": "Файл перемещен в корзину", + "MoveItem": "{{title}} перемещен", + "MoveItems": "Перемещено элементов: {{qty}}", + "CopyItem": "{{title}} скопирован", + "CopyItems": "Скопировано элементов: {{qty}}" } From eadac503895d195d6a887d53d34efb0c07fdad6a Mon Sep 17 00:00:00 2001 From: Vladislav Makhov Date: Fri, 18 Dec 2020 13:39:56 +0300 Subject: [PATCH 09/99] web: files: added toasts for move/copy operations --- .../Client/src/components/pages/Home/index.js | 67 +++++++++++++++++-- .../Client/src/store/files/selectors.js | 12 ++++ 2 files changed, 75 insertions(+), 4 deletions(-) diff --git a/products/ASC.Files/Client/src/components/pages/Home/index.js b/products/ASC.Files/Client/src/components/pages/Home/index.js index 8db9c61af1..7226f99b74 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/index.js +++ b/products/ASC.Files/Client/src/components/pages/Home/index.js @@ -4,8 +4,8 @@ import PropTypes from "prop-types"; import { withRouter } from "react-router"; import { isMobile } from "react-device-detect"; //import { RequestLoader } from "asc-web-components"; -import { PageLayout, utils, api, store } from "asc-web-common"; -import { withTranslation, I18nextProvider } from "react-i18next"; +import { PageLayout, utils, api, store, toastr } from "asc-web-common"; +import { withTranslation, I18nextProvider, Trans } from "react-i18next"; import { ArticleBodyContent, ArticleHeaderContent, @@ -39,6 +39,9 @@ import { getDragging, getSharePanelVisible, getFirstLoad, + isSecondaryProgressFinished, + getSelectionLength, + getSelectionTitle, } from "../../../store/files/selectors"; import { ConvertDialog } from "../../dialogs"; @@ -158,14 +161,67 @@ class PureHome extends React.Component { startUpload(files, folderId, t); }; + showOperationToast = (type, qty, title) => { + const { i18n } = this.props; + + switch (type) { + case "move": + if (qty > 1) { + return toastr.success( + + {{ qty }} elements has been moved + + ); + } + return toastr.success( + + {{ title }} moved + + ); + case "duplicate": + if (qty > 1) { + return toastr.success( + + {{ qty }} elements copied + + ); + } + return toastr.success( + + {{ title }} copied + + ); + default: + break; + } + }; + componentDidUpdate(prevProps) { - if (this.props.isLoading !== prevProps.isLoading) { - if (this.props.isLoading) { + const { + isLoading, + isProgressFinished, + secondaryProgressData, + selectionLength, + selectionTitle, + } = this.props; + if (isLoading !== prevProps.isLoading) { + if (isLoading) { utils.showLoader(); } else { utils.hideLoader(); } } + + if ( + isProgressFinished && + isProgressFinished !== prevProps.isProgressFinished + ) { + this.showOperationToast( + secondaryProgressData.icon, + selectionLength, + selectionTitle + ); + } } render() { @@ -280,6 +336,9 @@ function mapStateToProps(state) { dragging: getDragging(state), firstLoad: getFirstLoad(state), sharingPanelVisible: getSharePanelVisible(state), + isProgressFinished: isSecondaryProgressFinished(state), + selectionLength: getSelectionLength(state), + selectionTitle: getSelectionTitle(state), }; } diff --git a/products/ASC.Files/Client/src/store/files/selectors.js b/products/ASC.Files/Client/src/store/files/selectors.js index 340330174d..414c9ce8bd 100644 --- a/products/ASC.Files/Client/src/store/files/selectors.js +++ b/products/ASC.Files/Client/src/store/files/selectors.js @@ -588,6 +588,11 @@ export const getSelectionLength = (state) => { return state.files.selection.length; }; +export const getSelectionTitle = createSelector(getSelection, (selection) => { + if (selection.length === 0) return null; + return selection.find((el) => el.title).title; +}); + export const getViewAs = (state) => { return state.files.viewAs; }; @@ -1214,3 +1219,10 @@ export const getIconOfDraggedFile = (state) => { export const getSharePanelVisible = (state) => { return state.files.sharingPanelVisible; }; + +export const isSecondaryProgressFinished = createSelector( + getSecondaryProgressData, + (data) => { + return data && data.percent === 100; + } +); From ba075ecc47ccdef19a00d85a7e78703fd8fa5cb7 Mon Sep 17 00:00:00 2001 From: Artem Tarasov Date: Fri, 18 Dec 2020 14:04:11 +0300 Subject: [PATCH 10/99] Web: Client: About: fixed copyright style --- web/ASC.Web.Client/src/components/pages/About/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/ASC.Web.Client/src/components/pages/About/index.js b/web/ASC.Web.Client/src/components/pages/About/index.js index 29adccf49c..8db6d95e9f 100644 --- a/web/ASC.Web.Client/src/components/pages/About/index.js +++ b/web/ASC.Web.Client/src/components/pages/About/index.js @@ -48,6 +48,8 @@ const BodyStyle = styled.div` } .copyright-line { + display: grid; + grid-template-columns: 10fr 180px 10fr; padding-bottom: 15px; text-align: center; @@ -56,7 +58,6 @@ const BodyStyle = styled.div` content: ""; height: 2px; margin-top: 9px; - width: 26%; float: right; } @@ -65,7 +66,6 @@ const BodyStyle = styled.div` content: ""; height: 2px; margin-top: 9px; - width: 26%; float: left; } } From dda45f32823d77c50f191345810d1fb02e8dee26 Mon Sep 17 00:00:00 2001 From: Vladislav Makhov Date: Fri, 18 Dec 2020 14:24:28 +0300 Subject: [PATCH 11/99] web: files: Hide header menu in favorites dir, when selected file removed from favorites --- .../Client/src/components/pages/Home/Section/Body/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js index d27f765cb2..2385e29515 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js +++ b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js @@ -280,6 +280,7 @@ class SectionBodyContent extends React.Component { fetchFavoritesFolder, isFavorites, selectedFolderId, + setSelected, //selection, t, } = this.props; @@ -299,6 +300,7 @@ class SectionBodyContent extends React.Component { : getFileInfo(id); }) .then(() => toastr.success(t("RemovedFromFavorites"))) + .then(() => setSelected("close")) .catch((e) => toastr.error(e)); default: return; From 60b172e8d8a9105231a7201a0810cd3760c974e0 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Fri, 18 Dec 2020 15:34:36 +0300 Subject: [PATCH 12/99] Web: Components: fixed SelectedItem and SelectorAddButton click when components is disabled --- .../src/components/selected-item/index.js | 6 +++++- .../src/components/selector-add-button/index.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/web/ASC.Web.Components/src/components/selected-item/index.js b/web/ASC.Web.Components/src/components/selected-item/index.js index 2e4c5ea06d..91058684e1 100644 --- a/web/ASC.Web.Components/src/components/selected-item/index.js +++ b/web/ASC.Web.Components/src/components/selected-item/index.js @@ -44,6 +44,10 @@ const SelectedItem = (props) => { const { isDisabled, text, onClose } = props; const colorProps = { color: isDisabled ? "#D0D5DA" : "#555F65" }; + const onCloseClick = (e) => { + !isDisabled && onClose && onClose(e); + }; + //console.log("SelectedItem render"); return ( @@ -52,7 +56,7 @@ const SelectedItem = (props) => { {text} - + { - const { isDisabled, title, onClick, className, id, style } = props; + const { isDisabled, title, className, id, style } = props; + + const onClick = (e) => { + !isDisabled && props.onClick && props.onClick(e); + }; return ( Date: Fri, 18 Dec 2020 15:36:00 +0300 Subject: [PATCH 13/99] Web: People: hid edit button if profile is disabled --- .../Client/src/components/pages/Profile/Section/Body/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js b/products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js index 9e33769211..80594bad2b 100644 --- a/products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js +++ b/products/ASC.People/Client/src/components/pages/Profile/Section/Body/index.js @@ -121,7 +121,7 @@ class SectionBodyContent extends React.PureComponent { source={profile.avatarMax} userName={profile.displayName} /> - {(isAdmin || isSelf) && ( + {profile.status !== 2 && (isAdmin || isSelf) && (