From 5a06f23111c371cd6b163b1943bcce9d96f173b5 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Mon, 20 Jun 2022 17:14:37 +0300 Subject: [PATCH 01/11] 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 02/11] 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 03/11] 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 04/11] 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 05/11] 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 06/11] 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 07/11] 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 08/11] 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 09/11] 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 10/11] 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 11/11] 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 && (