From ebb6d92c497ceb9595304f670a3b2d56845ecaeb Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Thu, 29 Oct 2020 17:29:22 +0300 Subject: [PATCH 01/20] Web: Components: added context --- web/ASC.Web.Components/src/utils/context.js | 5 +++++ web/ASC.Web.Components/src/utils/index.js | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 web/ASC.Web.Components/src/utils/context.js diff --git a/web/ASC.Web.Components/src/utils/context.js b/web/ASC.Web.Components/src/utils/context.js new file mode 100644 index 0000000000..9339d6376f --- /dev/null +++ b/web/ASC.Web.Components/src/utils/context.js @@ -0,0 +1,5 @@ +import React from "react"; + +const { Provider, Consumer } = React.createContext(); + +export { Provider, Consumer }; diff --git a/web/ASC.Web.Components/src/utils/index.js b/web/ASC.Web.Components/src/utils/index.js index 5f2f92f1f5..b43a62f17c 100644 --- a/web/ASC.Web.Components/src/utils/index.js +++ b/web/ASC.Web.Components/src/utils/index.js @@ -2,5 +2,6 @@ import * as array from "./array"; import * as event from "./event"; import * as device from "./device"; import * as email from "./email"; +import * as context from "./context"; -export default { array, event, device, email }; +export default { array, event, device, email, context }; From bc725f29df0fe7e9b1fa267af0ec277992bcff9b Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Thu, 29 Oct 2020 17:33:05 +0300 Subject: [PATCH 02/20] Web: Common: added re-resizable package, added new acticle --- .../Client/src/components/pages/Home/index.js | 60 +------ .../Client/src/components/pages/Home/index.js | 15 +- web/ASC.Web.Common/package.json | 1 + .../src/components/PageLayout/index.js | 151 +++++++++--------- .../PageLayout/sub-components/article.js | 104 +++++++----- .../PageLayout/sub-components/section.js | 6 +- web/ASC.Web.Common/yarn.lock | 12 ++ 7 files changed, 168 insertions(+), 181 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 1b207bc451..5acf8ef10e 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/index.js +++ b/products/ASC.Files/Client/src/components/pages/Home/index.js @@ -47,19 +47,9 @@ const i18n = createI18N({ }); const { changeLanguage } = utils; const { FilesFilter } = api; -const { getSettingsHomepage } = store.auth.selectors; +const { getSettingsHomepage, getIsLoaded } = store.auth.selectors; class PureHome extends React.Component { - constructor(props) { - super(props); - - this.state = { - overwriteSetting: false, - uploadOriginalFormatSetting: false, - hideWindowSetting: false, - }; - } - componentDidMount() { const { fetchFiles, homepage, setIsLoading, setFirstLoad } = this.props; @@ -164,17 +154,6 @@ class PureHome extends React.Component { startUpload(files, folderId, t); }; - onChangeOverwrite = () => - this.setState({ overwriteSetting: !this.state.overwriteSetting }); - - onChangeOriginalFormat = () => - this.setState({ - uploadOriginalFormatSetting: !this.state.uploadOriginalFormatSetting, - }); - - onChangeWindowVisible = () => - this.setState({ hideWindowSetting: !this.state.hideWindowSetting }); - componentDidUpdate(prevProps) { if (this.props.isLoading !== prevProps.isLoading) { if (this.props.isLoading) { @@ -187,53 +166,20 @@ class PureHome extends React.Component { render() { console.log("Home render"); - const { - // overwriteSetting, - // uploadOriginalFormatSetting, - // hideWindowSetting - } = this.state; const { progressData, viewAs, convertDialogVisible, fileActionId, isRecycleBin, + isLoaded, } = this.props; - // const progressBarContent = ( - //
- // - // - // - //
- // ); - return ( <> {convertDialogVisible && ( )} - {/* */} @@ -314,6 +261,7 @@ function mapStateToProps(state) { isLoading: getIsLoading(state), homepage: getSettingsHomepage(state), dragging: getDragging(state), + isLoaded: getIsLoaded(state), }; } diff --git a/products/ASC.People/Client/src/components/pages/Home/index.js b/products/ASC.People/Client/src/components/pages/Home/index.js index 46d64fae71..4609d27b23 100644 --- a/products/ASC.People/Client/src/components/pages/Home/index.js +++ b/products/ASC.People/Client/src/components/pages/Home/index.js @@ -25,7 +25,7 @@ const i18n = createI18N({ localesPath: "pages/Home", }); const { changeLanguage } = utils; -const { isAdmin } = store.auth.selectors; +const { isAdmin, getIsLoaded, getOrganizationName } = store.auth.selectors; class PureHome extends React.Component { constructor(props) { @@ -101,10 +101,14 @@ class PureHome extends React.Component { selected, } = this.state; - const { isAdmin } = this.props; + const { isAdmin, isLoaded } = this.props; return ( - + @@ -174,7 +178,6 @@ Home.propTypes = { }; function mapStateToProps(state) { - const { isLoaded, settings } = state.auth; const { users, selection, selected, selectedGroup, groups } = state.people; return { users, @@ -182,10 +185,10 @@ function mapStateToProps(state) { selected, selectedGroup, groups, - isLoaded, - organizationName: settings.organizationName, + organizationName: getOrganizationName(state), isAdmin: isAdmin(state), isLoading: getIsLoading(state), + isLoaded: getIsLoaded(state), }; } diff --git a/web/ASC.Web.Common/package.json b/web/ASC.Web.Common/package.json index 7be46ae0e7..35f7caf766 100644 --- a/web/ASC.Web.Common/package.json +++ b/web/ASC.Web.Common/package.json @@ -30,6 +30,7 @@ "lodash": "4.17.19", "lodash-es": "4.17.15", "moment": "^2.24.0", + "re-resizable": "^6.7.0", "react-content-loader": "^5.1.2", "react-device-detect": "^1.11.14", "react-hammerjs": "^1.0.1", diff --git a/web/ASC.Web.Common/src/components/PageLayout/index.js b/web/ASC.Web.Common/src/components/PageLayout/index.js index 4f33af2aaa..8ae48e41da 100644 --- a/web/ASC.Web.Common/src/components/PageLayout/index.js +++ b/web/ASC.Web.Common/src/components/PageLayout/index.js @@ -6,7 +6,6 @@ import store from "../../store"; import { withTranslation } from "react-i18next"; import i18n from "./i18n"; import { ARTICLE_PINNED_KEY } from "../../constants"; - import Article from "./sub-components/article"; import SubArticleHeader from "./sub-components/article-header"; import SubArticleMainButton from "./sub-components/article-main-button"; @@ -21,8 +20,10 @@ import SubSectionPaging from "./sub-components/section-paging"; import SectionToggler from "./sub-components/section-toggler"; import { changeLanguage } from "../../utils"; import ReactResizeDetector from "react-resize-detector"; + const { getLanguage } = store.auth.selectors; const { size } = utils.device; +const { Provider } = utils.context; function ArticleHeader() { return null; @@ -155,10 +156,6 @@ class PageLayoutComponent extends React.Component { }); }; - onResize = (width, height) => { - //console.log(`onResize height: ${height}, width: ${width}`); - }; - render() { const { onDrop, @@ -172,6 +169,7 @@ class PageLayoutComponent extends React.Component { withBodyAutoFocus, withBodyScroll, children, + isLoaded, } = this.props; let articleHeaderContent = null; @@ -248,6 +246,7 @@ class PageLayoutComponent extends React.Component {
{isArticleHeaderAvailable && ( @@ -280,81 +279,80 @@ class PageLayoutComponent extends React.Component {
)} {isSectionAvailable && ( - + {({ width }) => ( -
- {isSectionHeaderAvailable && ( - - {sectionHeaderContent - ? sectionHeaderContent.props.children - : null} - - )} - {isSectionFilterAvailable && ( - - {sectionFilterContent - ? sectionFilterContent.props.children - : null} - - )} - {isSectionBodyAvailable && ( - <> - +
+ {isSectionHeaderAvailable && ( + - {isSectionFilterAvailable && ( - - {sectionFilterContent - ? sectionFilterContent.props.children + {sectionHeaderContent + ? sectionHeaderContent.props.children + : null} + + )} + {isSectionFilterAvailable && ( + + {sectionFilterContent + ? sectionFilterContent.props.children + : null} + + )} + {isSectionBodyAvailable && ( + <> + + {isSectionFilterAvailable && ( + + {sectionFilterContent + ? sectionFilterContent.props.children + : null} + + )} + + {sectionBodyContent + ? sectionBodyContent.props.children : null} - + + {isSectionPagingAvailable && ( + + {sectionPagingContent + ? sectionPagingContent.props.children + : null} + + )} + + {showProgressBar && ( + )} - - {sectionBodyContent - ? React.cloneElement( - sectionBodyContent.props.children, - { widthProp: width } - ) - : null} - - {isSectionPagingAvailable && ( - - {sectionPagingContent - ? sectionPagingContent.props.children - : null} - - )} - - {showProgressBar && ( - - )} - - )} + + )} - {isArticleAvailable && ( - - )} -
+ {isArticleAvailable && ( + + )} +
+ )}
)} @@ -368,7 +366,6 @@ PageLayoutComponent.propTypes = { withBodyScroll: PropTypes.bool, withBodyAutoFocus: PropTypes.bool, t: PropTypes.func, - showProgressBar: PropTypes.bool, progressBarValue: PropTypes.number, progressBarDropDownContent: PropTypes.any, @@ -377,6 +374,8 @@ PageLayoutComponent.propTypes = { setSelections: PropTypes.func, uploadFiles: PropTypes.bool, hideAside: PropTypes.bool, + isLoaded: PropTypes.bool, + viewAs: PropTypes.string, }; PageLayoutComponent.defaultProps = { diff --git a/web/ASC.Web.Common/src/components/PageLayout/sub-components/article.js b/web/ASC.Web.Common/src/components/PageLayout/sub-components/article.js index 480193930f..59c8de2fd0 100644 --- a/web/ASC.Web.Common/src/components/PageLayout/sub-components/article.js +++ b/web/ASC.Web.Common/src/components/PageLayout/sub-components/article.js @@ -1,64 +1,92 @@ import React from "react"; -import styled from "styled-components"; +import styled, { css } from "styled-components"; +import PropTypes from "prop-types"; import { utils } from "asc-web-components"; +import { Resizable } from "re-resizable"; +import { isMobile } from "react-device-detect"; const { tablet } = utils.device; const StyledArticle = styled.article` - padding: 0 24px; - background: #f8f9f9; - display: flex; - flex-direction: column; - width: 264px; - min-width: 264px; - /*transition: width 0.3s ease-in-out;*/ - overflow: hidden auto; - box-sizing: border-box; - resize: horizontal; - @media ${tablet} { - padding: 0 16px; ${(props) => - props.visible - ? props.pinned - ? ` - display: flex; - width: 240px; + props.visible && + !props.pinned && + css` + position: fixed; + z-index: 400; + `} + } + .resizable-block { + padding: 0 24px; + background: #f8f9f9; + min-width: 265px; + height: 100% !important; + max-width: ${(props) => (props.isLoaded ? "calc(100vw - 368px)" : "265px")}; + box-sizing: border-box; + overflow: hidden auto; + display: flex; + flex-direction: column; + .resizable-border { + div { + cursor: ew-resize !important; + } + } + @media ${tablet} { + padding: 0 16px; + ${(props) => + props.visible + ? props.pinned + ? ` min-width: 240px; + z-index: 400; ` - : ` - width: 240px; + : ` + position: fixed !important; + width: 240px !important; min-width: 240px; max-width: 240px; position: fixed; - height: 100%; + height: 100% !important; top: 0; left: 0; z-index: 400; - resize: none; + .resizable-border { + display: none; + } ` - : ` - width: 240px; - min-width: 240px; - max-width: 240px; - position: fixed; - height: 100%; - top: 0; - left: -240px; - z-index: 400; - resize: none; + : ` + display: none; `} + } } `; class Article extends React.Component { - /*shouldComponentUpdate() { - return false; - }*/ - render() { - //console.log("PageLayout Article render"); - return ; + //console.log("PageLayout Article render", this.props); + const { children, ...rest } = this.props; + const enable = { + top: false, + right: !isMobile, + bottom: false, + left: false, + }; + return ( + + + {children} + + + ); } } +Article.propTypes = { + children: PropTypes.any, +}; + export default Article; diff --git a/web/ASC.Web.Common/src/components/PageLayout/sub-components/section.js b/web/ASC.Web.Common/src/components/PageLayout/sub-components/section.js index 792609d664..447ee8847a 100644 --- a/web/ASC.Web.Common/src/components/PageLayout/sub-components/section.js +++ b/web/ASC.Web.Common/src/components/PageLayout/sub-components/section.js @@ -19,8 +19,7 @@ const StyledSection = styled.section` flex-grow: 1; display: flex; flex-direction: column; - min-width: 344px; - + /*width: ${(props) => `${props.widthProp}px`};*/ .layout-progress-bar { bottom: 0; position: sticky; @@ -38,9 +37,6 @@ const StyledSection = styled.section` .section-body_filter { display: none; } - - /*${(props) => props.widthProp < 738 && tabletProps};*/ - @media ${tablet} { padding: 0 0 0 16px; ${tabletProps}; diff --git a/web/ASC.Web.Common/yarn.lock b/web/ASC.Web.Common/yarn.lock index 9f9c1ed632..2ad76e40ed 100644 --- a/web/ASC.Web.Common/yarn.lock +++ b/web/ASC.Web.Common/yarn.lock @@ -6017,6 +6017,11 @@ fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fast-memoize@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/fast-memoize/-/fast-memoize-2.5.2.tgz#79e3bb6a4ec867ea40ba0e7146816f6cdce9b57e" + integrity sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw== + fastparse@^1.1.1, fastparse@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.2.tgz#91728c5a5942eced8531283c79441ee4122c35a9" @@ -10445,6 +10450,13 @@ rc-util@^4.15.3, rc-util@^4.5.1: react-lifecycles-compat "^3.0.4" shallowequal "^1.1.0" +re-resizable@^6.7.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/re-resizable/-/re-resizable-6.7.0.tgz#63324f0d2c8cd24fedda6bba5d638bd09c63ee6b" + integrity sha512-uBrV59SZgxmZunL7MWoSnEKEfQW+GfevJqWqnA0slTe54Xbdfn1SgvUCP/C7Ak3hHkz3dSHN8xwpyapdx2Sgrw== + dependencies: + fast-memoize "^2.5.1" + react-autosize-textarea@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/react-autosize-textarea/-/react-autosize-textarea-7.1.0.tgz#902c84fc395a689ca3a484dfb6bc2be9ba3694d1" From 13c690e1838d017c40ee9e91a01e28a1385db559 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Thu, 29 Oct 2020 18:18:00 +0300 Subject: [PATCH 03/20] Web: Common: fixed main container height --- web/ASC.Web.Common/src/components/PageLayout/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/ASC.Web.Common/src/components/PageLayout/index.js b/web/ASC.Web.Common/src/components/PageLayout/index.js index 8ae48e41da..698a31d5c4 100644 --- a/web/ASC.Web.Common/src/components/PageLayout/index.js +++ b/web/ASC.Web.Common/src/components/PageLayout/index.js @@ -106,8 +106,10 @@ class PageLayoutComponent extends React.Component { } orientationChangeHandler = () => { - const vh = (window.innerHeight - 57) * 0.01; - document.documentElement.style.setProperty("--vh", `${vh}px`); + setTimeout(() => { + const vh = (window.innerHeight - 57) * 0.01; + document.documentElement.style.setProperty("--vh", `${vh}px`); + }, 500); const isValueExist = !!localStorage.getItem(ARTICLE_PINNED_KEY); const isEnoughWidth = screen.availWidth > size.smallTablet; From ea21d49ddc37f99e0041e0f8a8c435b06debf88a Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Fri, 30 Oct 2020 12:08:34 +0300 Subject: [PATCH 04/20] Web: Common: fixed main container height --- .../src/components/Main/index.js | 6 ++- .../src/components/PageLayout/index.js | 40 +++++++++++++++++-- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/web/ASC.Web.Common/src/components/Main/index.js b/web/ASC.Web.Common/src/components/Main/index.js index d46c822aad..b95f50cd2f 100644 --- a/web/ASC.Web.Common/src/components/Main/index.js +++ b/web/ASC.Web.Common/src/components/Main/index.js @@ -1,9 +1,11 @@ import React from "react"; import styled from "styled-components"; -import { isIOS } from "react-device-detect"; +import { isIOS, isFirefox } from "react-device-detect"; const StyledMain = styled.main` - height: ${isIOS ? "calc(var(--vh, 1vh) * 100)" : "calc(100vh - 56px)"}; + height: ${isIOS && !isFirefox + ? "calc(var(--vh, 1vh) * 100)" + : "calc(100vh - 56px)"}; width: 100vw; z-index: 0; display: flex; diff --git a/web/ASC.Web.Common/src/components/PageLayout/index.js b/web/ASC.Web.Common/src/components/PageLayout/index.js index 698a31d5c4..4eb8b6bafe 100644 --- a/web/ASC.Web.Common/src/components/PageLayout/index.js +++ b/web/ASC.Web.Common/src/components/PageLayout/index.js @@ -106,10 +106,7 @@ class PageLayoutComponent extends React.Component { } orientationChangeHandler = () => { - setTimeout(() => { - const vh = (window.innerHeight - 57) * 0.01; - document.documentElement.style.setProperty("--vh", `${vh}px`); - }, 500); + this.updateMainHeight(); const isValueExist = !!localStorage.getItem(ARTICLE_PINNED_KEY); const isEnoughWidth = screen.availWidth > size.smallTablet; @@ -122,6 +119,41 @@ class PageLayoutComponent extends React.Component { } }; + updateMainHeight = () => { + const intervalTime = 100; + const endTimeoutTime = 2000; + + let interval, timeout, lastInnerHeight, noChangeCount; + + const updateHeight = () => { + clearInterval(interval); + clearTimeout(timeout); + + interval = null; + timeout = null; + + const vh = (window.innerHeight - 57) * 0.01; + document.documentElement.style.setProperty("--vh", `${vh}px`); + }; + + interval = setInterval(() => { + if (window.innerHeight === lastInnerHeight) { + noChangeCount++; + + if (noChangeCount === intervalTime) { + updateHeight(); + } + } else { + lastInnerHeight = window.innerHeight; + noChangeCount = 0; + } + }); + + timeout = setTimeout(() => { + updateHeight(); + }, endTimeoutTime); + }; + backdropClick = () => { this.setState({ isBackdropVisible: false, From f5ae1c4b0ec96d751baf81ad689da801efa4c6fa Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Fri, 30 Oct 2020 14:13:54 +0300 Subject: [PATCH 05/20] Web: Files: fixed setIsLoading --- .../components/panels/NewFilesPanel/index.js | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/products/ASC.Files/Client/src/components/panels/NewFilesPanel/index.js b/products/ASC.Files/Client/src/components/panels/NewFilesPanel/index.js index 09b9bb6ef7..17552fe4f4 100644 --- a/products/ASC.Files/Client/src/components/panels/NewFilesPanel/index.js +++ b/products/ASC.Files/Client/src/components/panels/NewFilesPanel/index.js @@ -38,8 +38,8 @@ import { setTreeFolders, setUpdateTree, setNewRowItems, - - addFileToRecentlyViewed + setIsLoading, + addFileToRecentlyViewed, } from "../../../store/files/actions"; import { createI18N } from "../../../helpers/i18n"; const i18n = createI18N({ @@ -136,7 +136,12 @@ class NewFilesPanelComponent extends React.Component { onFilesClick = (item) => { const { id, fileExst, viewUrl, fileType } = item; - const { filter, setMediaViewerData, fetchFiles, addFileToRecentlyViewed } = this.props; + const { + filter, + setMediaViewerData, + fetchFiles, + addFileToRecentlyViewed, + } = this.props; if (!fileExst) { fetchFiles(id, filter).catch((err) => toastr.error(err)); @@ -146,9 +151,9 @@ class NewFilesPanelComponent extends React.Component { if (canEdit) { return addFileToRecentlyViewed(id) - .then(() => console.log("Pushed to recently viewed")) - .catch(e => console.error(e)) - .finally(window.open(`./doceditor?fileId=${id}`, "_blank")); + .then(() => console.log("Pushed to recently viewed")) + .catch((e) => console.error(e)) + .finally(window.open(`./doceditor?fileId=${id}`, "_blank")); } if (isMedia) { @@ -317,5 +322,6 @@ export default connect(mapStateToProps, { setUpdateTree, setNewRowItems, fetchFiles, - addFileToRecentlyViewed + addFileToRecentlyViewed, + setIsLoading, })(withRouter(NewFilesPanel)); From c28b1d0121bf1ad4355a27859ec7b86a4fff945d Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 30 Oct 2020 14:19:59 +0300 Subject: [PATCH 06/20] Web: Components : RowContent : Renamed width property, fixed usage --- .../Home/Section/Body/FilesRowContent.js | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FilesRowContent.js b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FilesRowContent.js index c2a0a4d9f2..aeea1d002b 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FilesRowContent.js +++ b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FilesRowContent.js @@ -70,14 +70,14 @@ const SimpleFilesRowContent = styled(RowContent)` align-items: center; } -.favorite { - cursor: pointer; -} + .favorite { + cursor: pointer; + } -.share-icon { - margin-top: -4px; - padding-right: 8px; -} + .share-icon { + margin-top: -4px; + padding-right: 8px; + } .row_update-text { overflow: hidden; @@ -152,7 +152,13 @@ class FilesRowContent extends React.PureComponent { }; createItem = (e) => { - const { createFile, createFolder, item, setIsLoading, openDocEditor } = this.props; + const { + createFile, + createFolder, + item, + setIsLoading, + openDocEditor, + } = this.props; const { itemTitle } = this.state; setIsLoading(true); @@ -218,7 +224,7 @@ class FilesRowContent extends React.PureComponent { canWebEdit, item, isTrashFolder, - openDocEditor + openDocEditor, } = this.props; const { id, fileExst, viewUrl } = item; @@ -397,11 +403,11 @@ class FilesRowContent extends React.PureComponent { fileAction, isTrashFolder, folders, - widthProp, isLoading, isMobile, canWebEdit, canConvert, + sectionWidth, } = this.props; const { itemTitle, @@ -465,7 +471,7 @@ class FilesRowContent extends React.PureComponent { /> )} )} - {(fileStatus === 32 && !isTrashFolder) && + {fileStatus === 32 && !isTrashFolder && ( - } + /> + )} {fileStatus === 1 && ( Date: Fri, 30 Oct 2020 14:20:55 +0300 Subject: [PATCH 07/20] Web: Components : RowContent : Renamed width property --- .../src/components/row-content/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/web/ASC.Web.Components/src/components/row-content/index.js b/web/ASC.Web.Components/src/components/row-content/index.js index 3b23a2d6de..a21b219d44 100644 --- a/web/ASC.Web.Components/src/components/row-content/index.js +++ b/web/ASC.Web.Components/src/components/row-content/index.js @@ -182,7 +182,7 @@ const RowContent = (props) => { style, sideColor, onClick, - widthProp, + sectionWidth, isMobile, } = props; @@ -197,18 +197,18 @@ const RowContent = (props) => { id={id} onClick={onClick} style={style} - widthProp={widthProp} + widthProp={sectionWidth} isMobile={isMobile} > {children[0]} @@ -225,7 +225,7 @@ const RowContent = (props) => { containerMinWidth={ element.props && element.props.containerMinWidth } - widthProp={widthProp} + widthProp={sectionWidth} isMobile={isMobile} > {element} @@ -236,7 +236,7 @@ const RowContent = (props) => { {!disableSideInfo && ( {sideInfo} @@ -254,7 +254,7 @@ RowContent.propTypes = { onClick: PropTypes.func, sideColor: PropTypes.string, style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), - widthProp: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + sectionWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), isMobile: PropTypes.bool, }; From 50983c5f0f841a7da2f2e9a309b6c1afdddcf7a3 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 30 Oct 2020 14:21:27 +0300 Subject: [PATCH 08/20] Web: Components : Row : Renamed width property, fixed usage --- web/ASC.Web.Components/src/components/row/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/ASC.Web.Components/src/components/row/index.js b/web/ASC.Web.Components/src/components/row/index.js index 0745733b8e..5b3b31e66d 100644 --- a/web/ASC.Web.Components/src/components/row/index.js +++ b/web/ASC.Web.Components/src/components/row/index.js @@ -104,7 +104,7 @@ class Row extends React.Component { indeterminate, onSelect, selectItem, - widthProp, + sectionWidth, } = this.props; const renderCheckbox = Object.prototype.hasOwnProperty.call( @@ -119,7 +119,7 @@ class Row extends React.Component { const renderContentElement = Object.prototype.hasOwnProperty.call(this.props, "contentElement") && - widthProp > 500; + sectionWidth > 500; const renderContext = Object.prototype.hasOwnProperty.call(this.props, "contextOptions") && @@ -176,7 +176,7 @@ Row.propTypes = { checked: PropTypes.bool, children: PropTypes.element, className: PropTypes.string, - contentElement: PropTypes.element, + contentElement: PropTypes.any, contextButtonSpacerWidth: PropTypes.string, contextOptions: PropTypes.array, data: PropTypes.object, @@ -187,7 +187,7 @@ Row.propTypes = { onSelect: PropTypes.func, selectItem: PropTypes.func, style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), - widthProp: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + sectionWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), }; Row.defaultProps = { From c646f84383e946d3eea98c4867eab8401d02a5b0 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 30 Oct 2020 14:21:56 +0300 Subject: [PATCH 09/20] Web: Components : GroupButtonsMenu : Added sectionWidth property --- .../components/group-buttons-menu/index.js | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/web/ASC.Web.Components/src/components/group-buttons-menu/index.js b/web/ASC.Web.Components/src/components/group-buttons-menu/index.js index 451a8946cb..d5b97bab1e 100644 --- a/web/ASC.Web.Components/src/components/group-buttons-menu/index.js +++ b/web/ASC.Web.Components/src/components/group-buttons-menu/index.js @@ -16,8 +16,7 @@ const StyledGroupButtonsMenu = styled.div` height: 57px; list-style: none; padding: 0 18px 19px 0; - width: ${(props) => - props.containerWidth ? props.containerWidth + "px" : "100%"}; + width: 100%; white-space: nowrap; display: ${(props) => (props.visible ? "block" : "none")}; z-index: 189; @@ -77,7 +76,7 @@ class GroupButtonsMenu extends React.Component { visible: props.visible, }; - this.throttledResize = throttle(this.updateMenu, 300); + this.throttledResize = throttle(this.updateMenu, 200); } closeMenu = (e) => { @@ -129,6 +128,7 @@ class GroupButtonsMenu extends React.Component { } if ( + this.props.sectionWidth !== prevProps.sectionWidth || this.state.priorityItems.length !== prevState.priorityItems.length || this.state.moreItems.length !== prevState.moreItems.length ) { @@ -150,17 +150,20 @@ class GroupButtonsMenu extends React.Component { }; updateMenu = () => { - const moreMenuElement = document.getElementById("moreMenu"); - const groupMenuOuterElement = document.getElementById("groupMenuOuter"); + const { sectionWidth } = this.props; + let groupMenuOuterWidth = sectionWidth; - const screenWidth = window.innerWidth; - const groupMenuOuterValues = - groupMenuOuterElement && groupMenuOuterElement.getBoundingClientRect(); + if (!sectionWidth) { + const groupMenuOuterElement = document.getElementById("groupMenuOuter"); + const groupMenuOuterValues = + groupMenuOuterElement && groupMenuOuterElement.getBoundingClientRect(); + const screenWidth = window.innerWidth; + const xWidth = groupMenuOuterValues && groupMenuOuterValues.x; + groupMenuOuterWidth = screenWidth - xWidth; + } + const moreMenuElement = document.getElementById("moreMenu"); const moreMenuWidth = moreMenuElement && moreMenuElement.getBoundingClientRect().width; - const xWidth = groupMenuOuterValues && groupMenuOuterValues.x; - const groupMenuOuterWidth = screenWidth - xWidth; - const visibleItemsCount = this.countMenuItems( this.widthsArray, groupMenuOuterWidth, @@ -177,7 +180,6 @@ class GroupButtonsMenu extends React.Component { this.setState({ priorityItems: priorityItems, moreItems: moreItems, - width: groupMenuOuterWidth, }); }; @@ -196,14 +198,10 @@ class GroupButtonsMenu extends React.Component { isIndeterminate, onChange, } = this.props; - const { priorityItems, moreItems, visible, width } = this.state; + const { priorityItems, moreItems, visible } = this.state; return ( - + {priorityItems.map((item, i) => ( Date: Fri, 30 Oct 2020 14:22:30 +0300 Subject: [PATCH 10/20] Web: Files : Header : Added context to Header --- .../pages/Home/Section/Header/index.js | 253 +++++++++--------- 1 file changed, 131 insertions(+), 122 deletions(-) diff --git a/products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js b/products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js index 18fb72ca7e..ad3d027789 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js +++ b/products/ASC.Files/Client/src/components/pages/Home/Section/Header/index.js @@ -53,6 +53,7 @@ import { const { isAdmin } = store.auth.selectors; const { FilterType, FileAction } = constants; const { tablet, desktop } = utils.device; +const { Consumer } = utils.context; const StyledContainer = styled.div` @media ${desktop} { @@ -117,9 +118,9 @@ const StyledContainer = styled.div` @media ${tablet} { & > div:first-child { ${(props) => - props.isArticlePinned && + props.width && css` - width: calc(100% - 240px); + width: ${props.width + 16 + "px"}; `} position: absolute; top: 56px; @@ -490,137 +491,145 @@ class SectionHeaderContent extends React.Component { const menuItems = this.getMenuItems(); return ( - - {isHeaderVisible ? ( -
- -
- ) : ( -
- {!title ? ( - + + {(context) => ( + + {isHeaderVisible ? ( +
+ +
) : ( - <> - {!isRootFolder && ( - - )} - - {title} - - {!isRootFolder && canCreate ? ( - <> - - - +
+ {!title ? ( + ) : ( - canCreate && ( - - ) + <> + {!isRootFolder && ( + + )} + + {title} + + {!isRootFolder && canCreate ? ( + <> + + + + ) : ( + canCreate && ( + + ) + )} + )} - +
)} -
- )} - {showDeleteDialog && ( - - )} + {showDeleteDialog && ( + + )} - {showEmptyTrashDialog && ( - - )} + {showEmptyTrashDialog && ( + + )} - {showSharingPanel && ( - - )} + {showSharingPanel && ( + + )} - {showMoveToPanel && ( - - )} + {showMoveToPanel && ( + + )} - {showCopyPanel && ( - - )} + {showCopyPanel && ( + + )} - {showDownloadDialog && ( - + {showDownloadDialog && ( + + )} +
)} - + ); } } From 648427fbf40fb11d9baee911da9d0996507f4867 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 30 Oct 2020 14:22:48 +0300 Subject: [PATCH 11/20] Web: People : Header : Added context to Header --- .../pages/Home/Section/Header/index.js | 239 +++++++++--------- 1 file changed, 119 insertions(+), 120 deletions(-) diff --git a/products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js b/products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js index 2debb2bc33..54a03f54bf 100644 --- a/products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js +++ b/products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js @@ -36,6 +36,7 @@ import { ChangeUserTypeDialog, } from "../../../../dialogs"; const { tablet, desktop } = utils.device; +const { Consumer } = utils.context; const { isAdmin } = store.auth.selectors; const { EmployeeType, EmployeeStatus } = constants; @@ -57,9 +58,9 @@ const StyledContainer = styled.div` @media ${tablet} { & > div:first-child { ${(props) => - props.isArticlePinned && + props.width && css` - width: calc(100% - 240px); + width: ${props.width + 16 + "px"}; `} position: absolute; top: 56px; @@ -114,14 +115,10 @@ const SectionHeaderContent = (props) => { isAdmin, t, history, - customNames, homepage, - deleteGroup, - selection, - hasAnybodySelected, hasUsersToMakeEmployees, hasUsersToMakeGuests, @@ -129,7 +126,6 @@ const SectionHeaderContent = (props) => { hasUsersToDisable, hasUsersToInvite, hasUsersToRemove, - isLoaded, } = props; @@ -351,132 +347,135 @@ const SectionHeaderContent = (props) => { onInvitationDialogClick /* , onSentInviteAgain */, ]); - const isArticlePinned = window.localStorage.getItem("asc_article_pinned_key"); - return ( - - {employeeDialogVisible && ( - - )} + + {(context) => ( + + {employeeDialogVisible && ( + + )} - {guestDialogVisible && ( - - )} - {activeDialogVisible && ( - - )} - {disableDialogVisible && ( - - )} + {guestDialogVisible && ( + + )} + {activeDialogVisible && ( + + )} + {disableDialogVisible && ( + + )} - {sendInviteDialogVisible && ( - - )} + {sendInviteDialogVisible && ( + + )} - {deleteDialogVisible && ( - - )} + {deleteDialogVisible && ( + + )} - {isHeaderVisible ? ( -
- -
- ) : ( -
- {!isLoaded ? ( - - ) : group ? ( - <> - - {group.name} - - {isAdmin && ( - - )} - + {isHeaderVisible ? ( +
+ +
) : ( - <> - - {groupsCaption} - - {isAdmin && ( +
+ {!isLoaded ? ( + + ) : group ? ( <> - - {invitationDialogVisible && ( - + {group.name} + + {isAdmin && ( + )} + ) : ( + <> + + {groupsCaption} + + {isAdmin && ( + <> + + {invitationDialogVisible && ( + + )} + + )} + )} - +
)} -
+
)} -
+ ); }; From b055c0224acb1537344359423ef70e9843e57210 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 30 Oct 2020 14:23:23 +0300 Subject: [PATCH 12/20] Web: People : Body : Added context to RowContainer --- .../pages/Home/Section/Body/index.js | 129 ++++++++++-------- 1 file changed, 70 insertions(+), 59 deletions(-) diff --git a/products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js b/products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js index 787a4a5e8f..07bb1b29e4 100644 --- a/products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js +++ b/products/ASC.People/Client/src/components/pages/Home/Section/Body/index.js @@ -39,6 +39,7 @@ const i18n = createI18N({ page: "Home", localesPath: "pages/Home", }); +const { Consumer } = utils.context; const { isArrayEqual } = utils.array; const { getSettings } = store.auth.selectors; const { setIsLoaded } = store.auth.actions; @@ -356,6 +357,9 @@ class SectionBodyContent extends React.PureComponent { if (currentProps.status !== nextProps.status) { return true; } + if (currentProps.sectionWidth !== nextProps.sectionWidth) { + return true; + } if (!isEqual(currentProps.data, nextProps.data)) { return true; } @@ -377,7 +381,7 @@ class SectionBodyContent extends React.PureComponent { widthProp, isMobile, selectGroup, - isLoading + isLoading, } = this.props; const { dialogsVisible, user } = this.state; @@ -386,58 +390,65 @@ class SectionBodyContent extends React.PureComponent { ) : peopleList.length > 0 ? ( <> - - {peopleList.map((man) => { - const { - checked, - role, - displayName, - avatar, - id, - status, - options, - } = man; + + {(context) => ( + + {peopleList.map((man) => { + const { + checked, + role, + displayName, + avatar, + id, + status, + options, + } = man; + const sectionWidth = context.sectionWidth; + const contextOptionsProps = + options && options.length > 0 + ? { + contextOptions: this.getUserContextOptions(options, id), + } + : {}; - const contextOptionsProps = - options && options.length > 0 - ? { contextOptions: this.getUserContextOptions(options, id) } - : {}; + const checkedProps = checked !== null ? { checked } : {}; - const checkedProps = checked !== null ? { checked } : {}; + const element = ( + + ); - const element = ( - - ); - - return ( - - - - ); - })} - + return ( + + + + ); + })} + + )} + {dialogsVisible.changeEmail && ( - - {t("ClearButton")} - + + {t("ClearButton")} + } From 318202ca57d2fa74b2e940e5175fc74e2d79269e Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 30 Oct 2020 14:23:56 +0300 Subject: [PATCH 13/20] Web: People : UserContent : Added sectionWidth property, fixed missing styles --- .../src/components/pages/Home/Section/Body/userContent.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/products/ASC.People/Client/src/components/pages/Home/Section/Body/userContent.js b/products/ASC.People/Client/src/components/pages/Home/Section/Body/userContent.js index f943d0d7f1..66a2941a08 100644 --- a/products/ASC.People/Client/src/components/pages/Home/Section/Body/userContent.js +++ b/products/ASC.People/Client/src/components/pages/Home/Section/Body/userContent.js @@ -13,7 +13,7 @@ import { connect } from "react-redux"; const getFormattedGroups = (user, selectGroup) => { let temp = []; const groups = user.groups; - const linkColor = "#A3A9AE"; + const linkColor = user.statusType === "pending" ? "#D0D5DA" : "#A3A9AE"; if (!groups) temp.push({ key: 0, label: "" }); @@ -67,6 +67,7 @@ const UserContent = ({ selectGroup, widthProp, isMobile, + sectionWidth, }) => { const { userName, displayName, title, mobilePhone, email, statusType } = user; const groups = getFormattedGroups(user, selectGroup); @@ -87,14 +88,15 @@ const UserContent = ({ email, ]); - const nameColor = "#333"; - const sideInfoColor = "#A3A9AE"; + const nameColor = statusType === "pending" ? "#A3A9AE" : "#333333"; + const sideInfoColor = statusType === "pending" ? "#D0D5DA" : "#A3A9AE"; return ( Date: Fri, 30 Oct 2020 14:24:24 +0300 Subject: [PATCH 14/20] Web: Common: changed ReactResizeDetector refreshRate --- web/ASC.Web.Common/src/components/PageLayout/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/ASC.Web.Common/src/components/PageLayout/index.js b/web/ASC.Web.Common/src/components/PageLayout/index.js index 4eb8b6bafe..de0fe678d4 100644 --- a/web/ASC.Web.Common/src/components/PageLayout/index.js +++ b/web/ASC.Web.Common/src/components/PageLayout/index.js @@ -313,7 +313,11 @@ class PageLayoutComponent extends React.Component { )} {isSectionAvailable && ( - + {({ width }) => ( Date: Fri, 30 Oct 2020 14:25:04 +0300 Subject: [PATCH 15/20] Web: Files : Body : Added context to RowContainer --- .../pages/Home/Section/Body/index.js | 158 ++++++++++-------- 1 file changed, 87 insertions(+), 71 deletions(-) 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 64c7791fde..064206d436 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 @@ -15,13 +15,13 @@ import { DragAndDrop, Box, Text, + utils, } from "asc-web-components"; import EmptyFolderContainer from "./EmptyFolderContainer"; import FilesRowContent from "./FilesRowContent"; import FilesTileContent from "./FilesTileContent"; import TileContainer from "./TileContainer"; import Tile from "./Tile"; - import { api, constants, @@ -103,6 +103,7 @@ const { const { FilesFilter } = api; const { FileAction } = constants; +const { Consumer } = utils.context; const linkStyles = { isHovered: true, @@ -721,6 +722,9 @@ class SectionBodyContent extends React.Component { if (currentProps.editing !== nextProps.editing) { return true; } + if (currentProps.sectionWidth !== nextProps.sectionWidth) { + return true; + } if (!isEqual(currentProps.data, nextProps.data)) { return true; } @@ -1450,7 +1454,6 @@ class SectionBodyContent extends React.Component { currentMediaFileId, viewAs, t, - widthProp, isMobile, firstLoad, filesList, @@ -1613,77 +1616,90 @@ class SectionBodyContent extends React.Component { })} ) : ( - - {items.map((item) => { - const { checked, isFolder, value, contextOptions } = item; - const isEdit = - !!fileAction.type && - editingId === item.id && - item.fileExst === fileAction.extension; - const contextOptionsProps = - !isEdit && contextOptions && contextOptions.length > 0 - ? { - contextOptions: this.getFilesContextOptions( - contextOptions, - item - ), - } - : {}; - const checkedProps = isEdit || item.id <= 0 ? {} : { checked }; - const element = this.getItemIcon(item, isEdit || item.id <= 0); - const sharedButton = - isRecycleBin || isEdit || item.id <= 0 - ? null - : this.getSharedButton(); - const displayShareButton = - widthProp < 500 ? "26px" : isRecycleBin ? "38px" : "96px"; - let classNameProp = - isFolder && item.access < 2 && !isRecycleBin - ? { className: " dropable" } - : { className: "" }; + + {(context) => ( + + {items.map((item) => { + const { checked, isFolder, value, contextOptions } = item; + const sectionWidth = context.sectionWidth; + const isEdit = + !!fileAction.type && + editingId === item.id && + item.fileExst === fileAction.extension; + const contextOptionsProps = + !isEdit && contextOptions && contextOptions.length > 0 + ? { + contextOptions: this.getFilesContextOptions( + contextOptions, + item + ), + } + : {}; + const checkedProps = + isEdit || item.id <= 0 ? {} : { checked }; + const element = this.getItemIcon( + item, + isEdit || item.id <= 0 + ); + const sharedButton = + isRecycleBin || isEdit || item.id <= 0 || sectionWidth < 500 + ? null + : this.getSharedButton(); + const displayShareButton = + sectionWidth < 500 + ? "26px" + : isRecycleBin + ? "38px" + : "96px"; + let classNameProp = + isFolder && item.access < 2 && !isRecycleBin + ? { className: " dropable" } + : { className: "" }; - if (item.draggable) classNameProp.className += " draggable"; + if (item.draggable) classNameProp.className += " draggable"; - return ( - - - - - - ); - })} - + return ( + + + + + + ); + })} + + )} + )} {playlist.length > 0 && mediaViewerVisible && ( Date: Fri, 30 Oct 2020 14:25:22 +0300 Subject: [PATCH 16/20] web: common: bump version --- web/ASC.Web.Common/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/ASC.Web.Common/package.json b/web/ASC.Web.Common/package.json index 35f7caf766..b14d9b1e57 100644 --- a/web/ASC.Web.Common/package.json +++ b/web/ASC.Web.Common/package.json @@ -1,6 +1,6 @@ { "name": "asc-web-common", - "version": "1.0.266", + "version": "1.0.267", "description": "Ascensio System SIA common components and solutions library", "license": "AGPL-3.0", "files": [ From fa5cf43fa8fc13401a5912add7f3180ef1e8bb50 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 30 Oct 2020 14:25:33 +0300 Subject: [PATCH 17/20] web: components: bump version --- web/ASC.Web.Components/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/ASC.Web.Components/package.json b/web/ASC.Web.Components/package.json index 2e89e692d4..ebadb8785c 100644 --- a/web/ASC.Web.Components/package.json +++ b/web/ASC.Web.Components/package.json @@ -1,6 +1,6 @@ { "name": "asc-web-components", - "version": "1.0.474", + "version": "1.0.475", "description": "Ascensio System SIA component library", "license": "AGPL-3.0", "main": "dist/asc-web-components.js", From a823763af7a6afcfeac03e3cbd2f2925744ab24a Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Fri, 30 Oct 2020 15:20:06 +0300 Subject: [PATCH 18/20] Web: Files : Body : RowContent : Fixed badges actions and styles --- .../pages/Home/Section/Body/FilesRowContent.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FilesRowContent.js b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FilesRowContent.js index aeea1d002b..62a0201634 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FilesRowContent.js +++ b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/FilesRowContent.js @@ -503,7 +503,7 @@ class FilesRowContent extends React.PureComponent { > {fileExst} - {canConvert && ( + {canConvert && !isTrashFolder && ( )} - {canWebEdit && ( - )} {fileStatus === 32 && !isTrashFolder && ( From 440395d341eaa4cbfd719d6a86c3f0719d5d38ae Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Fri, 30 Oct 2020 17:22:49 +0300 Subject: [PATCH 19/20] Web: Common: fixed update main height timeout --- web/ASC.Web.Common/src/components/PageLayout/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/ASC.Web.Common/src/components/PageLayout/index.js b/web/ASC.Web.Common/src/components/PageLayout/index.js index de0fe678d4..6f2fd740f9 100644 --- a/web/ASC.Web.Common/src/components/PageLayout/index.js +++ b/web/ASC.Web.Common/src/components/PageLayout/index.js @@ -121,7 +121,7 @@ class PageLayoutComponent extends React.Component { updateMainHeight = () => { const intervalTime = 100; - const endTimeoutTime = 2000; + const endTimeoutTime = 1000; let interval, timeout, lastInnerHeight, noChangeCount; From 2ae201ebbda65256179ddbd055c07b476ccdd3bc Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Mon, 2 Nov 2020 11:29:01 +0300 Subject: [PATCH 20/20] Files: privacy --- .../Server/Controllers/FilesController.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/products/ASC.Files/Server/Controllers/FilesController.cs b/products/ASC.Files/Server/Controllers/FilesController.cs index b560466a62..192085e4de 100644 --- a/products/ASC.Files/Server/Controllers/FilesController.cs +++ b/products/ASC.Files/Server/Controllers/FilesController.cs @@ -227,6 +227,20 @@ namespace ASC.Api.Documents return result.Select(r => FilesControllerHelperInt.GetFolder(r, userIdOrGroupId, filterType, withsubfolders)); } + + [Read("@privacy")] + public FolderContentWrapper GetPrivacyFolder(Guid userIdOrGroupId, FilterType filterType, bool withsubfolders) + { + if (!IsAvailablePrivacyRoomSettings()) throw new System.Security.SecurityException(); + return FilesControllerHelperInt.GetFolder(GlobalFolderHelper.FolderPrivacy, userIdOrGroupId, filterType, withsubfolders); + } + + [Read("@privacy/available")] + public bool IsAvailablePrivacyRoomSettings() + { + return PrivacyRoomSettings.IsAvailable(TenantManager); + } + /// /// Returns the detailed list of files and folders located in the current user 'My Documents' section ///