From 79cce9cfc14bc2a830ee384785276a30d971af5d Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Mon, 20 Jun 2022 15:35:27 +0300 Subject: [PATCH 01/44] Web: Files: Added file ext after update date on File Row view mode --- .../Section/Body/RowsView/FilesRowContent.js | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/products/ASC.Files/Client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js b/products/ASC.Files/Client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js index 97dd606ad0..94b1820cf4 100644 --- a/products/ASC.Files/Client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js +++ b/products/ASC.Files/Client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js @@ -133,22 +133,22 @@ const FilesRowContent = ({ {updatedDate && updatedDate} - {!isMobileOnly && ( - - {!fileExst && !contentLength && !providerKey - ? `${foldersCount} ${t("Folders")} | ${filesCount} ${t("Files")}` - : ""} - - )} + + {!fileExst && !contentLength && !providerKey && !isMobileOnly + ? `${foldersCount} ${t("Folders")} | ${filesCount} ${t("Files")}` + : fileExst + ? `${fileExst.toUpperCase().replace(/^\./, "")}` + : ""} + ); From 5a06f23111c371cd6b163b1943bcce9d96f173b5 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Mon, 20 Jun 2022 17:14:37 +0300 Subject: [PATCH 02/44] fix Bug 57618 --- products/ASC.Files/Core/Helpers/Global.cs | 38 +++++++++-------------- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/products/ASC.Files/Core/Helpers/Global.cs b/products/ASC.Files/Core/Helpers/Global.cs index b3fd68ba8c..b57424005b 100644 --- a/products/ASC.Files/Core/Helpers/Global.cs +++ b/products/ASC.Files/Core/Helpers/Global.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; @@ -43,7 +44,7 @@ using ASC.Files.Core.Data; using ASC.Files.Core.Resources; using ASC.Files.Core.Security; using ASC.Web.Core; -using ASC.Web.Core.Files; +using ASC.Web.Core.Files; using ASC.Web.Core.Users; using ASC.Web.Core.WhiteLabel; using ASC.Web.Files.Utils; @@ -592,10 +593,11 @@ namespace ASC.Web.Files.Classes } private async Task SaveStartDocumentAsync(FileMarker fileMarker, FolderDao folderDao, FileDao fileDao, int folderId, string path, IDataStore storeTemplate) - { - await foreach (var file in storeTemplate.ListFilesRelativeAsync("", path, "*", false)) + { + var files = await storeTemplate.ListFilesRelativeAsync("", path, "*", false).ToListAsync(); + foreach (var file in files) { - await SaveFileAsync(fileMarker, fileDao, folderId, path + file, storeTemplate); + await SaveFileAsync(fileMarker, fileDao, folderId, path + file, storeTemplate, files); } await foreach (var folderName in storeTemplate.ListDirectoriesRelativeAsync(path, false)) @@ -610,15 +612,18 @@ namespace ASC.Web.Files.Classes } } - private async Task SaveFileAsync(FileMarker fileMarker, FileDao fileDao, int folder, string filePath, IDataStore storeTemp) + private async Task SaveFileAsync(FileMarker fileMarker, FileDao fileDao, int folder, string filePath, IDataStore storeTemp, IEnumerable files) { try { - if (FileUtility.GetFileExtension(filePath) == "." + Global.ThumbnailExtension - && await storeTemp.IsFileAsync("", Regex.Replace(filePath, "\\." + Global.ThumbnailExtension + "$", ""))) - return; - var fileName = Path.GetFileName(filePath); + foreach (var ext in Enum.GetValues()) + { + if (FileUtility.GetFileExtension(filePath) == "." + ext + && files.Contains(Regex.Replace(fileName, "\\." + ext + "$", ""))) + return; + } + var file = ServiceProvider.GetService>(); file.Title = fileName; @@ -631,21 +636,6 @@ namespace ASC.Web.Files.Classes file = await fileDao.SaveFileAsync(file, stream, false); } - - foreach (var size in _thumbnailSettings.Sizes) - { - var pathThumb = $"{filePath}.{size.Width}x{size.Height}.{Global.ThumbnailExtension}"; - if (await storeTemp.IsFileAsync("", pathThumb)) - { - using (var streamThumb = await storeTemp.GetReadStreamAsync("", pathThumb)) - { - await fileDao.SaveThumbnailAsync(file, streamThumb, size.Width, size.Height); - } - } - } - - file.ThumbnailStatus = Thumbnail.Created; - await fileMarker.MarkAsNewAsync(file); } catch (Exception ex) From 34cb63fd3f95a75e100306b476a3ecf3ce625ae8 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Mon, 20 Jun 2022 17:23:32 +0300 Subject: [PATCH 03/44] fix --- products/ASC.Files/Server/ASC.Files.csproj | 38 +++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/products/ASC.Files/Server/ASC.Files.csproj b/products/ASC.Files/Server/ASC.Files.csproj index 4f2c62bef6..e97d0a5b2e 100644 --- a/products/ASC.Files/Server/ASC.Files.csproj +++ b/products/ASC.Files/Server/ASC.Files.csproj @@ -605,6 +605,12 @@ Always + + Always + + + Always + Always @@ -612,7 +618,7 @@ Always - Always + Never Always @@ -629,6 +635,12 @@ Always + + Always + + + Always + Always @@ -644,6 +656,12 @@ Always + + Always + + + Always + Always @@ -659,6 +677,12 @@ Always + + Always + + + Always + Always @@ -674,6 +698,12 @@ Always + + Always + + + Always + Always @@ -689,6 +719,12 @@ Always + + Always + + + Always + Always From fa458aa1a5a60d624a640e1a321f7c1d4618b007 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Mon, 20 Jun 2022 17:54:14 +0300 Subject: [PATCH 04/44] Web: Files: fixed selection when clicking on badge or file/folder name --- .../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 e21fd70f28..ab4ba868c6 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 @@ -373,7 +373,12 @@ class Tile extends React.PureComponent { onFileClick = (e) => { const { onSelect, item, checked, setSelection } = this.props; - if (e.detail === 1) { + + if ( + e.detail === 1 && + !e.target.closest(".badge") && + !e.target.closest(".item-file-name") + ) { if (e.target.nodeName === "INPUT" || e.target.nodeName === "rect") { onSelect && onSelect(!checked, item); } else { From d6ad1325f6d65c1cc5a60e074d4270b61bfb63dc Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Mon, 20 Jun 2022 18:56:12 +0300 Subject: [PATCH 05/44] Web: Client: fixed double api requests --- web/ASC.Web.Client/src/Shell.jsx | 17 ++---------- .../src/components/SmartBanner/index.js | 27 ++++++++++++++++--- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/web/ASC.Web.Client/src/Shell.jsx b/web/ASC.Web.Client/src/Shell.jsx index cf7962095a..47ca9c701b 100644 --- a/web/ASC.Web.Client/src/Shell.jsx +++ b/web/ASC.Web.Client/src/Shell.jsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import React, { useEffect } from "react"; import { Router, Switch, Route, Redirect } from "react-router-dom"; import { inject, observer } from "mobx-react"; import NavMenu from "./components/NavMenu"; @@ -198,11 +198,8 @@ const Shell = ({ items = [], page = "home", ...rest }) => { roomsMode, setSnackbarExist, userTheme, - currentProductId, } = rest; - const [isDocuments, setIsDocuments] = useState(false); - useEffect(() => { try { if (!window.AppServer) { @@ -429,14 +426,6 @@ const Shell = ({ items = [], page = "home", ...rest }) => { if (userTheme) setTheme(userTheme); }, [userTheme]); - useEffect(() => { - if (window.location.pathname.toLowerCase().includes("files")) { - setIsDocuments(true); - } else { - setIsDocuments(false); - } - }, [currentProductId]); - const pathname = window.location.pathname.toLowerCase(); const isEditor = pathname.indexOf("doceditor") !== -1; @@ -522,7 +511,7 @@ const Shell = ({ items = [], page = "home", ...rest }) => { <> - {isDocuments ? : <>} + {isEditor ? <> : }
@@ -585,7 +574,6 @@ const ShellWrapper = inject(({ auth, backup }) => { setSnackbarExist, socketHelper, setTheme, - currentProductId, } = settingsStore; const { setPreparationPortalDialogVisible } = backup; @@ -614,7 +602,6 @@ const ShellWrapper = inject(({ auth, backup }) => { roomsMode, setSnackbarExist, userTheme: auth?.userStore?.user?.theme, - currentProductId, }; })(observer(Shell)); diff --git a/web/ASC.Web.Client/src/components/SmartBanner/index.js b/web/ASC.Web.Client/src/components/SmartBanner/index.js index 5e69d07134..b3fbb73990 100644 --- a/web/ASC.Web.Client/src/components/SmartBanner/index.js +++ b/web/ASC.Web.Client/src/components/SmartBanner/index.js @@ -10,9 +10,17 @@ const Wrapper = styled.div` `; const ReactSmartBanner = (props) => { - const { t, ready, isBannerVisible, setIsBannerVisible } = props; + const { + t, + ready, + isBannerVisible, + setIsBannerVisible, + currentProductId, + } = props; const force = isIOS ? "ios" : "android"; + const [isDocuments, setIsDocuments] = useState(false); + const getCookie = (name) => { let matches = document.cookie.match( new RegExp( @@ -34,6 +42,14 @@ const ReactSmartBanner = (props) => { if (cookieClosed || cookieInstalled) hideBanner(); }, []); + useEffect(() => { + if (window.location.pathname.toLowerCase().includes("files")) { + setIsDocuments(true); + } else { + setIsDocuments(false); + } + }, [currentProductId]); + const storeText = { ios: t("SmartBanner:AppStore"), android: t("SmartBanner:GooglePlay"), @@ -60,7 +76,11 @@ const ReactSmartBanner = (props) => { navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0; - return isMobile && isBannerVisible && ready && isTouchDevice ? ( + return isMobile && + isBannerVisible && + ready && + isTouchDevice && + isDocuments ? ( { ); }; -export default inject(({ bannerStore }) => { +export default inject(({ auth, bannerStore }) => { return { isBannerVisible: bannerStore.isBannerVisible, setIsBannerVisible: bannerStore.setIsBannerVisible, + currentProductId: auth.settingsStore.currentProductId, }; })(observer(ReactSmartBanner)); From 46d495080aab7925b4111e6715afb66f64503699 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Mon, 20 Jun 2022 21:41:43 +0300 Subject: [PATCH 06/44] Fixed Bug 57634: Web: Client: People: Fixed displaying "Sex" field for personal mode --- .../Section/Body/updateUserForm.js | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/products/ASC.People/Client/src/pages/ProfileAction/Section/Body/updateUserForm.js b/products/ASC.People/Client/src/pages/ProfileAction/Section/Body/updateUserForm.js index d8a09ba959..c4aab56355 100644 --- a/products/ASC.People/Client/src/pages/ProfileAction/Section/Body/updateUserForm.js +++ b/products/ASC.People/Client/src/pages/ProfileAction/Section/Body/updateUserForm.js @@ -841,34 +841,35 @@ class UpdateUserForm extends React.Component { maxLength={50} maxLabelWidth={maxLabelWidth} /> - {!personal && ( - - )} - {!personal && ( <> + + Date: Mon, 20 Jun 2022 21:45:33 +0300 Subject: [PATCH 07/44] Fixed Bug 57678: Client: People: Profile: Disabled toggle option for "Interface theme" parameter --- .../Client/src/pages/Profile/Section/Body/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/products/ASC.People/Client/src/pages/Profile/Section/Body/index.js b/products/ASC.People/Client/src/pages/Profile/Section/Body/index.js index 367090c3a2..3d74c736eb 100644 --- a/products/ASC.People/Client/src/pages/Profile/Section/Body/index.js +++ b/products/ASC.People/Client/src/pages/Profile/Section/Body/index.js @@ -516,7 +516,11 @@ class SectionBodyContent extends React.PureComponent { {isSelf && ( - + Date: Mon, 20 Jun 2022 21:52:21 +0300 Subject: [PATCH 08/44] Fixed Bug 57676: Client: People: Profile: Disabled email interaction for self profile --- .../Section/Body/ProfileInfo/ProfileInfo.js | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/products/ASC.People/Client/src/pages/Profile/Section/Body/ProfileInfo/ProfileInfo.js b/products/ASC.People/Client/src/pages/Profile/Section/Body/ProfileInfo/ProfileInfo.js index 53576ab159..2ff3acea72 100644 --- a/products/ASC.People/Client/src/pages/Profile/Section/Body/ProfileInfo/ProfileInfo.js +++ b/products/ASC.People/Client/src/pages/Profile/Section/Body/ProfileInfo/ProfileInfo.js @@ -310,17 +310,21 @@ class ProfileInfo extends React.PureComponent { /> )} - - {email} - + {isSelf ? ( + {email} + ) : ( + + {email} + + )} From fc567a10409e2fd4cf17ef00d9a98af46535ab79 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Mon, 20 Jun 2022 22:09:36 +0300 Subject: [PATCH 09/44] Fixed Bug 57637: Client: Files: Fixed icon size for editing item --- products/ASC.Files/Client/src/store/FilesStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/ASC.Files/Client/src/store/FilesStore.js b/products/ASC.Files/Client/src/store/FilesStore.js index 6aa0f8fbbe..0cbda8ed0d 100644 --- a/products/ASC.Files/Client/src/store/FilesStore.js +++ b/products/ASC.Files/Client/src/store/FilesStore.js @@ -1492,7 +1492,7 @@ class FilesStore { if (items.length && items[0].id === -1) return; //TODO: if change media collection from state remove this; - const iconSize = this.viewAs === "tile" && isMobile ? 32 : 24; + const iconSize = this.viewAs === "table" ? 24 : 32; const icon = extension ? getFileIcon(`.${extension}`, iconSize) : getFolderIcon(null, iconSize); From b2f9e35041af3cb4ef567a7fd86357809d7c4dd3 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Mon, 20 Jun 2022 22:42:48 +0300 Subject: [PATCH 10/44] Fixed Bug 57663: Client: Files: Fixed displaying icons for connecting accounts --- .../src/components/dialogs/ThirdPartyDialog/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/products/ASC.Files/Client/src/components/dialogs/ThirdPartyDialog/index.js b/products/ASC.Files/Client/src/components/dialogs/ThirdPartyDialog/index.js index f2a666f317..6933ffd607 100644 --- a/products/ASC.Files/Client/src/components/dialogs/ThirdPartyDialog/index.js +++ b/products/ASC.Files/Client/src/components/dialogs/ThirdPartyDialog/index.js @@ -81,6 +81,7 @@ const ServiceItem = (props) => { className, getThirdPartyIcon, serviceName, + serviceKey, onClick, } = props; @@ -93,7 +94,7 @@ const ServiceItem = (props) => { "data-key": capabilityKey, }; - const src = getThirdPartyIcon(capabilityKey); + const src = getThirdPartyIcon(serviceKey || capabilityKey); const capabilityName = connectedCloudsTypeTitleTranslation(capabilityKey, t); @@ -282,7 +283,8 @@ const ThirdPartyDialog = (props) => { @@ -292,7 +294,8 @@ const ThirdPartyDialog = (props) => { From 61b4c309f5dc5cfa9510a835c69cd23e33ade40a Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Mon, 20 Jun 2022 23:01:13 +0300 Subject: [PATCH 11/44] Web: Components: ContextMenuButton: Added property "usePortal" for DropDown --- packages/asc-web-components/context-menu-button/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/asc-web-components/context-menu-button/index.js b/packages/asc-web-components/context-menu-button/index.js index 7e5acb5d34..2e845756f7 100644 --- a/packages/asc-web-components/context-menu-button/index.js +++ b/packages/asc-web-components/context-menu-button/index.js @@ -165,6 +165,7 @@ class ContextMenuButton extends React.Component { isNew, title, zIndex, + usePortal, } = this.props; const { isOpen, displayType, offsetX, offsetY } = this.state; @@ -204,6 +205,7 @@ class ContextMenuButton extends React.Component { columnCount={columnCount} withBackdrop={!!isMobile} zIndex={zIndex} + isDefaultMode={usePortal} > {this.state.data.map( (item, index) => @@ -316,6 +318,7 @@ ContextMenuButton.propTypes = { /** Set the display type */ displayType: PropTypes.string, isNew: PropTypes.bool, + usePortal: PropTypes.bool, }; ContextMenuButton.defaultProps = { @@ -329,6 +332,7 @@ ContextMenuButton.defaultProps = { isFill: false, displayType: "dropdown", isNew: false, + usePortal: true, }; export default ContextMenuButton; From 3fdf32f4451f1807c7188bf8b7de800aab55092e Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Mon, 20 Jun 2022 23:02:33 +0300 Subject: [PATCH 12/44] Fixed Bug 57674: Client: People: Fixed DropDown out of page border opening --- .../ASC.People/Client/src/pages/Profile/Section/Header/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/products/ASC.People/Client/src/pages/Profile/Section/Header/index.js b/products/ASC.People/Client/src/pages/Profile/Section/Header/index.js index 882a107e19..92c425834c 100644 --- a/products/ASC.People/Client/src/pages/Profile/Section/Header/index.js +++ b/products/ASC.People/Client/src/pages/Profile/Section/Header/index.js @@ -475,6 +475,7 @@ class SectionHeaderContent extends React.PureComponent { size={17} getData={contextOptions} isDisabled={false} + usePortal={false} /> )} {visibleAvatarEditor && ( From a4d33b9939cade063d44ca014a437519b7f75f2a Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Tue, 21 Jun 2022 12:19:15 +0300 Subject: [PATCH 13/44] Fixed Bug 57660 - Docs: Fixed display info-panel content for forms-gallery --- products/ASC.Files/Client/src/HOCs/withLoader.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/products/ASC.Files/Client/src/HOCs/withLoader.js b/products/ASC.Files/Client/src/HOCs/withLoader.js index b24be240b0..16f5ee00ab 100644 --- a/products/ASC.Files/Client/src/HOCs/withLoader.js +++ b/products/ASC.Files/Client/src/HOCs/withLoader.js @@ -6,6 +6,7 @@ import Loaders from "@appserver/common/components/Loaders"; const pathname = window.location.pathname.toLowerCase(); const isEditor = pathname.indexOf("doceditor") !== -1; +const isGallery = pathname.indexOf("form-gallery") !== -1; let loadTimeout = null; const withLoader = (WrappedComponent) => (Loader) => { @@ -52,7 +53,7 @@ const withLoader = (WrappedComponent) => (Loader) => { } }, [isEditor, firstLoad, isLoaded, isMobile, inLoad]); - return (!isEditor && firstLoad) || + return (!isEditor && firstLoad && !isGallery) || !isLoaded || (isMobile && inLoad) || (isLoadingFilesFind && !Loader) || From 610f738ca65afba6196b4d60553cba4b67415c7b Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Tue, 21 Jun 2022 12:29:26 +0300 Subject: [PATCH 14/44] Web: Files: Fix password protected files operations --- .../ASC.Files/Client/src/HOCs/withContent.js | 50 +++++++++---------- .../dialogs/ConvertPasswordDialog/index.js | 43 ++++++++-------- .../Client/src/store/ContextOptionsStore.js | 24 ++++----- 3 files changed, 60 insertions(+), 57 deletions(-) diff --git a/products/ASC.Files/Client/src/HOCs/withContent.js b/products/ASC.Files/Client/src/HOCs/withContent.js index 348f7d4181..7c33c7262b 100644 --- a/products/ASC.Files/Client/src/HOCs/withContent.js +++ b/products/ASC.Files/Client/src/HOCs/withContent.js @@ -277,32 +277,32 @@ export default function withContent(WrappedContent) { }) .then(() => this.completeAction(itemId)) .catch((err) => { - console.log("err", err); - const isPasswordError = new RegExp(/\(password\)*$/); - - if (isPasswordError.test(err)) { - toastr.error( - t("Translations:FileProtected"), - t("Common:Warning") - ); - setIsUpdatingRowItem(false); - - setFormCreationInfo({ - newTitle: `${title}.${item.fileExst}`, - fromExst: ".docx", - toExst: item.fileExst, - open, - actionId: itemId, - fileInfo: { - id: fileActionTemplateId, - folderId: item.parentId, - fileExst: item.fileExst, - }, - }); - setConvertPasswordDialogVisible(true); - - open && openDocEditor(null, null, tab); + if (err.indexOf("password") == -1) { + toastr.error(err, t("Common:Warning")); + return; } + + toastr.error( + t("Translations:FileProtected"), + t("Common:Warning") + ); + setIsUpdatingRowItem(false); + + setFormCreationInfo({ + newTitle: `${title}.${item.fileExst}`, + fromExst: ".docx", + toExst: item.fileExst, + open, + actionId: itemId, + fileInfo: { + id: fileActionTemplateId, + folderId: item.parentId, + fileExst: item.fileExst, + }, + }); + setConvertPasswordDialogVisible(true); + + open && openDocEditor(null, null, tab); }) .finally(() => { const fileIds = [+itemId]; diff --git a/products/ASC.Files/Client/src/components/dialogs/ConvertPasswordDialog/index.js b/products/ASC.Files/Client/src/components/dialogs/ConvertPasswordDialog/index.js index c320a690bd..cc56e19af0 100644 --- a/products/ASC.Files/Client/src/components/dialogs/ConvertPasswordDialog/index.js +++ b/products/ASC.Files/Client/src/components/dialogs/ConvertPasswordDialog/index.js @@ -92,17 +92,18 @@ const ConvertPasswordDialogComponent = (props) => { onClose(); }) .catch((err) => { - console.log("err", err); - - const isPasswordError = new RegExp(/\(password\)*$/); - - if (isPasswordError.test(err)) { - toastr.error(t("CreationError"), t("Common:Warning")); - if (_isMounted) { - setPasswordValid(false); - focusInput(); - } + if (err.indexOf("password") == -1) { + toastr.error(err, t("Common:Warning")); + return; } + + toastr.error(t("CreationError"), t("Common:Warning")); + if (_isMounted) { + setPasswordValid(false); + focusInput(); + } + }) + .finally(() => { _isMounted && setIsLoading(false); }); } else { @@ -116,17 +117,19 @@ const ConvertPasswordDialogComponent = (props) => { editCompleteAction(actionId, fileInfo, false); }) .catch((err) => { - console.log("err", err); - const isPasswordError = new RegExp(/\(password\)*$/); - - if (isPasswordError.test(err)) { - toastr.error(t("CreationError"), t("Common:Warning")); - open && openDocEditor(null, null, tab); - if (_isMounted) { - setPasswordValid(false); - focusInput(); - } + if (err.indexOf("password") == -1) { + toastr.error(err, t("Common:Warning")); + return; } + + toastr.error(t("CreationError"), t("Common:Warning")); + open && openDocEditor(null, null, tab); + if (_isMounted) { + setPasswordValid(false); + focusInput(); + } + }) + .finally(() => { _isMounted && setIsLoading(false); }); } diff --git a/products/ASC.Files/Client/src/store/ContextOptionsStore.js b/products/ASC.Files/Client/src/store/ContextOptionsStore.js index ecb71dc59a..e9d0e8b299 100644 --- a/products/ASC.Files/Client/src/store/ContextOptionsStore.js +++ b/products/ASC.Files/Client/src/store/ContextOptionsStore.js @@ -68,19 +68,19 @@ class ContextOptionsStore { this.settingsStore.extsWebRestrictedEditing[0]; this.uploadDataStore.copyAsAction(id, newTitle, folderId).catch((err) => { - console.log("err", err); - const isPasswordError = new RegExp(/\(password\)*$/); - - if (isPasswordError.test(err)) { - toastr.error(t("Translations:FileProtected"), t("Common:Warning")); - setFormCreationInfo({ - newTitle, - fromExst: fileExst, - toExst: this.settingsStore.extsWebRestrictedEditing[0], - fileInfo: item, - }); - setConvertPasswordDialogVisible(true); + if (err.indexOf("password") == -1) { + toastr.error(err, t("Common:Warning")); + return; } + + toastr.error(t("Translations:FileProtected"), t("Common:Warning")); + setFormCreationInfo({ + newTitle, + fromExst: fileExst, + toExst: this.settingsStore.extsWebRestrictedEditing[0], + fileInfo: item, + }); + setConvertPasswordDialogVisible(true); }); }; From 6619e408965af859a49dfd0e7ce4755cfd4fc247 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Tue, 21 Jun 2022 13:17:30 +0300 Subject: [PATCH 15/44] Fix Bug 57690: current email when changing --- .../components/dialogs/ChangeEmailDialog/index.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/products/ASC.People/Client/src/components/dialogs/ChangeEmailDialog/index.js b/products/ASC.People/Client/src/components/dialogs/ChangeEmailDialog/index.js index 4d46fa0ea4..aea6ae8259 100644 --- a/products/ASC.People/Client/src/components/dialogs/ChangeEmailDialog/index.js +++ b/products/ASC.People/Client/src/components/dialogs/ChangeEmailDialog/index.js @@ -15,13 +15,10 @@ class ChangeEmailDialogComponent extends React.Component { constructor(props) { super(props); - const { user } = props; - const { email } = user; - this.state = { isEmailValid: true, isRequestRunning: false, - email, + email: "", hasError: false, errorMessage: "", emailErrors: [], @@ -32,14 +29,6 @@ class ChangeEmailDialogComponent extends React.Component { window.addEventListener("keyup", this.onKeyPress); } - componentDidUpdate(prevProps) { - const { user } = this.props; - const { email } = user; - if (prevProps.user.email !== email) { - this.setState({ email }); - } - } - componentWillUnmount() { window.removeEventListener("keyup", this.onKeyPress); } @@ -156,6 +145,7 @@ class ChangeEmailDialogComponent extends React.Component { onValidateInput={this.onValidateEmailInput} onKeyUp={this.onKeyPress} hasError={hasError} + placeholder={t("EnterEmail")} /> From 7775f161182d6a8fc2bed6ec05a1cbfd16355abb Mon Sep 17 00:00:00 2001 From: gazizova-vlada Date: Tue, 21 Jun 2022 13:19:35 +0300 Subject: [PATCH 16/44] Web:Components:Changed the name globalColors. --- packages/asc-web-components/utils/globalColors.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/asc-web-components/utils/globalColors.js b/packages/asc-web-components/utils/globalColors.js index 336ea5396c..9437c1eaa0 100644 --- a/packages/asc-web-components/utils/globalColors.js +++ b/packages/asc-web-components/utils/globalColors.js @@ -52,13 +52,13 @@ const globalColors = { hoverInfo: "#EED27B", hoverWarning: "#EEB97B", - firstDefaultСolorScheme: "#4781D1", - secondDefaultСolorScheme: "#ED7309", - thirdDefaultСolorScheme: "#08AAA0", - fourthDefaultСolorScheme: "#F2665A", - fifthDefaultСolorScheme: "#6D4EC2", - sixthDefaultСolorScheme: "#11A3D4", - seventhDefaultСolorScheme: "#444444", + colorSchemeDefault_1: "#4781D1", + colorSchemeDefault_2: "#ED7309", + colorSchemeDefault_3: "#08AAA0", + colorSchemeDefault_4: "#F2665A", + colorSchemeDefault_5: "#6D4EC2", + colorSchemeDefault_6: "#11A3D4", + colorSchemeDefault_7: "#444444", }; export default globalColors; From d5c86203d26b3dbd89f05cb84942b5aa11332934 Mon Sep 17 00:00:00 2001 From: gazizova-vlada Date: Tue, 21 Jun 2022 13:20:34 +0300 Subject: [PATCH 17/44] Web:Added a checkmark image to select a theme. --- public/images/check.white.svg | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 public/images/check.white.svg diff --git a/public/images/check.white.svg b/public/images/check.white.svg new file mode 100644 index 0000000000..275d448091 --- /dev/null +++ b/public/images/check.white.svg @@ -0,0 +1,3 @@ + + + From 12b6aea843d9ec1632c124dccaf6fb243d278b44 Mon Sep 17 00:00:00 2001 From: gazizova-vlada Date: Tue, 21 Jun 2022 13:21:47 +0300 Subject: [PATCH 18/44] Web:Studio:Added theme selection, Appearance page layout. --- .../Settings/categories/common/appearance.js | 110 ++++++++++++------ 1 file changed, 75 insertions(+), 35 deletions(-) diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/common/appearance.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/common/appearance.js index fab63118e7..a34135ff28 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/categories/common/appearance.js +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/common/appearance.js @@ -1,8 +1,8 @@ -import React, { useState, useEffect } from "react"; +import React, { useState, useEffect, useCallback, useMemo } from "react"; import { withTranslation } from "react-i18next"; import { inject, observer } from "mobx-react"; - +import Button from "@appserver/components/button"; import withLoading from "../../../../../HOCs/withLoading"; import globalColors from "@appserver/components/utils/globalColors"; import styled from "styled-components"; @@ -18,58 +18,98 @@ const StyledComponent = styled.div` height: 46px; margin-right: 12px; } - .first-color-scheme { - background: ${globalColors.firstDefaultСolorScheme}; + #color-scheme_1 { + background: ${globalColors.colorSchemeDefault_1}; } - .second-color-scheme { - background: ${globalColors.secondDefaultСolorScheme}; + #color-scheme_2 { + background: ${globalColors.colorSchemeDefault_2}; } - .third-color-scheme { - background: ${globalColors.thirdDefaultСolorScheme}; + #color-scheme_3 { + background: ${globalColors.colorSchemeDefault_3}; } - .fourth-color-scheme { - background: ${globalColors.fourthDefaultСolorScheme}; + #color-scheme_4 { + background: ${globalColors.colorSchemeDefault_4}; } - .fifth-color-scheme { - background: ${globalColors.fifthDefaultСolorScheme}; + #color-scheme_5 { + background: ${globalColors.colorSchemeDefault_5}; } - .sixth-color-scheme { - background: ${globalColors.sixthDefaultСolorScheme}; + #color-scheme_6 { + background: ${globalColors.colorSchemeDefault_6}; } - .sevent-color-scheme { - background: ${globalColors.seventhDefaultСolorScheme}; + #color-scheme_7 { + background: ${globalColors.colorSchemeDefault_7}; } `; const Appearance = (props) => { - const array_items = [ - { - key: "0", - title: "Light theme", - content: , - }, - { - key: "1", - title: "Dark theme", - content:
Tab 2 content
, - }, - ]; + const [selectedColor, setSelectedColor] = useState(1); + + const checkImg = ; + + const array_items = useMemo( + () => [ + { + key: "0", + title: "Light theme", + content: , + }, + { + key: "1", + title: "Dark theme", + content: , + }, + ], + [selectedColor] + ); + + useEffect(() => {}, [selectedColor]); + + const onColorSelection = (e) => { + if (!e.target.id) return; + + const colorNumber = e.target.id[e.target.id.length - 1]; + setSelectedColor(+colorNumber); + }; + + const onShowCheck = (colorNumber) => { + return selectedColor && selectedColor === colorNumber && checkImg; + }; return (
Color
Header color is displayed only when light theme is applied
-
-
-
-
-
-
-
+
+ {onShowCheck(1)} +
+
+ {onShowCheck(2)} +
+
+ {onShowCheck(3)} +
+
+ {onShowCheck(4)} +
+
+ {onShowCheck(5)} +
+
+ {onShowCheck(6)} +
+
+ {onShowCheck(7)} +
Preview
+