From 64233c934272eabc2480697b6738dbe94662debe Mon Sep 17 00:00:00 2001 From: gazizova-vlada Date: Thu, 23 May 2024 12:19:05 +0300 Subject: [PATCH 001/140] Shared:ContextMenu:Added scroll to all levels of the context menu. The structure of all context menu views has been changed and nesting has been added. --- .../components/context-menu/ContextMenu.tsx | 77 ++++-- .../sub-components/MobileSubMenu.tsx | 18 +- .../context-menu/sub-components/SubMenu.tsx | 254 +++++++++--------- 3 files changed, 194 insertions(+), 155 deletions(-) diff --git a/packages/shared/components/context-menu/ContextMenu.tsx b/packages/shared/components/context-menu/ContextMenu.tsx index 5ba7908759..68ca069140 100644 --- a/packages/shared/components/context-menu/ContextMenu.tsx +++ b/packages/shared/components/context-menu/ContextMenu.tsx @@ -60,9 +60,11 @@ const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { const [model, setModel] = React.useState(null); const [changeView, setChangeView] = React.useState(false); const [showMobileMenu, setShowMobileMenu] = React.useState(false); - const [onLoad, setOnLoad] = React.useState< - undefined | (() => Promise) + const [mobileSubMenuItems, setMobileSubMenuItems] = React.useState< + ContextMenuModel[] | undefined >(undefined); + const [mobileHeader, setMobileHeader] = React.useState(""); + const [articleWidth, setArticleWidth] = React.useState(0); const prevReshow = React.useRef(false); @@ -204,7 +206,7 @@ const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { ? rects.left - currentLeftOffset - currentRightOffset : event.pageX + 1; let top = rects ? rects.top : event.pageY + 1; - const width = + let width = menuRef.current && menuRef.current.offsetParent ? menuRef.current.offsetWidth : DomHelpers.getHiddenElementOuterWidth(menuRef.current); @@ -214,29 +216,46 @@ const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { : DomHelpers.getHiddenElementOuterHeight(menuRef.current); const viewport = DomHelpers.getViewport(); + const mobileView = isMobileUtils() && (height > 210 || ignoreChangeView); + + if (!mobileView) { + const options = menuRef?.current?.getElementsByClassName("p-menuitem"); + const optionsWidth: number[] = []; + + if (options) { + Array.from(options).forEach((option) => + optionsWidth.push(option.clientWidth), + ); + + const widthMaxContent = Math.max(...optionsWidth); + + width = width || widthMaxContent; + } + } + if (theme.interfaceDirection === "rtl" && !rects && left > width) { left = event.pageX - width + 1; } - if ( - isTabletUtils() && - (height > 483 || - (isMobileOnly && window.innerHeight < window.innerWidth)) - ) { - const article = document.getElementById("article-container"); + // if ( + // isTabletUtils() && + // (height > 483 || + // (isMobileOnly && window.innerHeight < window.innerWidth)) + // ) { + // const article = document.getElementById("article-container"); - let currentArticleWidth = 0; - if (article) { - currentArticleWidth = article.offsetWidth; - } + // let currentArticleWidth = 0; + // if (article) { + // currentArticleWidth = article.offsetWidth; + // } - setChangeView(true); - setArticleWidth(currentArticleWidth); + // setChangeView(true); + // setArticleWidth(currentArticleWidth); - return; - } + // return; + // } - if (isMobileUtils() && (height > 210 || ignoreChangeView)) { + if (mobileView) { setChangeView(true); setArticleWidth(0); @@ -260,7 +279,10 @@ const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { // fit if (top < document.body.scrollTop) { - top = document.body.scrollTop; + const marginTop = 16; + + if (document.body.scrollTop === 0) top = marginTop; + else top = document.body.scrollTop; } if (containerRef) { @@ -276,6 +298,8 @@ const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { if (menuRef.current) { menuRef.current.style.left = `${left}px`; menuRef.current.style.top = `${top}px`; + + if (!mobileView) menuRef.current.style.width = `${width}px`; } } }; @@ -399,14 +423,20 @@ const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { }; }, [documentResizeListener, onHide, visible]); - const onMobileItemClick = ( + const onMobileItemClick = async ( e: React.MouseEvent | React.ChangeEvent, + label: string, + items?: ContextMenuModel[], loadFunc?: () => Promise, ) => { e.stopPropagation(); setShowMobileMenu(true); - if (loadFunc) setOnLoad(loadFunc); + + const res = loadFunc ? await loadFunc() : items; + setMobileSubMenuItems(res); + + setMobileHeader(label); }; const onBackClick = (e: React.MouseEvent) => { @@ -506,7 +536,7 @@ const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { )} - {header.title} + {showMobileMenu ? mobileHeader : header.title} )} @@ -516,7 +546,7 @@ const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { root resetMenu={resetMenu} onLeafClick={onLeafClick} - onLoad={onLoad} + mobileSubMenuItems={mobileSubMenuItems} /> ) : ( { root resetMenu={resetMenu} onLeafClick={onLeafClick} - changeView={changeView} onMobileItemClick={onMobileItemClick} /> )} diff --git a/packages/shared/components/context-menu/sub-components/MobileSubMenu.tsx b/packages/shared/components/context-menu/sub-components/MobileSubMenu.tsx index f8c7f4ae22..88419a9bb2 100644 --- a/packages/shared/components/context-menu/sub-components/MobileSubMenu.tsx +++ b/packages/shared/components/context-menu/sub-components/MobileSubMenu.tsx @@ -44,9 +44,9 @@ const MobileSubMenu = (props: { onLeafClick: (e: React.MouseEvent) => void; root?: boolean; resetMenu: boolean; - onLoad?: () => Promise; + mobileSubMenuItems?: ContextMenuModel[]; }) => { - const { onLeafClick, root, resetMenu, onLoad } = props; + const { onLeafClick, root, resetMenu, mobileSubMenuItems } = props; const [submenu, setSubmenu] = useState(null); @@ -91,16 +91,12 @@ const MobileSubMenu = (props: { } }); - const fetchSubMenu = React.useCallback(async () => { - const res = await onLoad?.(); - if (res) setSubmenu(res); - - position(); - }, [position, setSubmenu, onLoad]); - useEffect(() => { - if (onLoad) fetchSubMenu(); - }, [onLoad, fetchSubMenu]); + if (!mobileSubMenuItems?.length) return; + + setSubmenu(mobileSubMenuItems); + position(); + }, [mobileSubMenuItems, mobileSubMenuItems?.length, position]); const onItemClick = (e: React.MouseEvent, item: ContextMenuType) => { const { disabled, url, onClick, items, action } = item; diff --git a/packages/shared/components/context-menu/sub-components/SubMenu.tsx b/packages/shared/components/context-menu/sub-components/SubMenu.tsx index 5e9b4ed5bc..27d2dfe985 100644 --- a/packages/shared/components/context-menu/sub-components/SubMenu.tsx +++ b/packages/shared/components/context-menu/sub-components/SubMenu.tsx @@ -32,21 +32,14 @@ import { useTheme } from "styled-components"; import ArrowIcon from "PUBLIC_DIR/images/arrow.right.react.svg"; import OutsdideIcon from "PUBLIC_DIR/images/arrow.outside.react.svg"; -import { isMobile as isMobileDevice } from "react-device-detect"; -import { - classNames, - ObjectUtils, - DomHelpers, - isMobile, - isTablet, -} from "../../../utils"; +import { classNames, ObjectUtils, DomHelpers, isMobile } from "../../../utils"; import { ContextMenuSkeleton } from "../../../skeletons/context-menu"; -import { Scrollbar } from "../../scrollbar"; import { ToggleButton } from "../../toggle-button"; +import { Scrollbar } from "../../scrollbar"; -import { SubMenuItem } from "../ContextMenu.styled"; +import { SubMenuItem, StyledList } from "../ContextMenu.styled"; import { ContextMenuModel, ContextMenuType, @@ -63,19 +56,13 @@ const SubMenu = (props: { ) => void; onMobileItemClick?: ( e: React.MouseEvent | React.ChangeEvent, - loadFunc: () => Promise, + label: string, + items?: ContextMenuModel[], + loadFunc?: () => Promise, ) => void; - changeView?: boolean; onLoad?: () => Promise; }) => { - const { - onLeafClick, - root, - resetMenu, - changeView, - onMobileItemClick, - onLoad, - } = props; + const { onLeafClick, root, resetMenu, onMobileItemClick, onLoad } = props; const [model, setModel] = useState(props?.model); const [isLoading, setIsLoading] = useState(false); @@ -86,7 +73,7 @@ const SubMenu = (props: { const theme = useTheme(); const onItemMouseEnter = (e: React.MouseEvent, item: ContextMenuType) => { - if (item.disabled || isMobileDevice) { + if (item.disabled) { e.preventDefault(); return; } @@ -98,16 +85,18 @@ const SubMenu = (props: { e: React.MouseEvent | React.ChangeEvent, item: ContextMenuType, ) => { - if (item.onLoad) { - e.preventDefault(); - if (!isMobile() && !isTablet()) return; + const { disabled, url, onClick, items, action, label } = item; - if (isMobile() || isTablet()) onMobileItemClick?.(e, item.onLoad); - else onLeafClick?.(e); + if (label && (items || item.onLoad)) { + e.preventDefault(); + if (!isMobile()) return; + + if (items) onMobileItemClick?.(e, label as string, items, undefined); + else if (item.onLoad) + onMobileItemClick?.(e, label as string, undefined, item.onLoad); return; } - const { disabled, url, onClick, items, action } = item; if (disabled) { e.preventDefault(); return; @@ -134,7 +123,9 @@ const SubMenu = (props: { const containerOffset = DomHelpers.getOffset(parentItem); const viewport = DomHelpers.getViewport(); - const subListWidth = subMenuRef.current?.offsetParent + const options = subMenuRef.current?.getElementsByClassName("p-menuitem"); + + let subListWidth = subMenuRef.current?.offsetParent ? subMenuRef.current.offsetWidth : DomHelpers.getHiddenElementOuterWidth(subMenuRef.current); @@ -144,16 +135,49 @@ const SubMenu = (props: { const isRtl = theme.interfaceDirection === "rtl"; + if (!isMobile() && options) { + const optionsWidth: number[] = []; + Array.from(options).forEach((option) => + optionsWidth.push(Math.ceil(option.getBoundingClientRect().width)), + ); + + const widthMaxContent = Math.max(...optionsWidth); + + subListWidth = subListWidth || widthMaxContent; + } + if (subMenuRef.current) { - subMenuRef.current.style.top = "0px"; + let subMenuRefTop = null; + + if (!isMobile()) subMenuRef.current.style.width = `${subListWidth}px`; + + if (!isMobile() && !root) { + const firstList = parentItem?.firstChild as HTMLElement; + + const menuItemActive = firstList.querySelector( + ".p-menuitem-active", + ) as HTMLElement; + + const top = menuItemActive.offsetTop; + const scroller = firstList.querySelector(".scroller") as HTMLElement; + const scrollTop = scroller.scrollTop; + const positionActiveItem = top - scrollTop; + + subMenuRefTop = positionActiveItem - 2; + subMenuRef.current.style.top = `${subMenuRefTop}px`; + } const submenuRects = subMenuRef.current.getBoundingClientRect(); - if (submenuRects.bottom > viewport.height) { + if (submenuRects.bottom > viewport.height && subMenuRefTop) { const submenuMargin = 16; - const topOffset = submenuRects.bottom - viewport.height + submenuMargin; - subMenuRef.current.style.top = `${-1 * topOffset}px`; + const topOffset = + subMenuRefTop - + (submenuRects.bottom - viewport.height) - + submenuMargin; + + subMenuRef.current.style.top = `${topOffset}px`; } if (isRtl) { @@ -205,29 +229,6 @@ const SubMenu = (props: { /> ); - const renderSubMenu = (item: ContextMenuType) => { - const loaderItem = { - id: "link-loader-option", - key: "link-loader", - isLoader: true, - label: , - }; - - if (item.items || item.onLoad) { - return ( - - ); - } - - return null; - }; - const renderMenuitem = ( item: ContextMenuType, index: number, @@ -273,7 +274,7 @@ const SubMenu = (props: { const subMenuIcon = (item.items || item.onLoad) && ( ); - const subMenu = renderSubMenu(item); + const dataKeys = Object.fromEntries( Object.entries(item).filter((el) => el[0].indexOf("data-") === 0), ); @@ -330,7 +331,6 @@ const SubMenu = (props: { onMouseEnter={(e) => onItemMouseEnter(e, item)} > {content} - {subMenu} onItemMouseEnter(e, item)} > {content} - {subMenu} ); }; @@ -389,78 +388,93 @@ const SubMenu = (props: { }; const renderMenu = () => { - if (model) { - if (changeView) { - const newModel = model.filter( - (item: ContextMenuModel) => item && !item.disabled, + if (!model) return null; + + return model.map((item: ContextMenuModel, index: number) => { + if (item?.disabled) return null; + return renderItem(item, index); + }); + }; + + const renderSubMenuLower = () => { + if (!model) return null; + const submenu: JSX.Element[] = []; + + const loaderItem = { + id: "link-loader-option", + key: "link-loader", + isLoader: true, + label: , + }; + + model.forEach((item) => { + const contextMenuTypeItem = item as ContextMenuType; + + if (contextMenuTypeItem?.items || contextMenuTypeItem?.onLoad) { + submenu.push( + , ); - const rowHeights: number[] = newModel.map((item: ContextMenuModel) => { - if (!item) return 0; - if (item.isSeparator) return 13; - return 36; - }); - - // const getItemSize = (index) => rowHeights[index]; - - const height = rowHeights.reduce((a, b) => a + b); - const viewport = DomHelpers.getViewport(); - - const listHeight = - height + 61 > viewport.height - 64 - ? viewport.height - 125 - : height + 5; - - return ( - - {model.map((item: ContextMenuModel, index: number) => { - if (!item || item?.disabled) return null; - - return renderItem(item, index); - })} - - ); - - // return ( - // - // {renderItem} - // - // ); } + }); - return model.map((item: ContextMenuModel, index: number) => { - if (item?.disabled) return null; - return renderItem(item, index); - }); - } - - return null; + return submenu; }; const className = classNames({ "p-submenu-list": !root }); const submenu = renderMenu(); const active = isActive(); + const submenuLower = renderSubMenuLower(); - return ( - -
    - {submenu} -
-
+ const newModel = model.filter( + (item: ContextMenuModel) => item && !item.disabled, ); + const rowHeights: number[] = newModel.map((item: ContextMenuModel) => { + if (!item) return 0; + if (item.isSeparator) return 13; + return 36; + }); + + const height = rowHeights.reduce((a, b) => a + b); + const viewport = DomHelpers.getViewport(); + const paddingList = 12; + const marginsList = 32; + + const listHeight = + height + paddingList + marginsList > viewport.height + ? viewport.height - marginsList + : height + paddingList; + + if (model) { + return ( + + + {submenu} + {submenuLower} + + + ); + } }; export { SubMenu }; From 6d62c18b4437f05f5b6d5fc413edf862a8cd24e3 Mon Sep 17 00:00:00 2001 From: gazizova-vlada Date: Thu, 23 May 2024 12:19:45 +0300 Subject: [PATCH 002/140] Shared:ContextMenu:Change styles. --- .../context-menu/ContextMenu.styled.ts | 35 +++++++++++++------ packages/shared/themes/base.ts | 9 +++-- packages/shared/themes/dark.ts | 9 +++-- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/packages/shared/components/context-menu/ContextMenu.styled.ts b/packages/shared/components/context-menu/ContextMenu.styled.ts index 74e71c727f..ed9a018b3a 100644 --- a/packages/shared/components/context-menu/ContextMenu.styled.ts +++ b/packages/shared/components/context-menu/ContextMenu.styled.ts @@ -111,15 +111,16 @@ const StyledContextMenu = styled.div<{ box-shadow: ${(props) => props.theme.newContextMenu.boxShadow}; -moz-box-shadow: ${(props) => props.theme.newContextMenu.boxShadow}; -webkit-box-shadow: ${(props) => props.theme.newContextMenu.boxShadow}; - padding: ${(props) => props.theme.newContextMenu.padding}; - - @media ${tablet} { - ${(props) => props.changeView && styledTabletView} - } @media ${mobile} { ${(props) => props.changeView && styledMobileView} } + + .scroll-body { + display: flex; + flex-direction: column; + justify-content: center; + } } .contextmenu-header { @@ -223,7 +224,6 @@ const StyledContextMenu = styled.div<{ box-shadow: ${(props) => props.theme.dropDown.boxShadow}; -moz-box-shadow: ${(props) => props.theme.dropDown.boxShadow}; -webkit-box-shadow: ${(props) => props.theme.dropDown.boxShadow}; - padding: 4px 0px; white-space: nowrap; overflow: hidden; @@ -246,7 +246,7 @@ const StyledContextMenu = styled.div<{ position: relative; border: ${(props) => props.theme.dropDownItem.border}; margin: ${(props) => props.theme.dropDownItem.margin}; - padding: ${(props) => props.theme.dropDownItem.padding}; + padding: 0 16px; font-family: ${(props) => props.theme.fontFamily}; font-style: normal; background: none; @@ -261,10 +261,6 @@ const StyledContextMenu = styled.div<{ -webkit-touch-callout: none; - @media ${tablet} { - padding: 0 16px; - } - &:hover { background-color: ${(props) => props.noHover @@ -296,11 +292,18 @@ const StyledContextMenu = styled.div<{ &:hover { cursor: default !important; } + + @media ${mobile} { + margin-right: 8px !important; + width: calc(100% - 24px) !important; + } } .p-contextmenu .p-menuitem { position: relative; margin: ${(props) => props.theme.dropDownItem.margin}; + + min-width: max-content; } .p-contextmenu .scroll-body .p-menuitem { @@ -391,4 +394,14 @@ StyledContextMenu.defaultProps = { theme: Base, }; +export const StyledList = styled.ul<{ + listHeight: number; +}>` + & > :first-child { + .scroll-body { + height: ${(props) => `${props.listHeight}px`}; + } + } +`; + export { StyledContextMenu }; diff --git a/packages/shared/themes/base.ts b/packages/shared/themes/base.ts index c999e45c33..858030cb33 100644 --- a/packages/shared/themes/base.ts +++ b/packages/shared/themes/base.ts @@ -2751,9 +2751,9 @@ export const getBaseTheme = () => { }, separator: { borderBottom: `1px solid ${grayLightMid} !important`, - margin: "6px 16px 6px 16px !important", + margin: "6px 0px 6px 16px !important", height: "1px !important", - width: "calc(100% - 32px) !important", + width: "calc(100% - 16px) !important", }, text: { header: { @@ -2774,7 +2774,7 @@ export const getBaseTheme = () => { background: "none", svgFill: black, header: { - height: "49px", + height: "55px", borderBottom: `1px solid ${grayLightMid}`, marginBottom: "6px", }, @@ -2784,7 +2784,7 @@ export const getBaseTheme = () => { padding: "0 12px", mobile: { height: "36px", - padding: "0 16px 6px", + padding: "6px 16px", }, }, newContextMenu: { @@ -2792,7 +2792,6 @@ export const getBaseTheme = () => { borderRadius: "6px", mobileBorderRadius: "6px 6px 0 0", boxShadow: "0px 8px 16px 0px #040F1B14", - padding: "6px 0px", border: "none", devices: { maxHeight: "calc(100vh - 64px)", diff --git a/packages/shared/themes/dark.ts b/packages/shared/themes/dark.ts index 363891c81f..2e21ba0d14 100644 --- a/packages/shared/themes/dark.ts +++ b/packages/shared/themes/dark.ts @@ -2731,9 +2731,9 @@ const Dark: TTheme = { }, separator: { borderBottom: `1px solid #474747 !important`, - margin: "6px 16px 6px 16px !important", + margin: "6px 0px 6px 16px !important", height: "1px !important", - width: "calc(100% - 32px) !important", + width: "calc(100% - 16px) !important", }, text: { header: { @@ -2754,7 +2754,7 @@ const Dark: TTheme = { background: "none", svgFill: "#eeeeee", header: { - height: "49px", + height: "55px", borderBottom: `1px solid #474747`, marginBottom: "6px", }, @@ -2764,7 +2764,7 @@ const Dark: TTheme = { padding: "0 12px", mobile: { height: "36px", - padding: "0 16px 6px", + padding: "6px 16px", }, }, newContextMenu: { @@ -2772,7 +2772,6 @@ const Dark: TTheme = { borderRadius: "6px", mobileBorderRadius: "6px 6px 0 0", boxShadow: "0px 8px 16px 0px #040F1B29", - padding: "6px 0px", border: "1px solid #474747", devices: { maxHeight: "calc(100vh - 64px)", From e6e05b83ab047b102f00f1a787620f5f383a937a Mon Sep 17 00:00:00 2001 From: gazizova-vlada Date: Thu, 23 May 2024 12:20:34 +0300 Subject: [PATCH 003/140] Shared:ContextMenu:Fixed so that the context menu in any resolution will always have nesting. --- .../client/src/store/ContextOptionsStore.js | 235 ++++++++---------- 1 file changed, 104 insertions(+), 131 deletions(-) diff --git a/packages/client/src/store/ContextOptionsStore.js b/packages/client/src/store/ContextOptionsStore.js index 4ae80507a1..5f848404b1 100644 --- a/packages/client/src/store/ContextOptionsStore.js +++ b/packages/client/src/store/ContextOptionsStore.js @@ -1066,71 +1066,10 @@ class ContextOptionsStore { !contextOptions.includes("finalize-version") && contextOptions.includes("show-version-history"); - const versionActions = isDesktop() - ? onlyShowVersionHistory - ? [ - { - id: "option_show-version-history", - key: "show-version-history", - label: t("ShowVersionHistory"), - icon: HistoryReactSvgUrl, - onClick: () => - this.showVersionHistory( - item.id, - item.security, - item?.requestToken, - ), - disabled: false, - }, - ] - : [ - { - id: "option_version", - key: "version", - label: t("VersionHistory"), - icon: HistoryFinalizedReactSvgUrl, - items: [ - { - id: "option_finalize-version", - key: "finalize-version", - label: t("FinalizeVersion"), - icon: HistoryFinalizedReactSvgUrl, - onClick: () => - isEditing - ? this.onShowEditingToast(t) - : this.finalizeVersion(item.id, item.security), - disabled: false, - }, - { - id: "option_version-history", - key: "show-version-history", - label: t("ShowVersionHistory"), - icon: HistoryReactSvgUrl, - onClick: () => - this.showVersionHistory( - item.id, - item.security, - item?.requestToken, - ), - disabled: false, - }, - ], - }, - ] - : [ + const versionActions = onlyShowVersionHistory + ? [ { - id: "option_finalize-version", - key: "finalize-version", - label: t("FinalizeVersion"), - icon: HistoryFinalizedReactSvgUrl, - onClick: () => - isEditing - ? this.onShowEditingToast(t) - : this.finalizeVersion(item.id), - disabled: false, - }, - { - id: "option_version-history", + id: "option_show-version-history", key: "show-version-history", label: t("ShowVersionHistory"), icon: HistoryReactSvgUrl, @@ -1142,73 +1081,107 @@ class ContextOptionsStore { ), disabled: false, }, + ] + : [ + { + id: "option_version", + key: "version", + label: t("VersionHistory"), + icon: HistoryFinalizedReactSvgUrl, + items: [ + { + id: "option_finalize-version", + key: "finalize-version", + label: t("FinalizeVersion"), + icon: HistoryFinalizedReactSvgUrl, + onClick: () => + isEditing + ? this.onShowEditingToast(t) + : this.finalizeVersion(item.id, item.security), + disabled: false, + }, + { + id: "option_version-history", + key: "show-version-history", + label: t("ShowVersionHistory"), + icon: HistoryReactSvgUrl, + onClick: () => + this.showVersionHistory( + item.id, + item.security, + item?.requestToken, + ), + disabled: false, + }, + ], + }, + ]; + + const moveActions = !isInfoPanel + ? [ + { + id: "option_move-or-copy", + key: "move", + label: t("MoveOrCopy"), + icon: CopyReactSvgUrl, + items: [ + { + id: "option_move-to", + key: "move-to", + label: t("Common:MoveTo"), + icon: MoveReactSvgUrl, + onClick: isEditing + ? () => this.onShowEditingToast(t) + : this.onMoveAction, + disabled: false, + }, + { + id: "option_copy-to", + key: "copy-to", + label: t("Common:Copy"), + icon: CopyReactSvgUrl, + onClick: this.onCopyAction, + disabled: false, + }, + { + id: "option_create-copy", + key: "copy", + label: t("Common:Duplicate"), + icon: DuplicateReactSvgUrl, + onClick: () => this.onDuplicate(item, t), + disabled: false, + }, + ], + }, + ] + : [ + { + id: "option_move-to", + key: "move-to", + label: t("Common:MoveTo"), + icon: MoveReactSvgUrl, + onClick: isEditing + ? () => this.onShowEditingToast(t) + : this.onMoveAction, + disabled: false, + }, + { + id: "option_copy-to", + key: "copy-to", + label: t("Common:Copy"), + icon: CopyReactSvgUrl, + onClick: this.onCopyAction, + disabled: false, + }, + { + id: "option_create-copy", + key: "copy", + label: t("Common:Duplicate"), + icon: DuplicateReactSvgUrl, + onClick: () => this.onDuplicate(item, t), + disabled: false, + }, ]; - const moveActions = - isDesktop() && !isInfoPanel - ? [ - { - id: "option_move-or-copy", - key: "move", - label: t("MoveOrCopy"), - icon: CopyReactSvgUrl, - items: [ - { - id: "option_move-to", - key: "move-to", - label: t("Common:MoveTo"), - icon: MoveReactSvgUrl, - onClick: isEditing - ? () => this.onShowEditingToast(t) - : this.onMoveAction, - disabled: false, - }, - { - id: "option_copy-to", - key: "copy-to", - label: t("Common:Copy"), - icon: CopyReactSvgUrl, - onClick: this.onCopyAction, - disabled: false, - }, - { - id: "option_create-copy", - key: "copy", - label: t("Common:Duplicate"), - icon: DuplicateReactSvgUrl, - onClick: () => this.onDuplicate(item, t), - disabled: false, - }, - ], - }, - ] - : [ - { - id: "option_move-to", - key: "move-to", - label: t("Common:MoveTo"), - icon: MoveReactSvgUrl, - onClick: isEditing - ? () => this.onShowEditingToast(t) - : this.onMoveAction, - disabled: false, - }, - { - id: "option_copy-to", - key: "copy-to", - label: t("Common:Copy"), - icon: CopyReactSvgUrl, - onClick: this.onCopyAction, - disabled: false, - }, - { - id: "option_create-copy", - key: "copy", - label: t("Common:Duplicate"), - icon: DuplicateReactSvgUrl, - onClick: () => this.onDuplicate(item, t), - disabled: false, - }, - ]; const { pinOptions, muteOptions } = this.getRoomsRootContextOptions( item, @@ -1605,7 +1578,7 @@ class ContextOptionsStore { const pluginItems = this.onLoadPlugins(item); if (pluginItems.length > 0) { - if (!isDesktop() || pluginItems.length === 1) { + if (pluginItems.length === 1) { pluginItems.forEach((plugin) => { options.splice(1, 0, { id: `option_${plugin.key}`, From 87a95b6d420f6205ab565e11acabd69a9874ab3b Mon Sep 17 00:00:00 2001 From: gazizova-vlada Date: Mon, 3 Jun 2024 15:35:13 +0300 Subject: [PATCH 004/140] Shared:ContextMenu:Fix small width. --- packages/shared/components/context-menu/ContextMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared/components/context-menu/ContextMenu.tsx b/packages/shared/components/context-menu/ContextMenu.tsx index 68ca069140..782c8f467e 100644 --- a/packages/shared/components/context-menu/ContextMenu.tsx +++ b/packages/shared/components/context-menu/ContextMenu.tsx @@ -229,7 +229,7 @@ const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { const widthMaxContent = Math.max(...optionsWidth); - width = width || widthMaxContent; + width = widthMaxContent; } } From a0483cbd4c8ced5baf7f2157f3b78d62eb3cabbe Mon Sep 17 00:00:00 2001 From: gazizova-vlada Date: Fri, 7 Jun 2024 12:46:07 +0300 Subject: [PATCH 005/140] Shared:ContextMenu:Add max width context menu. Added trimming of overflowing text with ellipsis. --- .../context-menu/ContextMenu.styled.ts | 44 ++++++++++++++---- .../components/context-menu/ContextMenu.tsx | 2 +- .../context-menu/sub-components/SubMenu.tsx | 45 ++++++++++++++----- packages/shared/themes/base.ts | 3 +- packages/shared/themes/dark.ts | 3 +- 5 files changed, 73 insertions(+), 24 deletions(-) diff --git a/packages/shared/components/context-menu/ContextMenu.styled.ts b/packages/shared/components/context-menu/ContextMenu.styled.ts index d831da2ef2..f26a13bb5f 100644 --- a/packages/shared/components/context-menu/ContextMenu.styled.ts +++ b/packages/shared/components/context-menu/ContextMenu.styled.ts @@ -26,7 +26,7 @@ import styled, { css } from "styled-components"; import { Base, TTheme } from "../../themes"; -import { tablet, mobile, getCorrectFourValuesStyle } from "../../utils"; +import { mobile, isMobile, getCorrectFourValuesStyle } from "../../utils"; const styledTabletView = css<{ articleWidth: number }>` position: fixed; @@ -116,11 +116,22 @@ const StyledContextMenu = styled.div<{ ${(props) => props.changeView && styledMobileView} } + @media ${mobile} { + ${(props) => props.changeView && styledMobileView} + } + .scroll-body { display: flex; flex-direction: column; justify-content: center; + + padding-inline-end: 0 !important; } + + ${!isMobile() && + css` + max-width: calc(100vw - 32px); + `} } .contextmenu-header { @@ -212,6 +223,11 @@ const StyledContextMenu = styled.div<{ margin: 0; padding: 0; list-style: none; + + ${!isMobile() && + css` + max-width: calc(100vw - 32px); + `} } .p-contextmenu .p-submenu-list { @@ -291,22 +307,23 @@ const StyledContextMenu = styled.div<{ cursor: default !important; margin: ${(props) => props.theme.menuItem.separator.margin}; height: ${(props) => props.theme.menuItem.separator.height}; - width: ${(props) => props.theme.menuItem.separator.width}; + &:hover { cursor: default !important; } - - @media ${mobile} { - margin-right: 8px !important; - width: calc(100% - 24px) !important; - } } .p-contextmenu .p-menuitem { position: relative; margin: ${(props) => props.theme.dropDownItem.margin}; - min-width: max-content; + max-width: calc(-32px + 100vw); + width: fit-content; + min-width: inherit; + + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .p-contextmenu .scroll-body .p-menuitem { @@ -399,12 +416,23 @@ StyledContextMenu.defaultProps = { export const StyledList = styled.ul<{ listHeight: number; + widthSubMenu: null | number; }>` & > :first-child { .scroll-body { height: ${(props) => `${props.listHeight}px`}; } } + + & > :nth-child(1) { + ${(props) => + props.widthSubMenu && + css` + .p-menuitem { + max-width: ${`${props.widthSubMenu}px`}; + } + `} + } `; export { StyledContextMenu }; diff --git a/packages/shared/components/context-menu/ContextMenu.tsx b/packages/shared/components/context-menu/ContextMenu.tsx index 782c8f467e..160a9d4183 100644 --- a/packages/shared/components/context-menu/ContextMenu.tsx +++ b/packages/shared/components/context-menu/ContextMenu.tsx @@ -296,7 +296,7 @@ const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { } } if (menuRef.current) { - menuRef.current.style.left = `${left}px`; + menuRef.current.style.left = `${left || 16}px`; menuRef.current.style.top = `${top}px`; if (!mobileView) menuRef.current.style.width = `${width}px`; diff --git a/packages/shared/components/context-menu/sub-components/SubMenu.tsx b/packages/shared/components/context-menu/sub-components/SubMenu.tsx index 8a6dd6b2c5..18e9ee4dbf 100644 --- a/packages/shared/components/context-menu/sub-components/SubMenu.tsx +++ b/packages/shared/components/context-menu/sub-components/SubMenu.tsx @@ -67,6 +67,7 @@ const SubMenu = (props: { const [model, setModel] = useState(props?.model); const [isLoading, setIsLoading] = useState(false); const [activeItem, setActiveItem] = useState(null); + const [widthSubMenu, setWidthSubMenu] = useState(null); const subMenuRef = useRef(null); @@ -185,25 +186,33 @@ const SubMenu = (props: { viewport.width - containerOffsetLeft - itemOuterWidth; const freeSpaceLeft = containerOffsetLeft; const submenuListMargin = 4; - const sectionPadding = 17; + const sectionPadding = 16; if (isRtl) { - if ( - !root && - freeSpaceLeft > freeSpaceRight && - subListWidth > containerOffsetLeft - ) { - // If the menu extends beyond the screen - subMenuRef.current.style.width = `${containerOffsetLeft - submenuListMargin - sectionPadding}px`; - } - if ( subListWidth < containerOffsetLeft || (!root && freeSpaceLeft > freeSpaceRight) ) { subMenuRef.current.style.left = `${-1 * subListWidth}px`; + + if (!root && subListWidth > containerOffsetLeft) { + // If the menu extends beyond the screen + const newWidth = + containerOffsetLeft - submenuListMargin - sectionPadding; + + subMenuRef.current.style.width = `${newWidth}px`; + setWidthSubMenu(newWidth); + } } else { subMenuRef.current.style.left = `${itemOuterWidth}px`; + + if (!root && subListWidth > freeSpaceRight) { + // If the menu extends beyond the screen + const newWidth = freeSpaceRight - 3 * submenuListMargin; + + subMenuRef.current.style.width = `${newWidth}px`; + setWidthSubMenu(newWidth); + } } } @@ -212,8 +221,20 @@ const SubMenu = (props: { viewport.width - DomHelpers.calculateScrollbarWidth(); if (!isRtl) { - if (notEnoughWidthRight && containerOffsetLeft > subListWidth) { + if (notEnoughWidthRight && freeSpaceLeft > freeSpaceRight) { subMenuRef.current.style.left = `${-1 * subListWidth}px`; + + if ( + notEnoughWidthRight && + !root && + subListWidth > containerOffsetLeft + ) { + // If the menu extends beyond the screen + const newWidth = containerOffsetLeft - 12; + + subMenuRef.current.style.width = `${newWidth}px`; + setWidthSubMenu(newWidth); + } } else { subMenuRef.current.style.left = `${itemOuterWidth}px`; @@ -227,6 +248,7 @@ const SubMenu = (props: { sectionPadding; subMenuRef.current.style.width = `${newWidth}px`; + setWidthSubMenu(newWidth); } } } @@ -504,6 +526,7 @@ const SubMenu = (props: { ref={subMenuRef} className={`${className} not-selectable`} listHeight={height + paddingList} + widthSubMenu={widthSubMenu} > {submenu} {submenuLower} diff --git a/packages/shared/themes/base.ts b/packages/shared/themes/base.ts index f9c6fa56de..11bbcad285 100644 --- a/packages/shared/themes/base.ts +++ b/packages/shared/themes/base.ts @@ -2760,9 +2760,8 @@ export const getBaseTheme = () => { }, separator: { borderBottom: `1px solid ${grayLightMid} !important`, - margin: "6px 0px 6px 16px !important", + margin: "6px 16px !important", height: "1px !important", - width: "calc(100% - 16px) !important", }, text: { header: { diff --git a/packages/shared/themes/dark.ts b/packages/shared/themes/dark.ts index aca8510bfe..1947214d94 100644 --- a/packages/shared/themes/dark.ts +++ b/packages/shared/themes/dark.ts @@ -2739,9 +2739,8 @@ const Dark: TTheme = { }, separator: { borderBottom: `1px solid #474747 !important`, - margin: "6px 0px 6px 16px !important", + margin: "6px 16px !important", height: "1px !important", - width: "calc(100% - 16px) !important", }, text: { header: { From dd4e3e02550748cccfb4f2fae70f4570c809a599 Mon Sep 17 00:00:00 2001 From: gazizova-vlada Date: Fri, 7 Jun 2024 13:23:20 +0300 Subject: [PATCH 006/140] Shared:ContextMenu:Refactoring. --- packages/shared/components/context-menu/ContextMenu.tsx | 6 +++--- .../components/context-menu/sub-components/SubMenu.tsx | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/shared/components/context-menu/ContextMenu.tsx b/packages/shared/components/context-menu/ContextMenu.tsx index 160a9d4183..bc6eb24015 100644 --- a/packages/shared/components/context-menu/ContextMenu.tsx +++ b/packages/shared/components/context-menu/ContextMenu.tsx @@ -53,6 +53,8 @@ import { MobileSubMenu } from "./sub-components/MobileSubMenu"; import { ContextMenuModel, ContextMenuProps } from "./ContextMenu.types"; +const marginTop = 16; // Indentation from the top border of the screen + const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { const [visible, setVisible] = React.useState(false); const [reshow, setReshow] = React.useState(false); @@ -62,7 +64,7 @@ const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { const [showMobileMenu, setShowMobileMenu] = React.useState(false); const [mobileSubMenuItems, setMobileSubMenuItems] = React.useState< ContextMenuModel[] | undefined - >(undefined); + >([]); const [mobileHeader, setMobileHeader] = React.useState(""); const [articleWidth, setArticleWidth] = React.useState(0); @@ -279,8 +281,6 @@ const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { // fit if (top < document.body.scrollTop) { - const marginTop = 16; - if (document.body.scrollTop === 0) top = marginTop; else top = document.body.scrollTop; } diff --git a/packages/shared/components/context-menu/sub-components/SubMenu.tsx b/packages/shared/components/context-menu/sub-components/SubMenu.tsx index 18e9ee4dbf..dd40d90448 100644 --- a/packages/shared/components/context-menu/sub-components/SubMenu.tsx +++ b/packages/shared/components/context-menu/sub-components/SubMenu.tsx @@ -46,6 +46,9 @@ import { SeparatorType, } from "../ContextMenu.types"; +const submenuListMargin = 4; // Indentation of the second level menu from the first level +const sectionPadding = 16; // Screen margin + const SubMenu = (props: { model: ContextMenuModel[]; root?: boolean; @@ -185,8 +188,6 @@ const SubMenu = (props: { const freeSpaceRight = viewport.width - containerOffsetLeft - itemOuterWidth; const freeSpaceLeft = containerOffsetLeft; - const submenuListMargin = 4; - const sectionPadding = 16; if (isRtl) { if ( From 52ab6ff5c9c89d34d4c959f99adba2f1b079d85b Mon Sep 17 00:00:00 2001 From: gazizova-vlada Date: Fri, 7 Jun 2024 13:27:11 +0300 Subject: [PATCH 007/140] Shared:ContextMenu:Refactoring. --- packages/shared/components/context-menu/ContextMenu.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/shared/components/context-menu/ContextMenu.tsx b/packages/shared/components/context-menu/ContextMenu.tsx index bc6eb24015..66998b4a53 100644 --- a/packages/shared/components/context-menu/ContextMenu.tsx +++ b/packages/shared/components/context-menu/ContextMenu.tsx @@ -53,7 +53,7 @@ import { MobileSubMenu } from "./sub-components/MobileSubMenu"; import { ContextMenuModel, ContextMenuProps } from "./ContextMenu.types"; -const marginTop = 16; // Indentation from the top border of the screen +const marginBorder = 16; // Indentation from the border of the screen const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { const [visible, setVisible] = React.useState(false); @@ -281,7 +281,7 @@ const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { // fit if (top < document.body.scrollTop) { - if (document.body.scrollTop === 0) top = marginTop; + if (document.body.scrollTop === 0) top = marginBorder; else top = document.body.scrollTop; } @@ -296,7 +296,7 @@ const ContextMenu = React.forwardRef((props: ContextMenuProps, ref) => { } } if (menuRef.current) { - menuRef.current.style.left = `${left || 16}px`; + menuRef.current.style.left = `${left || marginBorder}px`; menuRef.current.style.top = `${top}px`; if (!mobileView) menuRef.current.style.width = `${width}px`; From 559f0141857eb0f833a21ad4c650296cc0196afd Mon Sep 17 00:00:00 2001 From: Vlada Gazizova <94864088+gazizova-vlada@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:55:13 +0300 Subject: [PATCH 008/140] Shared:ContextMenu:Fix width submenu lower in header. --- .../shared/components/context-menu/sub-components/SubMenu.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/shared/components/context-menu/sub-components/SubMenu.tsx b/packages/shared/components/context-menu/sub-components/SubMenu.tsx index dd40d90448..ad631cef7d 100644 --- a/packages/shared/components/context-menu/sub-components/SubMenu.tsx +++ b/packages/shared/components/context-menu/sub-components/SubMenu.tsx @@ -147,7 +147,8 @@ const SubMenu = (props: { const widthMaxContent = Math.max(...optionsWidth); - subListWidth = subListWidth || widthMaxContent; + if (root) subListWidth = subListWidth || widthMaxContent; + else subListWidth = Math.max(subListWidth, widthMaxContent); } if (subMenuRef.current) { From 80ac3a0f71769df1463f7b8b364d3b54a368daf8 Mon Sep 17 00:00:00 2001 From: Vlada Gazizova <94864088+gazizova-vlada@users.noreply.github.com> Date: Wed, 31 Jul 2024 13:43:36 +0300 Subject: [PATCH 009/140] Shared:ContextMenu:Fixed incorrect opening of the second level menu under the tablet. --- .../shared/components/context-menu/sub-components/SubMenu.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/shared/components/context-menu/sub-components/SubMenu.tsx b/packages/shared/components/context-menu/sub-components/SubMenu.tsx index a8580dd235..bd87d213f6 100644 --- a/packages/shared/components/context-menu/sub-components/SubMenu.tsx +++ b/packages/shared/components/context-menu/sub-components/SubMenu.tsx @@ -91,11 +91,9 @@ const SubMenu = (props: { ) => { const { disabled, url, onClick, items, action, label } = item; - if (label && (items || item.onLoad)) { + if (isMobile() && label && (items || item.onLoad)) { e.preventDefault(); - if (!isMobileDevice) return; - if (items) onMobileItemClick?.(e, label as string, items, undefined); else if (item.onLoad) onMobileItemClick?.(e, label as string, undefined, item.onLoad); From 9ec6a8da2ad474d7c36b4c7a6d7fc72e168efbc1 Mon Sep 17 00:00:00 2001 From: Vlada Gazizova <94864088+gazizova-vlada@users.noreply.github.com> Date: Wed, 31 Jul 2024 14:07:30 +0300 Subject: [PATCH 010/140] Shared:ContextMenu:Removed unnecessary code. --- .../components/context-menu/ContextMenu.tsx | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/packages/shared/components/context-menu/ContextMenu.tsx b/packages/shared/components/context-menu/ContextMenu.tsx index 8a67535e03..4692a8d93d 100644 --- a/packages/shared/components/context-menu/ContextMenu.tsx +++ b/packages/shared/components/context-menu/ContextMenu.tsx @@ -248,24 +248,6 @@ const ContextMenu = React.forwardRef( left = event.pageX - width + 1; } - // if ( - // isTabletUtils() && - // (height > 483 || - // (isMobileOnly && window.innerHeight < window.innerWidth)) - // ) { - // const article = document.getElementById("article-container"); - - // let currentArticleWidth = 0; - // if (article) { - // currentArticleWidth = article.offsetWidth; - // } - - // setChangeView(true); - // setArticleWidth(currentArticleWidth); - - // return; - // } - if (mobileView) { setChangeView(true); setArticleWidth(0); From 9995d9f37476b8501d3b83de3adba7e03f8435d5 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Tue, 6 Aug 2024 18:39:03 +0300 Subject: [PATCH 011/140] Client: Components: Dialogs: Fixed dialog height. --- .../src/components/dialogs/InviteUsersWarningDialog/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/client/src/components/dialogs/InviteUsersWarningDialog/index.js b/packages/client/src/components/dialogs/InviteUsersWarningDialog/index.js index ce65ad9d9c..5cf13d0b72 100644 --- a/packages/client/src/components/dialogs/InviteUsersWarningDialog/index.js +++ b/packages/client/src/components/dialogs/InviteUsersWarningDialog/index.js @@ -91,6 +91,7 @@ const InviteUsersWarningDialog = (props) => { visible={visible} onClose={onClose} displayType="modal" + autoMaxHeight > {t("Common:Warning")} From f435cb71a75746a252c37cce1c2db55acb538937 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Tue, 6 Aug 2024 19:09:36 +0300 Subject: [PATCH 012/140] Added display of dialogs if the limit on the number of added users has been reached. --- .../components/Article/MainButton/index.js | 7 +++++- .../client/src/store/ContextOptionsStore.js | 5 +++- packages/client/src/store/index.js | 1 + packages/shared/store/CurrentQuotaStore.ts | 23 ++++++++++++++++--- packages/shared/store/index.ts | 5 +++- 5 files changed, 35 insertions(+), 6 deletions(-) diff --git a/packages/client/src/components/Article/MainButton/index.js b/packages/client/src/components/Article/MainButton/index.js index 6f1f4e0afb..a933c7f74a 100644 --- a/packages/client/src/components/Article/MainButton/index.js +++ b/packages/client/src/components/Article/MainButton/index.js @@ -180,6 +180,7 @@ const ArticleMainButtonContent = (props) => { parentRoomType, isFolder, + showWarningDialog, } = props; const navigate = useNavigate(); @@ -283,7 +284,7 @@ const ArticleMainButtonContent = (props) => { const onInvite = React.useCallback((e) => { const type = e.action; - if (isGracePeriod) { + if (showWarningDialog(type)) { setInviteUsersWarningDialogVisible(true); return; } @@ -901,6 +902,7 @@ export default inject( versionHistoryStore, userStore, currentTariffStatusStore, + currentQuotaStore, }) => { const { showArticleLoader } = clientLoadingStore; const { mainButtonMobileVisible } = filesStore; @@ -939,6 +941,7 @@ export default inject( const { isAdmin, isOwner, isRoomAdmin } = userStore.user; const { isGracePeriod } = currentTariffStatusStore; + const { showWarningDialog } = currentQuotaStore; const { setOformFromFolderId, oformsFilter } = oformsStore; const { mainButtonItemsList } = pluginStore; @@ -997,6 +1000,8 @@ export default inject( isFolder, selectFileFormRoomDialogVisible, setSelectFileFormRoomDialogVisible, + + showWarningDialog, }; }, )( diff --git a/packages/client/src/store/ContextOptionsStore.js b/packages/client/src/store/ContextOptionsStore.js index 9d0ddf6fd1..989b245927 100644 --- a/packages/client/src/store/ContextOptionsStore.js +++ b/packages/client/src/store/ContextOptionsStore.js @@ -139,6 +139,7 @@ class ContextOptionsStore { pluginStore; infoPanelStore; currentTariffStatusStore; + currentQuotaStore; userStore; clientLoadingStore; @@ -160,6 +161,7 @@ class ContextOptionsStore { pluginStore, infoPanelStore, currentTariffStatusStore, + currentQuotaStore, userStore, clientLoadingStore, ) { @@ -179,6 +181,7 @@ class ContextOptionsStore { this.pluginStore = pluginStore; this.infoPanelStore = infoPanelStore; this.currentTariffStatusStore = currentTariffStatusStore; + this.currentQuotaStore = currentQuotaStore; this.userStore = userStore; this.clientLoadingStore = clientLoadingStore; } @@ -2104,7 +2107,7 @@ class ContextOptionsStore { const type = e.item["data-type"]; - if (this.currentTariffStatusStore.isGracePeriod) { + if (this.currentQuotaStore.showWarningDialog(type)) { setInviteUsersWarningDialogVisible(true); return; } diff --git a/packages/client/src/store/index.js b/packages/client/src/store/index.js index c63b3018a2..b8225f1cfa 100644 --- a/packages/client/src/store/index.js +++ b/packages/client/src/store/index.js @@ -234,6 +234,7 @@ const contextOptionsStore = new ContextOptionsStore( pluginStore, infoPanelStore, currentTariffStatusStore, + currentQuotaStore, userStore, clientLoadingStore, ); diff --git a/packages/shared/store/CurrentQuotaStore.ts b/packages/shared/store/CurrentQuotaStore.ts index f43e918729..ccf36e2c8c 100644 --- a/packages/shared/store/CurrentQuotaStore.ts +++ b/packages/shared/store/CurrentQuotaStore.ts @@ -34,7 +34,7 @@ import { import { toastr } from "../components/toast"; import { TData } from "../components/toast/Toast.type"; -import { PortalFeaturesLimitations } from "../enums"; +import { EmployeeType, PortalFeaturesLimitations } from "../enums"; import api from "../api"; import { TPaymentFeature, TPaymentQuota } from "../api/portal/types"; import { @@ -49,19 +49,25 @@ import { } from "../constants"; import { Nullable } from "../types"; import { UserStore } from "./UserStore"; - +import { CurrentTariffStatusStore } from "./CurrentTariffStatusStore"; class CurrentQuotasStore { currentPortalQuota: Nullable = null; userStore: UserStore | null = null; + currentTariffStatusStore: CurrentTariffStatusStore | null = null; + currentPortalQuotaFeatures: TPaymentFeature[] = []; isLoaded = false; - constructor(userStoreConst: UserStore) { + constructor( + userStoreConst: UserStore, + currentTariffStatusStore: CurrentTariffStatusStore, + ) { makeAutoObservable(this); this.userStore = userStoreConst; + this.currentTariffStatusStore = currentTariffStatusStore; } setIsLoaded = (isLoaded: boolean) => { @@ -274,6 +280,17 @@ class CurrentQuotasStore { ); } + get isPaidUserLimit() { + return this.addedManagersCount >= this.maxCountManagersByQuota; + } + + showWarningDialog = (type: number) => { + if (type && this.isPaidUserLimit && type !== EmployeeType.Guest) + return true; + + return this.currentTariffStatusStore?.isGracePeriod; + }; + get showUserPersonalQuotaBar() { const personalQuotaLimitReached = this.userStore?.personalQuotaLimitReached; diff --git a/packages/shared/store/index.ts b/packages/shared/store/index.ts index 5f8295bda2..c09c614dbb 100644 --- a/packages/shared/store/index.ts +++ b/packages/shared/store/index.ts @@ -36,9 +36,12 @@ import { SettingsStore } from "./SettingsStore"; export const userStore = new UserStore(); export const tfaStore = new TfaStore(); export const bannerStore = new BannerStore(); -export const currentQuotaStore = new CurrentQuotasStore(userStore); export const paymentQuotasStore = new PaymentQuotasStore(); export const currentTariffStatusStore = new CurrentTariffStatusStore(); +export const currentQuotaStore = new CurrentQuotasStore( + userStore, + currentTariffStatusStore, +); export const settingsStore = new SettingsStore(); export const authStore = new AuthStore( userStore, From 6e5dd2eccf58d7f88b351cdfc719ee1fa5e79696 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Wed, 7 Aug 2024 16:45:45 +0300 Subject: [PATCH 013/140] Client/Shared: Added a property that allows you not to change the selected item and display the toast. --- .../src/components/AccessSelector/index.tsx | 8 ++ .../GlobalEvents/ChangeUserTypeEvent.js | 33 +------- .../components/PaidQuotaLimitError/index.js | 78 +++++++++++++++++++ .../dialogs/ChangeUserStatusDialog/index.js | 29 +------ .../sub-components/ExternalLinks.js | 25 ++++-- .../InvitePanel/sub-components/InviteInput.js | 54 +++++++------ .../access-right-select/AccessRightSelect.tsx | 11 ++- .../AccessRightSelect.types.ts | 2 + 8 files changed, 154 insertions(+), 86 deletions(-) create mode 100644 packages/client/src/components/PaidQuotaLimitError/index.js diff --git a/packages/client/src/components/AccessSelector/index.tsx b/packages/client/src/components/AccessSelector/index.tsx index f68d953ca8..932b4e0a90 100644 --- a/packages/client/src/components/AccessSelector/index.tsx +++ b/packages/client/src/components/AccessSelector/index.tsx @@ -52,6 +52,8 @@ interface AccessSelectorProps { isDisabled?: boolean; directionX?: string; directionY?: string; + isSelectionDisabled?: boolean; + selectionErrorText: React.ReactNode; } const AccessSelector: React.FC = ({ @@ -72,6 +74,8 @@ const AccessSelector: React.FC = ({ isDisabled, directionX = "right", directionY = "bottom", + isSelectionDisabled, + selectionErrorText, }) => { const [horizontalOrientation, setHorizontalOrientation] = useState(false); const [width, setWidth] = useState(manualWidth || 0); @@ -133,6 +137,8 @@ const AccessSelector: React.FC = ({ setIsOpenItemAccess={setIsOpenItemAccess} hideMobileView={isMobileHorizontalOrientation} isDisabled={isDisabled} + isSelectionDisabled={isSelectionDisabled} + selectionErrorText={selectionErrorText} /> )} @@ -155,6 +161,8 @@ const AccessSelector: React.FC = ({ withBackground={!isMobileView} withBlur={isMobileView} isDisabled={isDisabled} + isSelectionDisabled={isSelectionDisabled} + selectionErrorText={selectionErrorText} /> )} diff --git a/packages/client/src/components/GlobalEvents/ChangeUserTypeEvent.js b/packages/client/src/components/GlobalEvents/ChangeUserTypeEvent.js index f06686be51..10e9f3d421 100644 --- a/packages/client/src/components/GlobalEvents/ChangeUserTypeEvent.js +++ b/packages/client/src/components/GlobalEvents/ChangeUserTypeEvent.js @@ -31,9 +31,7 @@ import { useNavigate } from "react-router-dom"; import { ChangeUserTypeDialog } from "../dialogs"; import { toastr } from "@docspace/shared/components/toast"; -import { Link } from "@docspace/shared/components/link"; -import { Text } from "@docspace/shared/components/text"; -import { combineUrl } from "@docspace/shared/utils/combineUrl"; +import PaidQuotaLimitError from "../PaidQuotaLimitError"; const ChangeUserTypeEvent = ({ setVisible, @@ -46,7 +44,6 @@ const ChangeUserTypeEvent = ({ getPeopleListItem, setInfoPanelSelection, needResetUserSelection, - isRoomAdmin, }) => { const { toType, fromType, userIDs, successCallback, abortCallback } = peopleDialogData; @@ -76,16 +73,6 @@ const ChangeUserTypeEvent = ({ }; }, [peopleDialogData]); - const onClickPayments = () => { - const paymentPageUrl = combineUrl( - "/portal-settings", - "/payments/portal-payments", - ); - - toastr.clear(); - navigate(paymentPageUrl); - }; - const onChangeUserType = () => { onClosePanel(); updateUserType(toType, userIDs, peopleFilter, fromType) @@ -101,20 +88,7 @@ const ChangeUserTypeEvent = ({ successCallback && successCallback(users); }) .catch((err) => { - toastr.error( - <> - {t("Common:QuotaPaidUserLimitError")} - {!isRoomAdmin && ( - - {t("Common:PaymentsTitle")} - - )} - , - false, - 0, - true, - true, - ); + toastr.error(, false, 0, true, true); abortCallback && abortCallback(); }) @@ -170,7 +144,7 @@ export default inject( changeUserTypeDialogVisible: visible, setChangeUserTypeDialogVisible: setVisible, } = dialogsStore; - const { isRoomAdmin } = authStore; + const { setInfoPanelSelection } = infoPanelStore; const { dialogStore, filterStore, usersStore } = peopleStore; @@ -180,7 +154,6 @@ export default inject( usersStore; const { setSelected } = peopleStore.selectionStore; return { - isRoomAdmin, needResetUserSelection, getPeopleListItem, setInfoPanelSelection, diff --git a/packages/client/src/components/PaidQuotaLimitError/index.js b/packages/client/src/components/PaidQuotaLimitError/index.js new file mode 100644 index 0000000000..0cb8791277 --- /dev/null +++ b/packages/client/src/components/PaidQuotaLimitError/index.js @@ -0,0 +1,78 @@ +// (c) Copyright Ascensio System SIA 2009-2024 +// +// This program is a free software product. +// You can redistribute it and/or modify it under the terms +// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software +// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended +// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of +// any third-party rights. +// +// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see +// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html +// +// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021. +// +// The interactive user interfaces in modified source and object code versions of the Program must +// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3. +// +// Pursuant to Section 7(b) of the License you must retain the original Product logo when +// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under +// trademark law for use of our trademarks. +// +// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing +// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 +// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode +import { useTranslation } from "react-i18next"; +import { inject, observer } from "mobx-react"; + +import { Text } from "@docspace/shared/components/text"; +import { Link } from "@docspace/shared/components/link"; +import { toastr } from "@docspace/shared/components/toast"; +import { combineUrl } from "@docspace/shared/utils/combineUrl"; + +const PaidQuotaLimitError = ({ + isRoomAdmin, + setInvitePanelOptions, + invitePanelVisible, +}) => { + const { t } = useTranslation(); + + const onClickPayments = () => { + const paymentPageUrl = combineUrl( + "/portal-settings", + "/payments/portal-payments", + ); + + toastr.clear(); + window.DocSpace.navigate(paymentPageUrl); + + invitePanelVisible && + setInvitePanelOptions({ + visible: false, + hideSelector: false, + defaultAccess: 1, + }); + }; + + return ( + <> + {t("Common:QuotaPaidUserLimitError")} + {!isRoomAdmin && ( + + {t("Common:PaymentsTitle")} + + )} + + ); +}; + +export default inject(({ authStore, dialogsStore }) => { + const { isRoomAdmin } = authStore; + const { setInvitePanelOptions, invitePanelOptions } = dialogsStore; + return { + isRoomAdmin, + setInvitePanelOptions, + invitePanelVisible: invitePanelOptions.visible, + }; +})(observer(PaidQuotaLimitError)); diff --git a/packages/client/src/components/dialogs/ChangeUserStatusDialog/index.js b/packages/client/src/components/dialogs/ChangeUserStatusDialog/index.js index fba64709eb..694d3e147d 100644 --- a/packages/client/src/components/dialogs/ChangeUserStatusDialog/index.js +++ b/packages/client/src/components/dialogs/ChangeUserStatusDialog/index.js @@ -30,7 +30,6 @@ import PropTypes from "prop-types"; import { ModalDialog } from "@docspace/shared/components/modal-dialog"; import { Button } from "@docspace/shared/components/button"; import { Text } from "@docspace/shared/components/text"; -import { Link } from "@docspace/shared/components/link"; import { toastr } from "@docspace/shared/components/toast"; import { combineUrl } from "@docspace/shared/utils/combineUrl"; @@ -41,6 +40,8 @@ import { EmployeeStatus } from "@docspace/shared/enums"; import ModalDialogContainer from "../ModalDialogContainer"; import { inject, observer } from "mobx-react"; +import PaidQuotaLimitError from "SRC_DIR/components/PaidQuotaLimitError"; + class ChangeUserStatusDialogComponent extends React.Component { constructor(props) { super(props); @@ -48,15 +49,6 @@ class ChangeUserStatusDialogComponent extends React.Component { this.state = { isRequestRunning: false }; } - onClickPayments = () => { - const paymentPageUrl = combineUrl( - "/portal-settings", - "/payments/portal-payments", - ); - - toastr.clear(); - window.DocSpace.navigate(paymentPageUrl); - }; onChangeUserStatus = () => { const { updateUserStatus, @@ -83,22 +75,7 @@ class ChangeUserStatusDialogComponent extends React.Component { toastr.success(t("PeopleTranslations:SuccessChangeUserStatus")); }) .catch((err) => { - toastr.error( - <> - {t("Common:QuotaPaidUserLimitError")} - - {t("Common:PaymentsTitle")} - - , - false, - 0, - true, - true, - ); + toastr.error(, false, 0, true, true); }) .finally(() => { this.setState({ isRequestRunning: false }, () => { diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/ExternalLinks.js b/packages/client/src/components/panels/InvitePanel/sub-components/ExternalLinks.js index 3157df9554..ba5491f354 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/ExternalLinks.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/ExternalLinks.js @@ -38,9 +38,12 @@ import { IconButton } from "@docspace/shared/components/icon-button"; import { DropDown } from "@docspace/shared/components/drop-down"; import { DropDownItem } from "@docspace/shared/components/drop-down-item"; import { getDefaultAccessUser } from "@docspace/shared/utils/getDefaultAccessUser"; +import { ShareAccessRights } from "@docspace/shared/enums"; +import { Link } from "@docspace/shared/components/link"; +import { Text } from "@docspace/shared/components/text"; import AccessSelector from "../../../AccessSelector"; - +import PaidQuotaLimitError from "../../../PaidQuotaLimitError"; import { StyledBlock, StyledSubHeader, @@ -50,6 +53,9 @@ import { StyledDescription, } from "../StyledInvitePanel"; +import { getPaidQuotaLimitError } from "SRC_DIR/helpers/filesUtils"; + + const ExternalLinks = ({ t, roomId, @@ -65,6 +71,7 @@ const ExternalLinks = ({ activeLink, isMobileView, getPortalInviteLink, + isPaidUserLimit, }) => { const [actionLinksVisible, setActionLinksVisible] = useState(false); @@ -114,14 +121,16 @@ const ExternalLinks = ({ const onSelectAccess = async (access) => { let link = null; - if (roomId === -1) { - link = shareLinks.find((l) => l.access === access.access); + const selectedAccess = access.access; - link.shareLink = await getPortalInviteLink(access.access); + if (roomId === -1) { + link = shareLinks.find((l) => l.access === selectedAccess); + + link.shareLink = await getPortalInviteLink(selectedAccess); setActiveLink(link); } else { - setInvitationLinks(roomId, "Invite", +access.access, shareLinks[0].id); + setInvitationLinks(roomId, "Invite", +selectedAccess, shareLinks[0].id); link = shareLinks[0]; setActiveLink(shareLinks[0]); @@ -255,6 +264,8 @@ const ExternalLinks = ({ containerRef={inputsRef} isOwner={isOwner} isMobileView={isMobileView} + isSelectionDisabled={isPaidUserLimit} + selectionErrorText={} /> )} @@ -263,12 +274,13 @@ const ExternalLinks = ({ }; export default inject( - ({ userStore, dialogsStore, filesStore, peopleStore }) => { + ({ userStore, dialogsStore, filesStore, peopleStore, currentQuotaStore }) => { const { isOwner } = userStore.user; const { invitePanelOptions } = dialogsStore; const { setInvitationLinks } = filesStore; const { roomId, hideSelector, defaultAccess } = invitePanelOptions; const { getPortalInviteLink } = peopleStore.inviteLinksStore; + const { isPaidUserLimit } = currentQuotaStore; return { setInvitationLinks, @@ -277,6 +289,7 @@ export default inject( defaultAccess, isOwner, getPortalInviteLink, + isPaidUserLimit, }; }, )(observer(ExternalLinks)); diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js b/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js index ba84904bda..b810807b06 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js @@ -68,6 +68,7 @@ import { import AtReactSvgUrl from "PUBLIC_DIR/images/@.react.svg?url"; import ArrowIcon from "PUBLIC_DIR/images/arrow.right.react.svg"; +import PaidQuotaLimitError from "SRC_DIR/components/PaidQuotaLimitError"; const minSearchValue = 2; @@ -92,6 +93,7 @@ const InviteInput = ({ i18n, setCultureKey, standalone, + isPaidUserLimit, }) => { const isPublicRoomType = roomType === RoomsType.PublicRoom; @@ -551,6 +553,8 @@ const InviteInput = ({ containerRef={inputsRef} isOwner={isOwner} isMobileView={isMobileView} + isSelectionDisabled={isPaidUserLimit} + selectionErrorText={} /> {!hideSelector && addUsersPanelVisible && ( @@ -578,31 +582,35 @@ const InviteInput = ({ ); }; -export default inject(({ settingsStore, dialogsStore, userStore }) => { - const { isOwner } = userStore.user; - const { - invitePanelOptions, - setInviteItems, - inviteItems, - setInviteLanguage, - culture, - } = dialogsStore; +export default inject( + ({ settingsStore, dialogsStore, userStore, currentQuotaStore }) => { + const { isOwner } = userStore.user; + const { + invitePanelOptions, + setInviteItems, + inviteItems, + setInviteLanguage, + culture, + } = dialogsStore; - const { culture: language, standalone } = settingsStore; + const { culture: language, standalone } = settingsStore; + const { isPaidUserLimit } = currentQuotaStore; - return { - language, - setInviteLanguage, - setInviteItems, - inviteItems, - culture, - roomId: invitePanelOptions.roomId, - hideSelector: invitePanelOptions.hideSelector, - defaultAccess: invitePanelOptions.defaultAccess, - isOwner, - standalone, - }; -})( + return { + language, + setInviteLanguage, + setInviteItems, + inviteItems, + culture, + roomId: invitePanelOptions.roomId, + hideSelector: invitePanelOptions.hideSelector, + defaultAccess: invitePanelOptions.defaultAccess, + isOwner, + standalone, + isPaidUserLimit, + }; + }, +)( withCultureNames( withTranslation(["InviteDialog", "Common", "Translations"])( observer(InviteInput), diff --git a/packages/shared/components/access-right-select/AccessRightSelect.tsx b/packages/shared/components/access-right-select/AccessRightSelect.tsx index bd6acbb891..71984a6d3d 100644 --- a/packages/shared/components/access-right-select/AccessRightSelect.tsx +++ b/packages/shared/components/access-right-select/AccessRightSelect.tsx @@ -29,6 +29,7 @@ import React, { useState, useEffect, useCallback } from "react"; import { DropDownItem } from "../drop-down-item"; import { Badge } from "../badge"; import { TOption } from "../combobox"; +import { toastr } from "../toast"; import { StyledItemTitle, @@ -46,6 +47,8 @@ export const AccessRightSelectPure = ({ advancedOptions, selectedOption, className, + isSelectionDisabled, + selectionErrorText, ...props }: AccessRightSelectProps) => { const [currentItem, setCurrentItem] = useState(selectedOption); @@ -57,7 +60,13 @@ export const AccessRightSelectPure = ({ const onSelectCurrentItem = useCallback( (option: TOption) => { if (option) { - setCurrentItem(option); + if (!isSelectionDisabled) setCurrentItem(option); + + if (isSelectionDisabled && option.access !== selectedOption.access) { + toastr.error(selectionErrorText); + return; + } + onSelect?.(option); } }, diff --git a/packages/shared/components/access-right-select/AccessRightSelect.types.ts b/packages/shared/components/access-right-select/AccessRightSelect.types.ts index 5bdd81b51a..1d14224eb9 100644 --- a/packages/shared/components/access-right-select/AccessRightSelect.types.ts +++ b/packages/shared/components/access-right-select/AccessRightSelect.types.ts @@ -49,4 +49,6 @@ type PropsFromCombobox = Pick< export type AccessRightSelectProps = PropsFromCombobox & { /** List of access options */ accessOptions: ComboboxProps["options"]; + isSelectionDisabled?: boolean; + selectionErrorText?: React.ReactNode; }; From 3094409fa861364f99bd970ed6f503342ebca688 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Thu, 8 Aug 2024 13:29:43 +0300 Subject: [PATCH 014/140] Client: Added a notification about how much the quota is exceeded when trying to invite a paid user. --- .../components/panels/InvitePanel/index.js | 70 ++++++++++++++++++- .../InvitePanel/sub-components/InviteInput.js | 13 +++- .../panels/InvitePanel/sub-components/Item.js | 23 ++++-- packages/client/src/store/DialogsStore.js | 27 +++++++ public/locales/en/Common.json | 2 + 5 files changed, 126 insertions(+), 9 deletions(-) diff --git a/packages/client/src/components/panels/InvitePanel/index.js b/packages/client/src/components/panels/InvitePanel/index.js index 7633df58a1..da952601bc 100644 --- a/packages/client/src/components/panels/InvitePanel/index.js +++ b/packages/client/src/components/panels/InvitePanel/index.js @@ -32,7 +32,7 @@ import React, { useRef, } from "react"; import { observer, inject } from "mobx-react"; -import { withTranslation } from "react-i18next"; +import { withTranslation, Trans } from "react-i18next"; import { DeviceType, EmployeeType } from "@docspace/shared/enums"; import { LOADER_TIMEOUT } from "@docspace/shared/constants"; @@ -60,6 +60,10 @@ import { Scrollbar } from "@docspace/shared/components/scrollbar"; import InfoBar from "./sub-components/InfoBar"; import InvitePanelLoader from "./sub-components/InvitePanelLoader"; +import { Link } from "@docspace/shared/components/link"; +import { Text } from "@docspace/shared/components/text"; +import { combineUrl } from "@docspace/shared/utils/combineUrl"; +import { ColorTheme, ThemeId } from "@docspace/shared/components/color-theme"; const InvitePanel = ({ folders, @@ -81,6 +85,9 @@ const InvitePanel = ({ getUsersList, filter, currentDeviceType, + isRoomAdmin, + maxCountManagersByQuota, + invitePaidUsersCount, }) => { const [invitePanelIsLoding, setInvitePanelIsLoading] = useState( roomId !== -1, @@ -245,6 +252,22 @@ const InvitePanel = ({ return () => document.removeEventListener("keyup", onKeyPress); }); + const onClickPayments = () => { + const paymentPageUrl = combineUrl( + "/portal-settings", + "/payments/portal-payments", + ); + + toastr.clear(); + + window.DocSpace.navigate(paymentPageUrl); + + setInvitePanelOptions({ + visible: false, + hideSelector: false, + defaultAccess: 1, + }); + }; const onClickSend = async (e) => { const invitations = inviteItems.map((item) => { let newItem = {}; @@ -289,7 +312,40 @@ const InvitePanel = ({ updateInfoPanelMembers(t); } } catch (err) { - toastr.error(err); + let error = err; + + if (err?.response?.status === 402) { + error = ( + <> + + {t("Common:PaidUsersExceedsLimit", { + count: maxCountManagersByQuota + invitePaidUsersCount, + limit: maxCountManagersByQuota, + })} + +   + {!isRoomAdmin && ( + + ), + }} + /> + )} + + ); + } + + toastr.error(error); setIsLoading(false); } finally { if (roomId === -1) { @@ -462,6 +518,8 @@ export default inject( filesStore, dialogsStore, infoPanelStore, + authStore, + currentQuotaStore, }) => { const { theme, currentDeviceType } = settingsStore; @@ -480,11 +538,16 @@ export default inject( setInviteItems, setInvitePanelOptions, setInviteLanguage, + invitePaidUsersCount, } = dialogsStore; const { getFolderInfo, setRoomSecurity, getRoomSecurityInfo, folders } = filesStore; + const { isRoomAdmin } = authStore; + + const { maxCountManagersByQuota } = currentQuotaStore; + return { folders, setInviteLanguage, @@ -506,6 +569,9 @@ export default inject( getUsersList, filter, currentDeviceType, + isRoomAdmin, + maxCountManagersByQuota, + invitePaidUsersCount, }; }, )( diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js b/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js index b810807b06..8fa310419f 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js @@ -93,7 +93,8 @@ const InviteInput = ({ i18n, setCultureKey, standalone, - isPaidUserLimit, + isPaidUserAccess, + setInvitePaidUsersCount, }) => { const isPublicRoomType = roomType === RoomsType.PublicRoom; @@ -136,6 +137,8 @@ const InviteInput = ({ if (addresses.length > 1) { return addresses.map((address) => { + isPaidUserAccess(selectedAccess) && setInvitePaidUsersCount(); + return { email: address.email, id: uid(), @@ -147,6 +150,8 @@ const InviteInput = ({ }); } + isPaidUserAccess(selectedAccess) && setInvitePaidUsersCount(); + return { email: addresses[0].email, id: uid(), @@ -591,10 +596,11 @@ export default inject( inviteItems, setInviteLanguage, culture, + setInvitePaidUsersCount, + isPaidUserAccess, } = dialogsStore; const { culture: language, standalone } = settingsStore; - const { isPaidUserLimit } = currentQuotaStore; return { language, @@ -607,7 +613,8 @@ export default inject( defaultAccess: invitePanelOptions.defaultAccess, isOwner, standalone, - isPaidUserLimit, + isPaidUserAccess, + setInvitePaidUsersCount, }; }, )( diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/Item.js b/packages/client/src/components/panels/InvitePanel/sub-components/Item.js index 1bccecb7b6..4a27bf2003 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/Item.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/Item.js @@ -27,14 +27,16 @@ import InfoEditReactSvgUrl from "PUBLIC_DIR/images/info.edit.react.svg?url"; import AtReactSvgUrl from "PUBLIC_DIR/images/@.react.svg?url"; import AlertSvgUrl from "PUBLIC_DIR/images/icons/12/alert.react.svg?url"; + import React, { useState, useEffect } from "react"; +import { inject, observer } from "mobx-react"; + import { Avatar } from "@docspace/shared/components/avatar"; import { Text } from "@docspace/shared/components/text"; - import { parseAddresses } from "@docspace/shared/utils"; -import { getAccessOptions } from "../utils"; import { getUserTypeLabel } from "@docspace/shared/utils/common"; +import { getAccessOptions } from "../utils"; import { StyledEditInput, StyledEditButton, @@ -61,6 +63,8 @@ const Item = ({ setIsOpenItemAccess, isMobileView, standalone, + isPaidUserAccess, + setInvitePaidUsersCount, }) => { const { avatar, @@ -162,7 +166,9 @@ const Item = ({ const errors = !!parseErrors.length ? parseErrors : []; setParseErrors(errors); - changeInviteItem({ id, email: value, errors }).then(() => errorsInList()); + changeInviteItem({ id, email: value, errors, access }).then(() => + errorsInList(), + ); }; const changeValue = (e) => { @@ -176,6 +182,8 @@ const Item = ({ const removeItem = () => { const newItems = inviteItems.filter((item) => item.id !== id); + if (isPaidUserAccess(item.access)) setInvitePaidUsersCount(-1); + setInviteItems(newItems); }; @@ -279,4 +287,11 @@ const Item = ({ ); }; -export default Item; +export default inject(({ dialogsStore }) => { + const { isPaidUserAccess, setInvitePaidUsersCount } = dialogsStore; + + return { + isPaidUserAccess, + setInvitePaidUsersCount, + }; +})(observer(Item)); diff --git a/packages/client/src/store/DialogsStore.js b/packages/client/src/store/DialogsStore.js index a642cfe6a8..26526d1971 100644 --- a/packages/client/src/store/DialogsStore.js +++ b/packages/client/src/store/DialogsStore.js @@ -26,6 +26,7 @@ import { getNewFiles } from "@docspace/shared/api/files"; import { + EmployeeType, FilesSelectorFilterTypes, FilterType, ShareAccessRights, @@ -128,6 +129,8 @@ class DialogsStore { file: null, }; + invitePaidUsersCount = 0; + constructor( authStore, treeFoldersStore, @@ -433,10 +436,34 @@ class DialogsStore { this.inviteItems = inviteItems; }; + setInvitePaidUsersCount = (modifier = 1) => { + this.invitePaidUsersCount = this.invitePaidUsersCount + modifier; + }; + + isPaidUserAccess = (selectedAccess) => { + return ( + selectedAccess === EmployeeType.Admin || + selectedAccess === EmployeeType.Collaborator || + selectedAccess === EmployeeType.User + ); + }; + changeInviteItem = async (item) => runInAction(() => { const index = this.inviteItems.findIndex((iItem) => iItem.id === item.id); + const isPrevAccessPaid = this.isPaidUserAccess( + this.inviteItems[index].access, + ); + const isCurrAccessPaid = this.isPaidUserAccess(item.access); + + let modifier = 0; + + if (isPrevAccessPaid && !isCurrAccessPaid) modifier = -1; + if (!isPrevAccessPaid && isCurrAccessPaid) modifier = 1; + + this.setInvitePaidUsersCount(modifier); + this.inviteItems[index] = { ...this.inviteItems[index], ...item }; }); diff --git a/public/locales/en/Common.json b/public/locales/en/Common.json index 61acc3af18..21442aee9c 100644 --- a/public/locales/en/Common.json +++ b/public/locales/en/Common.json @@ -38,6 +38,7 @@ "Bytes": "bytes", "CancelButton": "Cancel", "ChangeButton": "Change", + "ChangeUserPermissions": "Change user permissions to the invited people or <1>upgrade your tariff plan.", "ChangeQuota": "Change quota", "ChangesSavedSuccessfully": "Changes saved successfully", "ChooseFromTemplates": "Choose from Templates", @@ -320,6 +321,7 @@ "Owner": "Owner", "PageOfTotalPage": "{{page}} of {{totalPage}}", "Paid": "Paid", + "PaidUsersExceedsLimit": "The number of admins/power users exceeds the limit: {{count}} / {{limit}}.", "Password": "Password", "PasswordLimitDigits": "digits", "PasswordLimitMessage": "Password must contain", From 6ed95a643b6f98f9a7b98c7c1b4226281056d1b3 Mon Sep 17 00:00:00 2001 From: Vlada Gazizova <94864088+gazizova-vlada@users.noreply.github.com> Date: Fri, 9 Aug 2024 13:21:09 +0300 Subject: [PATCH 015/140] Shared:ContextMenu:Fixed the scroll area in mobile view when the context menu cannot open to full height. --- .../context-menu/ContextMenu.styled.ts | 4 ---- .../components/context-menu/ContextMenu.tsx | 2 ++ .../context-menu/sub-components/SubMenu.tsx | 24 +++++++++++++++---- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/packages/shared/components/context-menu/ContextMenu.styled.ts b/packages/shared/components/context-menu/ContextMenu.styled.ts index 66396014f4..13e0b61fb4 100644 --- a/packages/shared/components/context-menu/ContextMenu.styled.ts +++ b/packages/shared/components/context-menu/ContextMenu.styled.ts @@ -102,10 +102,6 @@ const StyledContextMenu = styled.div<{ ${(props) => props.changeView && styledMobileView} } - @media ${mobile} { - ${(props) => props.changeView && styledMobileView} - } - .scroll-body { display: flex; flex-direction: column; diff --git a/packages/shared/components/context-menu/ContextMenu.tsx b/packages/shared/components/context-menu/ContextMenu.tsx index 4692a8d93d..c5b7b667db 100644 --- a/packages/shared/components/context-menu/ContextMenu.tsx +++ b/packages/shared/components/context-menu/ContextMenu.tsx @@ -550,6 +550,8 @@ const ContextMenu = React.forwardRef( resetMenu={resetMenu} onLeafClick={onLeafClick} onMobileItemClick={onMobileItemClick} + changeView={changeView} + withHeader={withHeader} /> )} diff --git a/packages/shared/components/context-menu/sub-components/SubMenu.tsx b/packages/shared/components/context-menu/sub-components/SubMenu.tsx index bd87d213f6..fcbbbe005c 100644 --- a/packages/shared/components/context-menu/sub-components/SubMenu.tsx +++ b/packages/shared/components/context-menu/sub-components/SubMenu.tsx @@ -64,8 +64,18 @@ const SubMenu = (props: { loadFunc?: () => Promise, ) => void; onLoad?: () => Promise; + changeView?: boolean; + withHeader?: boolean; }) => { - const { onLeafClick, root, resetMenu, onMobileItemClick, onLoad } = props; + const { + onLeafClick, + root, + resetMenu, + onMobileItemClick, + onLoad, + changeView, + withHeader, + } = props; const [model, setModel] = useState(props?.model); const [isLoading, setIsLoading] = useState(false); @@ -519,11 +529,17 @@ const SubMenu = (props: { const viewport = DomHelpers.getViewport(); const paddingList = 12; const marginsList = 32; + const backdrop = 64; + const header = 55; const listHeight = - height + paddingList + marginsList > viewport.height - ? viewport.height - marginsList - : height + paddingList; + changeView && withHeader + ? height + paddingList + header > viewport.height + ? viewport.height - backdrop - header - paddingList + : height + paddingList + : height + paddingList + marginsList > viewport.height + ? viewport.height - marginsList + : height + paddingList; if (model) { return ( From 7819b4ac39d03ba49b44c4547360a2a5f900bf66 Mon Sep 17 00:00:00 2001 From: Vlada Gazizova <94864088+gazizova-vlada@users.noreply.github.com> Date: Fri, 9 Aug 2024 13:23:41 +0300 Subject: [PATCH 016/140] Shared:Themes:Unnecessary code removed. --- packages/shared/themes/base.ts | 1 - packages/shared/themes/dark.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/shared/themes/base.ts b/packages/shared/themes/base.ts index a548bbb277..1d7b5f2efa 100644 --- a/packages/shared/themes/base.ts +++ b/packages/shared/themes/base.ts @@ -2551,7 +2551,6 @@ export const getBaseTheme = () => { borderRadius: "6px", mobileBorderRadius: "6px 6px 0 0", boxShadow: `0px 8px 16px 0px ${boxShadowColor}`, - padding: "6px 0px", border: "none", devices: { maxHeight: "calc(100vh - 64px)", diff --git a/packages/shared/themes/dark.ts b/packages/shared/themes/dark.ts index 6011c1195d..6a3306012c 100644 --- a/packages/shared/themes/dark.ts +++ b/packages/shared/themes/dark.ts @@ -2536,7 +2536,6 @@ const Dark: TTheme = { borderRadius: "6px", mobileBorderRadius: "6px 6px 0 0", boxShadow: `0px 8px 16px 0px ${boxShadowDarkColor}`, - padding: "6px 0px", border: `1px solid ${grayDarkStrong}`, devices: { maxHeight: "calc(100vh - 64px)", From 18e70b4d73fa418801660abeb082932085e789f0 Mon Sep 17 00:00:00 2001 From: Vlada Gazizova <94864088+gazizova-vlada@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:08:53 +0300 Subject: [PATCH 017/140] Shared:ContextMenu:Fixed page crash when clicking on a table without a context menu button in the profile and importing data. --- .../context-menu/sub-components/SubMenu.tsx | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/packages/shared/components/context-menu/sub-components/SubMenu.tsx b/packages/shared/components/context-menu/sub-components/SubMenu.tsx index fcbbbe005c..4a7f8d244d 100644 --- a/packages/shared/components/context-menu/sub-components/SubMenu.tsx +++ b/packages/shared/components/context-menu/sub-components/SubMenu.tsx @@ -516,32 +516,32 @@ const SubMenu = (props: { const active = isActive(); const submenuLower = renderSubMenuLower(); - const newModel = model.filter( - (item: ContextMenuModel) => item && !item.disabled, - ); - const rowHeights: number[] = newModel.map((item: ContextMenuModel) => { - if (!item) return 0; - if (item.isSeparator) return 13; - return 36; - }); + if (model.length) { + const newModel = model.filter( + (item: ContextMenuModel) => item && !item.disabled, + ); + const rowHeights: number[] = newModel.map((item: ContextMenuModel) => { + if (!item) return 0; + if (item.isSeparator) return 13; + return 36; + }); - const height = rowHeights.reduce((a, b) => a + b); - const viewport = DomHelpers.getViewport(); - const paddingList = 12; - const marginsList = 32; - const backdrop = 64; - const header = 55; + const height = rowHeights.reduce((a, b) => a + b); + const viewport = DomHelpers.getViewport(); + const paddingList = 12; + const marginsList = 32; + const backdrop = 64; + const header = 55; - const listHeight = - changeView && withHeader - ? height + paddingList + header > viewport.height - ? viewport.height - backdrop - header - paddingList - : height + paddingList - : height + paddingList + marginsList > viewport.height - ? viewport.height - marginsList - : height + paddingList; + const listHeight = + changeView && withHeader + ? height + paddingList + header > viewport.height + ? viewport.height - backdrop - header - paddingList + : height + paddingList + : height + paddingList + marginsList > viewport.height + ? viewport.height - marginsList + : height + paddingList; - if (model) { return ( Date: Mon, 12 Aug 2024 13:11:08 +0300 Subject: [PATCH 018/140] Shared:ContextMenu:Fixed incorrect styles in mobile view when resizing the window on desktop. --- .../context-menu/ContextMenu.styled.ts | 40 +++++-------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/packages/shared/components/context-menu/ContextMenu.styled.ts b/packages/shared/components/context-menu/ContextMenu.styled.ts index 13e0b61fb4..b8b42e63cd 100644 --- a/packages/shared/components/context-menu/ContextMenu.styled.ts +++ b/packages/shared/components/context-menu/ContextMenu.styled.ts @@ -26,21 +26,7 @@ import styled, { css } from "styled-components"; import { Base, TTheme, globalColors } from "../../themes"; -import { mobile, isMobile, getCorrectFourValuesStyle } from "../../utils"; - -const styledTabletView = css<{ articleWidth: number }>` - position: fixed; - width: ${(props) => props.theme.newContextMenu.devices.tabletWidth}; - max-width: ${(props) => props.theme.newContextMenu.devices.tabletWidth}; - max-height: ${(props) => props.theme.newContextMenu.devices.maxHeight}; - inset-inline-start: ${(props) => - props.articleWidth - ? `${props.articleWidth}px` - : props.theme.newContextMenu.devices.left}; - inset-inline-end: ${(props) => props.theme.newContextMenu.devices.right}; - bottom: ${(props) => props.theme.newContextMenu.devices.bottom}; - margin: ${(props) => props.theme.newContextMenu.devices.margin}; -`; +import { mobile, getCorrectFourValuesStyle } from "../../utils"; const styledMobileView = css` position: fixed; @@ -98,10 +84,6 @@ const StyledContextMenu = styled.div<{ -moz-box-shadow: ${(props) => props.theme.newContextMenu.boxShadow}; -webkit-box-shadow: ${(props) => props.theme.newContextMenu.boxShadow}; - @media ${mobile} { - ${(props) => props.changeView && styledMobileView} - } - .scroll-body { display: flex; flex-direction: column; @@ -109,11 +91,6 @@ const StyledContextMenu = styled.div<{ padding-inline-end: 0 !important; } - - ${!isMobile() && - css` - max-width: calc(100vw - 32px); - `} } .contextmenu-header { @@ -201,11 +178,6 @@ const StyledContextMenu = styled.div<{ margin: 0; padding: 0; list-style: none; - - ${!isMobile() && - css` - max-width: calc(100vw - 32px); - `} } .p-contextmenu .p-submenu-list { @@ -377,6 +349,16 @@ const StyledContextMenu = styled.div<{ opacity: 1; transition: opacity 250ms; } + + .p-contextmenu { + @media ${mobile} { + ${(props) => props.changeView && styledMobileView} + } + + @media not ${mobile} { + max-width: calc(100vw - 32px); + } + } `; StyledContextMenu.defaultProps = { From ba12aa8b900b71253582e67709b38b658086c772 Mon Sep 17 00:00:00 2001 From: Vlada Gazizova <94864088+gazizova-vlada@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:48:27 +0300 Subject: [PATCH 019/140] Shared:ContextMenu:Fix styles. --- .../shared/components/context-menu/ContextMenu.styled.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/shared/components/context-menu/ContextMenu.styled.ts b/packages/shared/components/context-menu/ContextMenu.styled.ts index b8b42e63cd..5602a67976 100644 --- a/packages/shared/components/context-menu/ContextMenu.styled.ts +++ b/packages/shared/components/context-menu/ContextMenu.styled.ts @@ -359,6 +359,12 @@ const StyledContextMenu = styled.div<{ max-width: calc(100vw - 32px); } } + + .p-contextmenu ul { + @media not ${mobile} { + max-width: calc(100vw - 32px); + } + } `; StyledContextMenu.defaultProps = { From b61a43941997c663f94fcb08fdfd413b37e15572 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Mon, 12 Aug 2024 14:03:03 +0300 Subject: [PATCH 020/140] Client: InvitePanel: Added a restriction on changing the role if the quota for adding paid users has been exceeded. --- .../components/panels/InvitePanel/sub-components/Item.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/Item.js b/packages/client/src/components/panels/InvitePanel/sub-components/Item.js index 4a27bf2003..527d332e9a 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/Item.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/Item.js @@ -49,6 +49,8 @@ import { import { filterGroupRoleOptions, filterUserRoleOptions } from "SRC_DIR/helpers"; import AccessSelector from "../../../AccessSelector"; +import PaidQuotaLimitError from "SRC_DIR/components/PaidQuotaLimitError"; + const Item = ({ t, item, @@ -65,6 +67,7 @@ const Item = ({ standalone, isPaidUserAccess, setInvitePaidUsersCount, + isPaidUserLimit, }) => { const { avatar, @@ -256,6 +259,8 @@ const Item = ({ setIsOpenItemAccess={setIsOpenItemAccess} isMobileView={isMobileView} noBorder + isSelectionDisabled={isPaidUserLimit} + selectionErrorText={} /> )} @@ -287,11 +292,13 @@ const Item = ({ ); }; -export default inject(({ dialogsStore }) => { +export default inject(({ dialogsStore, currentQuotaStore }) => { const { isPaidUserAccess, setInvitePaidUsersCount } = dialogsStore; + const { isPaidUserLimit } = currentQuotaStore; return { isPaidUserAccess, setInvitePaidUsersCount, + isPaidUserLimit, }; })(observer(Item)); From 250f7f4c2333409b4c404fcb21d200a0fb4142e7 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Mon, 12 Aug 2024 14:21:04 +0300 Subject: [PATCH 021/140] Client: Added recalculation if the added user already exists. --- .../InvitePanel/sub-components/InviteInput.js | 17 ++++++++++++----- packages/client/src/store/DialogsStore.js | 3 ++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js b/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js index 8fa310419f..4aa4fa0237 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js @@ -95,6 +95,7 @@ const InviteInput = ({ standalone, isPaidUserAccess, setInvitePaidUsersCount, + isPaidUserLimit, }) => { const isPublicRoomType = roomType === RoomsType.PublicRoom; @@ -226,10 +227,15 @@ const InviteInput = ({ }; const removeExist = (items) => { - const filtered = items.reduce((unique, o) => { - !unique.some((obj) => - obj.isGroup ? obj.id === o.id : obj.email === o.email, - ) && unique.push(o); + const filtered = items.reduce((unique, current) => { + const isUnique = !unique.some((obj) => + obj.isGroup ? obj.id === current.id : obj.email === current.email, + ); + + if (!isUnique && isPaidUserAccess(current.access)) + setInvitePaidUsersCount(-1); + + isUnique && unique.push(current); return unique; }, []); @@ -601,7 +607,7 @@ export default inject( } = dialogsStore; const { culture: language, standalone } = settingsStore; - + const { isPaidUserLimit } = currentQuotaStore; return { language, setInviteLanguage, @@ -615,6 +621,7 @@ export default inject( standalone, isPaidUserAccess, setInvitePaidUsersCount, + isPaidUserLimit, }; }, )( diff --git a/packages/client/src/store/DialogsStore.js b/packages/client/src/store/DialogsStore.js index 26526d1971..46c966ae97 100644 --- a/packages/client/src/store/DialogsStore.js +++ b/packages/client/src/store/DialogsStore.js @@ -438,6 +438,7 @@ class DialogsStore { setInvitePaidUsersCount = (modifier = 1) => { this.invitePaidUsersCount = this.invitePaidUsersCount + modifier; + if (this.invitePaidUsersCount === -1) this.invitePaidUsersCount = 0; }; isPaidUserAccess = (selectedAccess) => { @@ -458,7 +459,7 @@ class DialogsStore { const isCurrAccessPaid = this.isPaidUserAccess(item.access); let modifier = 0; - + if (isPrevAccessPaid && !isCurrAccessPaid) modifier = -1; if (!isPrevAccessPaid && isCurrAccessPaid) modifier = 1; From 14ae9e1a48707aefbc2db4441fd7075f8ff5724e Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Mon, 12 Aug 2024 15:24:23 +0300 Subject: [PATCH 022/140] Client: Added the ability to transfer available rights. --- packages/client/src/components/AccessSelector/index.tsx | 4 ++++ .../components/panels/InvitePanel/sub-components/Item.js | 2 ++ .../components/access-right-select/AccessRightSelect.tsx | 7 ++++++- .../access-right-select/AccessRightSelect.types.ts | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/AccessSelector/index.tsx b/packages/client/src/components/AccessSelector/index.tsx index 932b4e0a90..2a12f0251c 100644 --- a/packages/client/src/components/AccessSelector/index.tsx +++ b/packages/client/src/components/AccessSelector/index.tsx @@ -54,6 +54,7 @@ interface AccessSelectorProps { directionY?: string; isSelectionDisabled?: boolean; selectionErrorText: React.ReactNode; + availableAccess?: number; } const AccessSelector: React.FC = ({ @@ -76,6 +77,7 @@ const AccessSelector: React.FC = ({ directionY = "bottom", isSelectionDisabled, selectionErrorText, + availableAccess, }) => { const [horizontalOrientation, setHorizontalOrientation] = useState(false); const [width, setWidth] = useState(manualWidth || 0); @@ -139,6 +141,7 @@ const AccessSelector: React.FC = ({ isDisabled={isDisabled} isSelectionDisabled={isSelectionDisabled} selectionErrorText={selectionErrorText} + availableAccess={availableAccess} /> )} @@ -163,6 +166,7 @@ const AccessSelector: React.FC = ({ isDisabled={isDisabled} isSelectionDisabled={isSelectionDisabled} selectionErrorText={selectionErrorText} + availableAccess={availableAccess} /> )} diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/Item.js b/packages/client/src/components/panels/InvitePanel/sub-components/Item.js index 527d332e9a..101621c593 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/Item.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/Item.js @@ -50,6 +50,7 @@ import { filterGroupRoleOptions, filterUserRoleOptions } from "SRC_DIR/helpers"; import AccessSelector from "../../../AccessSelector"; import PaidQuotaLimitError from "SRC_DIR/components/PaidQuotaLimitError"; +import { EmployeeType } from "@docspace/shared/enums"; const Item = ({ t, @@ -261,6 +262,7 @@ const Item = ({ noBorder isSelectionDisabled={isPaidUserLimit} selectionErrorText={} + availableAccess={EmployeeType.Guest} /> )} diff --git a/packages/shared/components/access-right-select/AccessRightSelect.tsx b/packages/shared/components/access-right-select/AccessRightSelect.tsx index 71984a6d3d..5a95e3aa5b 100644 --- a/packages/shared/components/access-right-select/AccessRightSelect.tsx +++ b/packages/shared/components/access-right-select/AccessRightSelect.tsx @@ -49,6 +49,7 @@ export const AccessRightSelectPure = ({ className, isSelectionDisabled, selectionErrorText, + availableAccess, ...props }: AccessRightSelectProps) => { const [currentItem, setCurrentItem] = useState(selectedOption); @@ -62,7 +63,11 @@ export const AccessRightSelectPure = ({ if (option) { if (!isSelectionDisabled) setCurrentItem(option); - if (isSelectionDisabled && option.access !== selectedOption.access) { + const isError = availableAccess + ? availableAccess !== option.access + : option.access !== selectedOption.access; + + if (isSelectionDisabled && isError) { toastr.error(selectionErrorText); return; } diff --git a/packages/shared/components/access-right-select/AccessRightSelect.types.ts b/packages/shared/components/access-right-select/AccessRightSelect.types.ts index 1d14224eb9..9d89be91b2 100644 --- a/packages/shared/components/access-right-select/AccessRightSelect.types.ts +++ b/packages/shared/components/access-right-select/AccessRightSelect.types.ts @@ -51,4 +51,5 @@ export type AccessRightSelectProps = PropsFromCombobox & { accessOptions: ComboboxProps["options"]; isSelectionDisabled?: boolean; selectionErrorText?: React.ReactNode; + availableAccess?: number; }; From 582912b3591c7a557184e717337558ca2ad1c6fe Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Mon, 12 Aug 2024 16:10:57 +0300 Subject: [PATCH 023/140] Client/Shared: Fixed option selection. --- .../src/components/AccessSelector/index.tsx | 2 +- .../access-right-select/AccessRightSelect.tsx | 18 +++++++++++------- .../AccessRightSelect.types.ts | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/client/src/components/AccessSelector/index.tsx b/packages/client/src/components/AccessSelector/index.tsx index 2a12f0251c..0f246fa0cb 100644 --- a/packages/client/src/components/AccessSelector/index.tsx +++ b/packages/client/src/components/AccessSelector/index.tsx @@ -54,7 +54,7 @@ interface AccessSelectorProps { directionY?: string; isSelectionDisabled?: boolean; selectionErrorText: React.ReactNode; - availableAccess?: number; + availableAccess?: number[]; } const AccessSelector: React.FC = ({ diff --git a/packages/shared/components/access-right-select/AccessRightSelect.tsx b/packages/shared/components/access-right-select/AccessRightSelect.tsx index 5a95e3aa5b..258c5ed718 100644 --- a/packages/shared/components/access-right-select/AccessRightSelect.tsx +++ b/packages/shared/components/access-right-select/AccessRightSelect.tsx @@ -61,17 +61,21 @@ export const AccessRightSelectPure = ({ const onSelectCurrentItem = useCallback( (option: TOption) => { if (option) { - if (!isSelectionDisabled) setCurrentItem(option); + if (isSelectionDisabled) { + let isError = + option.access && option.access !== selectedOption.access; - const isError = availableAccess - ? availableAccess !== option.access - : option.access !== selectedOption.access; + if (availableAccess && option.access) { + isError = availableAccess.every((item) => item !== option.access); + } - if (isSelectionDisabled && isError) { - toastr.error(selectionErrorText); - return; + if (isError) { + toastr.error(selectionErrorText); + return; + } } + setCurrentItem(option); onSelect?.(option); } }, diff --git a/packages/shared/components/access-right-select/AccessRightSelect.types.ts b/packages/shared/components/access-right-select/AccessRightSelect.types.ts index 9d89be91b2..30c17f9026 100644 --- a/packages/shared/components/access-right-select/AccessRightSelect.types.ts +++ b/packages/shared/components/access-right-select/AccessRightSelect.types.ts @@ -51,5 +51,5 @@ export type AccessRightSelectProps = PropsFromCombobox & { accessOptions: ComboboxProps["options"]; isSelectionDisabled?: boolean; selectionErrorText?: React.ReactNode; - availableAccess?: number; + availableAccess?: number[]; }; From d105d31c36befac23bcf21bb7fa4d7b6d91a1749 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Mon, 12 Aug 2024 16:12:07 +0300 Subject: [PATCH 024/140] Client: Added an exception for the accounts section. --- .../InvitePanel/sub-components/InviteInput.js | 6 ++++-- .../panels/InvitePanel/sub-components/Item.js | 13 +++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js b/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js index 4aa4fa0237..07e3bd7b64 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js @@ -564,8 +564,10 @@ const InviteInput = ({ containerRef={inputsRef} isOwner={isOwner} isMobileView={isMobileView} - isSelectionDisabled={isPaidUserLimit} - selectionErrorText={} + {...(roomId === -1 && { + isSelectionDisabled: isPaidUserLimit, + selectionErrorText: , + })} /> {!hideSelector && addUsersPanelVisible && ( diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/Item.js b/packages/client/src/components/panels/InvitePanel/sub-components/Item.js index 101621c593..24c432ed73 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/Item.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/Item.js @@ -69,6 +69,7 @@ const Item = ({ isPaidUserAccess, setInvitePaidUsersCount, isPaidUserLimit, + roomId, }) => { const { avatar, @@ -260,9 +261,11 @@ const Item = ({ setIsOpenItemAccess={setIsOpenItemAccess} isMobileView={isMobileView} noBorder - isSelectionDisabled={isPaidUserLimit} - selectionErrorText={} - availableAccess={EmployeeType.Guest} + {...(roomId === -1 && { + isSelectionDisabled: isPaidUserLimit, + selectionErrorText: , + availableAccess: [EmployeeType.Guest], + })} /> )} @@ -295,12 +298,14 @@ const Item = ({ }; export default inject(({ dialogsStore, currentQuotaStore }) => { - const { isPaidUserAccess, setInvitePaidUsersCount } = dialogsStore; + const { isPaidUserAccess, setInvitePaidUsersCount, invitePanelOptions } = + dialogsStore; const { isPaidUserLimit } = currentQuotaStore; return { isPaidUserAccess, setInvitePaidUsersCount, isPaidUserLimit, + roomId: invitePanelOptions.roomId, }; })(observer(Item)); From a8412a22ca38a9aa9e4c9620a2ffedef0ae5e368 Mon Sep 17 00:00:00 2001 From: Vlada Gazizova <94864088+gazizova-vlada@users.noreply.github.com> Date: Mon, 12 Aug 2024 18:11:37 +0300 Subject: [PATCH 025/140] Shared:ContextMenu:Fixed increasing the width of the second level menu on hover in a tight theme. --- .../shared/components/context-menu/sub-components/SubMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared/components/context-menu/sub-components/SubMenu.tsx b/packages/shared/components/context-menu/sub-components/SubMenu.tsx index 4a7f8d244d..fdfc1d3b3a 100644 --- a/packages/shared/components/context-menu/sub-components/SubMenu.tsx +++ b/packages/shared/components/context-menu/sub-components/SubMenu.tsx @@ -158,7 +158,7 @@ const SubMenu = (props: { const widthMaxContent = Math.max(...optionsWidth); if (root) subListWidth = subListWidth || widthMaxContent; - else subListWidth = Math.max(subListWidth, widthMaxContent); + else subListWidth = widthMaxContent; } if (subMenuRef.current) { From 29a295f897db426aab5a33832506cdf3895117b3 Mon Sep 17 00:00:00 2001 From: Timofey Boyko Date: Tue, 13 Aug 2024 10:47:29 +0300 Subject: [PATCH 026/140] Client:Pages:OAuth2: fix header --- .../src/pages/PortalSettings/Layout/index.js | 2 +- .../OAuth/OAuthSectionHeader/index.tsx | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/client/src/pages/PortalSettings/Layout/index.js b/packages/client/src/pages/PortalSettings/Layout/index.js index eb188a7ed7..0c4019b59c 100644 --- a/packages/client/src/pages/PortalSettings/Layout/index.js +++ b/packages/client/src/pages/PortalSettings/Layout/index.js @@ -112,7 +112,7 @@ const Layout = ({ ) : currentPath === oauthCreatePath || currentPath === oauthEditPath ? ( - + ) : ( )} diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/OAuthSectionHeader/index.tsx b/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/OAuthSectionHeader/index.tsx index e6ff21e183..a1fa9dafd8 100644 --- a/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/OAuthSectionHeader/index.tsx +++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/OAuthSectionHeader/index.tsx @@ -28,17 +28,15 @@ const OAuthSectionHeader = ({ isEdit }: { isEdit: boolean }) => {
-
- + - {isEdit ? t("EditApp") : t("NewApp")} -
+ {isEdit ? t("EditApp") : t("NewApp")}
From eac9a93a2dc090e9604205f0d1057bbff1c998ce Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Tue, 13 Aug 2024 11:03:32 +0300 Subject: [PATCH 027/140] Client: Changed translation for user tariff limit. --- packages/client/public/locales/ar-SA/MainBar.json | 1 - packages/client/public/locales/az/MainBar.json | 1 - packages/client/public/locales/bg/MainBar.json | 1 - packages/client/public/locales/cs/MainBar.json | 1 - packages/client/public/locales/de/MainBar.json | 1 - packages/client/public/locales/el-GR/MainBar.json | 1 - packages/client/public/locales/en/MainBar.json | 3 ++- packages/client/public/locales/es/MainBar.json | 1 - packages/client/public/locales/fi/MainBar.json | 1 - packages/client/public/locales/fr/MainBar.json | 1 - packages/client/public/locales/hy-AM/MainBar.json | 1 - packages/client/public/locales/it/MainBar.json | 1 - packages/client/public/locales/ja-JP/MainBar.json | 1 - packages/client/public/locales/ko-KR/MainBar.json | 1 - packages/client/public/locales/lv/MainBar.json | 1 - packages/client/public/locales/nl/MainBar.json | 1 - packages/client/public/locales/pl/MainBar.json | 1 - packages/client/public/locales/pt-BR/MainBar.json | 1 - packages/client/public/locales/pt/MainBar.json | 1 - packages/client/public/locales/ro/MainBar.json | 1 - packages/client/public/locales/ru/MainBar.json | 1 - packages/client/public/locales/si/MainBar.json | 1 - packages/client/public/locales/sk/MainBar.json | 1 - packages/client/public/locales/sl/MainBar.json | 1 - packages/client/public/locales/sr-Cyrl-RS/MainBar.json | 1 - packages/client/public/locales/sr-Latn-RS/MainBar.json | 1 - packages/client/public/locales/tr/MainBar.json | 1 - packages/client/public/locales/uk-UA/MainBar.json | 1 - packages/client/public/locales/vi/MainBar.json | 1 - packages/client/public/locales/zh-CN/MainBar.json | 1 - packages/client/src/components/MainBar/Bar.js | 10 ++++++++-- packages/client/src/components/MainBar/QuotasBar.js | 6 ++++-- 32 files changed, 14 insertions(+), 34 deletions(-) diff --git a/packages/client/public/locales/ar-SA/MainBar.json b/packages/client/public/locales/ar-SA/MainBar.json index 930faa48bf..32e5421c71 100644 --- a/packages/client/public/locales/ar-SA/MainBar.json +++ b/packages/client/public/locales/ar-SA/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "حجم مساحة التخزين على وشك أن يتم تجاوزها: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "يمكنك إزالة الملفات غير الضرورية لتحرير مساحة القرص.", "TenantCustomQuotaDescription": "يمكنك إزالة الملفات غير الضرورية أو تغيير الحصة النسبية في <1> إعدادات إدارة التخزين.", - "UserQuotaDescription": "<1>{{clickHere}} للعثور على خطة تسعير أفضل لـ {{productName}} الخاص بك.", "UserQuotaHeader": "عدد المشرفين المستخدمين المتميزين على وشك أن يتم تجاوزه: {{currentValue}} / {{maxValue}}" } diff --git a/packages/client/public/locales/az/MainBar.json b/packages/client/public/locales/az/MainBar.json index bb8c0523de..7512be97c8 100644 --- a/packages/client/public/locales/az/MainBar.json +++ b/packages/client/public/locales/az/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Yaddaş sahəsinin həcmi keçmək üzrədir : {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Diskdə yer boşaltmaq üçün lazımsız faylları silə bilərsiniz.", "TenantCustomQuotaDescription": "<1>Yaddaş idarəetmə parametrlərində lazımsız faylları silə və ya kvotanı dəyişə bilərsiniz.", - "UserQuotaDescription": "<1>{{clickHere}} məhsulunuz üçün daha yaxşı qiymət planı tapmaq üçün {{productName}}.", "UserQuotaHeader": "Admin/ekspert istifadəçilərin sayı keçmək üzrədir: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/bg/MainBar.json b/packages/client/public/locales/bg/MainBar.json index f2bee2f8a6..1edc75727e 100644 --- a/packages/client/public/locales/bg/MainBar.json +++ b/packages/client/public/locales/bg/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Размерът на пространството за съхранение е на път да бъде надвишен: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Можете да премахнете ненужните файлове, за да освободите дисково пространство.", "TenantCustomQuotaDescription": "Можете да премахнете ненужните файлове или да промените квотата от <1>Настройки за управление на хранилището.", - "UserQuotaDescription": "<1>{{clickHere}}, за да намерите по-добър абонаментен план за вашия {{productName}}.", "UserQuotaHeader": "На път сте да превишите броят на администраторите/опитните потребители: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/cs/MainBar.json b/packages/client/public/locales/cs/MainBar.json index d9a758fdd3..d8e240839f 100644 --- a/packages/client/public/locales/cs/MainBar.json +++ b/packages/client/public/locales/cs/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Množství úložného prostoru bude brzy překročeno: {{currentValue}} / {{maxValue}}.", "StorageQuotaUserDescription": "Nepotřebné soubory můžete odstranit a uvolnit tak místo na disku.", "TenantCustomQuotaDescription": "Nepotřebné soubory můžete odstranit nebo změnit kvótu v <1>Nastavení správy úložiště.", - "UserQuotaDescription": "<1>{{clickHere}} a najděte lepší cenový tarif pro svůj {{productName}}.", "UserQuotaHeader": "Počet administrátorů/přístupných uživatelů bude brzy překročen: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/de/MainBar.json b/packages/client/public/locales/de/MainBar.json index c7815382a0..ffe0b4bbbd 100644 --- a/packages/client/public/locales/de/MainBar.json +++ b/packages/client/public/locales/de/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Das Speicherplatzlimit wird bald überschritten: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Sie können die nicht benötigten Dateien entfernen, um Speicherplatz freizugeben.", "TenantCustomQuotaDescription": "Sie können unnötige Dateien entfernen oder die Quote in den <1>Speicherverwaltungseinstellungen ändern", - "UserQuotaDescription": "<1>{{clickHere}}, um einen besseren Preisplan für Ihr {{productName}} zu finden.", "UserQuotaHeader": "Die Anzahl der Admins/Power-User wird bald überschritten sein: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/el-GR/MainBar.json b/packages/client/public/locales/el-GR/MainBar.json index dfc0852561..7929aec0f6 100644 --- a/packages/client/public/locales/el-GR/MainBar.json +++ b/packages/client/public/locales/el-GR/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Το ποσό του χώρου αποθήκευσης πρόκειται να ξεπεραστεί: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Μπορείτε να αφαιρέσετε τα περιττά αρχεία για να ελευθερώσετε χώρο στον δίσκο.", "TenantCustomQuotaDescription": "Μπορείτε να αφαιρέσετε τα περιττά αρχεία ή να αλλάξετε την ποσόστωση στις <1>Ρυθμίσεις διαχείρισης αποθ. χώρου.", - "UserQuotaDescription": "Κάντε κλικ εδώ <1>{{clickHere}} για να βρείτε ένα καλύτερο πρόγραμμα τιμολόγησης για την {{productName}} σας.", "UserQuotaHeader": "Ο αριθμός των διαχειριστών/χρηστών ισχύος πρόκειται να ξεπεραστεί: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/en/MainBar.json b/packages/client/public/locales/en/MainBar.json index 8b4e267a9e..2627e7627d 100644 --- a/packages/client/public/locales/en/MainBar.json +++ b/packages/client/public/locales/en/MainBar.json @@ -14,6 +14,7 @@ "StorageQuotaHeader": "Storage space amount is about to be exceeded: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "You can remove the unnecessary files to free up disk space.", "TenantCustomQuotaDescription": "You can remove the unnecessary files or change quota in the <1>Storage management settings.", - "UserQuotaDescription": "<1>{{clickHere}} to find a better pricing plan for your {{productName}}.", + "UserTariffAlmostReachedForAdmins": "Once the limit is reached, all users will be added with user permissions only. To be able to add further admins/power users, <1>click here to upgrade your tariff plan.", + "UserTariffAlmostReached": "Once the limit is reached, all users will be added with user permissions only. To be able to add further admins/power users, contact the DocSpace administrator to upgrade the tariff plan.", "UserQuotaHeader": "The number of admins/power users is about to be exceeded: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/es/MainBar.json b/packages/client/public/locales/es/MainBar.json index 76df9a5987..fe918a6b54 100644 --- a/packages/client/public/locales/es/MainBar.json +++ b/packages/client/public/locales/es/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "La cantidad de espacio de almacenamiento está a punto de excederse: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Puede eliminar los archivos innecesarios para liberar espacio en disco.", "TenantCustomQuotaDescription": "Puede eliminar los archivos innecesarios o cambiar la cuota en la <1>Configuración de administración de almacenamiento.", - "UserQuotaDescription": "<1>{{clickHere}} para encontrar un mejor plan de precios para su {{productName}}.", "UserQuotaHeader": "El número de administradores/usuarios avanzados está a punto de excederse: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/fi/MainBar.json b/packages/client/public/locales/fi/MainBar.json index e078ac33e2..fca964ab01 100644 --- a/packages/client/public/locales/fi/MainBar.json +++ b/packages/client/public/locales/fi/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Tallennustilan määrä on ylittymässä: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Voit poistaa tarpeettomat tiedostot vapauttaaksesi levytilaa.", "TenantCustomQuotaDescription": "Voit poistaa tarpeettomat tiedostot tai muuttaa kiintiötä <1>Muistinhallinta-asetuksissa.", - "UserQuotaDescription": "<1>{{clickHere}} löytääksesi {{productName}}-llesi sopivamman hinnoitteluohjelman.", "UserQuotaHeader": "Ylläpitäjien/tehokäyttäjien määrän raja on ylittymässä: {{currentValue}} / {{maxValue}}" } diff --git a/packages/client/public/locales/fr/MainBar.json b/packages/client/public/locales/fr/MainBar.json index 77a980d913..35e58a087a 100644 --- a/packages/client/public/locales/fr/MainBar.json +++ b/packages/client/public/locales/fr/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "L’espace de stockage est sur le point d’être dépassé : {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Vous pouvez supprimer les fichiers inutiles pour libérer de l'espace disque.", "TenantCustomQuotaDescription": "Vous pouvez supprimer les fichiers inutiles ou modifier le quota dans la section <1>Paramètres de gestion du stockage.", - "UserQuotaDescription": "<1>{{clickHere}} pour trouver un meilleur plan tarifaire pour votre {{productName}}.", "UserQuotaHeader": "Le nombre d'administrateurs/utilisateurs avancés est sur le point d'être dépassé : {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/hy-AM/MainBar.json b/packages/client/public/locales/hy-AM/MainBar.json index 15841056b3..b123eac882 100644 --- a/packages/client/public/locales/hy-AM/MainBar.json +++ b/packages/client/public/locales/hy-AM/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Պահեստային տարածքի քանակը քիչ է մնում գերազանցվի՝ {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Դուք կարող եք հեռացնել ավելորդ ֆայլերը՝ սկավառակի տարածքը ազատելու համար:", "TenantCustomQuotaDescription": "Դուք կարող եք հեռացնել ավելորդ ֆայլերը կամ փոխել սահմանաչափը <1>Պահպանման կառավարման կարգավորումներ:", - "UserQuotaDescription": "<1>{{clickHere}} ձեր {{productName}}-ի համար ավելի լավ գնային փաթեթ գտնելու համար:", "UserQuotaHeader": "Ադմինիստրատորների/հզոր օգտատերերի թիվը պատրաստվում է գերազանցել՝ {{currentValue}} / {{maxValue}}:" } diff --git a/packages/client/public/locales/it/MainBar.json b/packages/client/public/locales/it/MainBar.json index d762e8f603..7c5078eaf6 100644 --- a/packages/client/public/locales/it/MainBar.json +++ b/packages/client/public/locales/it/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Lo spazio di archiviazione sta per essere esaurito: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Puoi rimuovere i file non necessari per liberare spazio sul disco.", "TenantCustomQuotaDescription": "Puoi rimuovere i file non necessari o modificare la quota nelle <1>mpostazioni di gestione dello spazio di archiviazione.", - "UserQuotaDescription": "<1>{{clickHere}} per trovare un piano tariffario migliore per il tuo {{productName}}.", "UserQuotaHeader": "Il numero di amministratori/utenti esperti sta per essere superato: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/ja-JP/MainBar.json b/packages/client/public/locales/ja-JP/MainBar.json index 31c39c3f5e..6822986538 100644 --- a/packages/client/public/locales/ja-JP/MainBar.json +++ b/packages/client/public/locales/ja-JP/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "ストレージのスペースは、もうすぐサイズ上限を超えます:{{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "不要なファイルを削除して、ディスク領域を確保できます。", "TenantCustomQuotaDescription": "不要ファイルを削除するか、<1>ストレージ管理設定で容量制限の変更ができます。", - "UserQuotaDescription": "お使いの{{productName}}に適した料金プランを選択するには、<1>{{clickHere}}。", "UserQuotaHeader": "管理者/パワーユーザー数を超えそうです:{{currentValue}} / {{maxValue}}" } diff --git a/packages/client/public/locales/ko-KR/MainBar.json b/packages/client/public/locales/ko-KR/MainBar.json index dfb25b21b9..05cda64776 100644 --- a/packages/client/public/locales/ko-KR/MainBar.json +++ b/packages/client/public/locales/ko-KR/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "저장 공간 용량이 곧 초과될 예정입니다: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "불필요한 파일을 제거하여 디스크 공간을 확보할 수 있습니다.", "TenantCustomQuotaDescription": "<1>스토리지 관리 설정에서 할당량을 변경하거나 불필요한 파일을 삭제하세요.", - "UserQuotaDescription": "<1>{{clickHere}}하여{{productName}}에 대한 더 나은 요금제를 찾으세요.", "UserQuotaHeader": "곧 관리자/고급 사용자 수 한도를 초과하게 됩니다: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/lv/MainBar.json b/packages/client/public/locales/lv/MainBar.json index 88d36f761f..d386088266 100644 --- a/packages/client/public/locales/lv/MainBar.json +++ b/packages/client/public/locales/lv/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Tūlīt tiks pārsniegts krātuves vietas apjoms: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Jūs varat noņemt nevajadzīgos failus, lai atbrīvotu vietu diskā.", "TenantCustomQuotaDescription": "Jūs varat noņemt nevajadzīgos failus vai mainīt kvotu <1>Krātuves pārvaldības iestatījumos.", - "UserQuotaDescription": "<1>{{clickHere}}, lai atrastu labāku cenu plānu savam {{productName}}.", "UserQuotaHeader": "Tūlīt tiks pārsniegts administratoru/prasmīgo lietotāju skaits:{{currentValue}}/{{maxValue}}." } diff --git a/packages/client/public/locales/nl/MainBar.json b/packages/client/public/locales/nl/MainBar.json index 242c8ec468..49f50b8f80 100644 --- a/packages/client/public/locales/nl/MainBar.json +++ b/packages/client/public/locales/nl/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "De hoeveelheid opslagruimte staat op het punt overschreden te worden: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "U kunt de onnodige bestanden verwijderen om schijfruimte vrij te maken.", "TenantCustomQuotaDescription": "U kunt de onnodige bestanden verwijderen of de quota wijzigen in de <1>Instellingen voor opslagbeheer.", - "UserQuotaDescription": "<1>{{clickHere}} om een beter prijsplan voor uw {{productName}} te vinden.", "UserQuotaHeader": "Het aantal beheerders/power users staan op het punt overschreden te worden: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/pl/MainBar.json b/packages/client/public/locales/pl/MainBar.json index fce55c18ac..243e5db445 100644 --- a/packages/client/public/locales/pl/MainBar.json +++ b/packages/client/public/locales/pl/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Ilość miejsca w pamięci zostanie wkrótce przekroczona: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Możesz usunąć niepotrzebne pliki, aby zwolnić miejsce na dysku.", "TenantCustomQuotaDescription": "Możesz usunąć niepotrzebne pliki lub zmienić limit w <1>ustawieniach zarządzania pamięcią.", - "UserQuotaDescription": "<1>{{clickHere}}, aby znaleźć lepszy plan cenowy dla swojego {{productName}}.", "UserQuotaHeader": "Liczba administratorów/użytkowników z większą liczbą uprawnień zostanie wkrótce przekroczona: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/pt-BR/MainBar.json b/packages/client/public/locales/pt-BR/MainBar.json index d06110117c..1b915a1ec7 100644 --- a/packages/client/public/locales/pt-BR/MainBar.json +++ b/packages/client/public/locales/pt-BR/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "A quantidade de espaço de armazenamento está prestes a ser excedida: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Você pode remover os arquivos desnecessários para liberar espaço em disco.", "TenantCustomQuotaDescription": "Você pode remover os arquivos desnecessários ou alterar a cota nas <1>Configurações de gerenciamento de armazenamento.", - "UserQuotaDescription": "<1>{{clickHere}} para encontrar um plano de preços melhor para o seu {{productName}}.", "UserQuotaHeader": "O número de administradores/usuários avançados está prestes a ser excedido: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/pt/MainBar.json b/packages/client/public/locales/pt/MainBar.json index 44c4273333..b558ffa79a 100644 --- a/packages/client/public/locales/pt/MainBar.json +++ b/packages/client/public/locales/pt/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "A capacidade de armazenamento do espaço está prestes a ser excedida: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Você pode remover os arquivos desnecessários para liberar espaço em disco.", "TenantCustomQuotaDescription": "Você pode remover os arquivos desnecessários ou alterar a cota nas <1>Configurações de gerenciamento de armazenamento.", - "UserQuotaDescription": "<1>{{clickHere}} para encontrar um plano de preços melhor para o seu {{productName}}.", "UserQuotaHeader": "O número de administradores/utilizadores com poder está prestes a ser excedido: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/ro/MainBar.json b/packages/client/public/locales/ro/MainBar.json index 6498868bac..bee73eb2fc 100644 --- a/packages/client/public/locales/ro/MainBar.json +++ b/packages/client/public/locales/ro/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Cota spaţiului de stocare este pe punctul de a fi depăşită: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Puteți elimina fișiere inutile pentru a elibera spațiu de stocare.", "TenantCustomQuotaDescription": "Puteţi elimina fişierele inutile sau modifica cotă de stocare din secțiunea <1>Setările de gestionare a spațiului de stocare..", - "UserQuotaDescription": "<1>{{clickHere}} pentru a găsi cea mai bună ofertă pentru spațiul dvs {{productName}}.", "UserQuotaHeader": "Numărul maxim de administratori/utilizatori avansați este pe punctul de a fi depăşit. {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/ru/MainBar.json b/packages/client/public/locales/ru/MainBar.json index 6b24b1c949..6c5291b103 100644 --- a/packages/client/public/locales/ru/MainBar.json +++ b/packages/client/public/locales/ru/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Объем дискового пространства скоро будет превышен: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Вы можете удалить ненужные файлы, чтобы освободить место на диске.", "TenantCustomQuotaDescription": "Удалить ненужные файлы или изменить квоту можно в <1>Настройках управления хранилищем.", - "UserQuotaDescription": "<1>{{clickHere}}, чтобы найти лучший тарифный план для {{productName}}.", "UserQuotaHeader": "Количество администраторов/опытных пользователей скоро будет превышено: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/si/MainBar.json b/packages/client/public/locales/si/MainBar.json index ca07b2a6b1..2a1ecce35a 100644 --- a/packages/client/public/locales/si/MainBar.json +++ b/packages/client/public/locales/si/MainBar.json @@ -13,6 +13,5 @@ "StorageQuotaExceeded": "ආචයන සලාකය ඉක්මවා ඇත", "StorageQuotaHeader": "ආචයනයේ ඉඩ ඉක්මවීමට ආසන්නයි: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "ඔබට <1>ආචයන කළමනාකරණ සැකසුම් මගින් අනවශ්‍ය ගොනු ඉවත් කිරීමට හෝ සලාකය වෙනස් කිරීමට හැකිය.", - "UserQuotaDescription": "ඔබගේ {{productName}} සඳහා වඩාත් සුදුසු මිලකරණ සැලසුමක් සොයා ගැනීමට <1>{{clickHere}}", "UserQuotaHeader": "පරිපාලකයින්/බලවත් පරිශ්‍රීලකයින් ගණන ඉක්මවීමට ආසන්නයි: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/sk/MainBar.json b/packages/client/public/locales/sk/MainBar.json index f8faa75d13..1e4537d6a0 100644 --- a/packages/client/public/locales/sk/MainBar.json +++ b/packages/client/public/locales/sk/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Veľkosť úložného priestoru bude čoskoro prekročená: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Nepotrebné súbory môžete odstrániť, aby ste uvoľnili miesto na disku.", "TenantCustomQuotaDescription": "Nepotrebné súbory môžete odstrániť alebo zmeniť kvótu v <1> Nastaveniach spravovania úložísk.", - "UserQuotaDescription": "<1>{{clickHere}} a nájdite najlepší cenový plán pre váš {{productName}}.", "UserQuotaHeader": "Maximálny počet administrátorov/pokročilých používateľov bude čoskoro prekročený: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/sl/MainBar.json b/packages/client/public/locales/sl/MainBar.json index 001bda017f..43af753205 100644 --- a/packages/client/public/locales/sl/MainBar.json +++ b/packages/client/public/locales/sl/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Dovoljen prostor za shranjevanje bo kmalu presežen: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Nepotrebne datoteke lahko odstraniš, da sprostiš prostor na disku.", "TenantCustomQuotaDescription": "Nepotrebne datoteke lahko odstranite ali spremenite kvoto v <1>Nastavitvah upravljanja shrambe.", - "UserQuotaDescription": "<1>{{clickHere}} Poiščite primernejši finančni načrt za svoj {{productName}}.", "UserQuotaHeader": "Število skrbnikov/naprednih uporabnikov bo kmalu preseženo: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/sr-Cyrl-RS/MainBar.json b/packages/client/public/locales/sr-Cyrl-RS/MainBar.json index 91545b62ff..9df586d972 100644 --- a/packages/client/public/locales/sr-Cyrl-RS/MainBar.json +++ b/packages/client/public/locales/sr-Cyrl-RS/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Количина меморијског простора ц́е ускоро бити прекорачена: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Можете уклонити непотребне датотеке да бисте ослободили простор на диску.", "TenantCustomQuotaDescription": "Можете уклонити непотребне датотеке или променити квоту у <1>Storage management settings.", - "UserQuotaDescription": "<1>{{clickHere }} да бисте пронашли бољи план цена за свој {{productName}}.", "UserQuotaHeader": "Број администратора/напредних корисника ће ускоро бити прекорачен: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/sr-Latn-RS/MainBar.json b/packages/client/public/locales/sr-Latn-RS/MainBar.json index 1b64cf352e..a8443ddd4b 100644 --- a/packages/client/public/locales/sr-Latn-RS/MainBar.json +++ b/packages/client/public/locales/sr-Latn-RS/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Količina memorijskog prostora će uskoro biti prekoračena: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Možete ukloniti nepotrebne datoteke da biste oslobodili prostor na disku.", "TenantCustomQuotaDescription": "Možete ukloniti nepotrebne datoteke ili promeniti kvotu u <1>Storage management settings.", - "UserQuotaDescription": "<1>{{clickHere}} da biste pronašli bolji plan cena za svoj {{productName}}.", "UserQuotaHeader": "Broj administratora/naprednih korisnika će uskoro biti prekoračen: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/tr/MainBar.json b/packages/client/public/locales/tr/MainBar.json index 89345a1cfe..791ca190fe 100644 --- a/packages/client/public/locales/tr/MainBar.json +++ b/packages/client/public/locales/tr/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Depolama alanı miktarı aşılmak üzere: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Disk alanını boşaltmak için gereksiz dosyaları kaldırabilirsiniz.", "TenantCustomQuotaDescription": "Gereksiz dosyaları kaldırabilir veya <1>Depolama yönetimi ayarlarından kotayı değiştirebilirsiniz.", - "UserQuotaDescription": "{{productName}} alanınız için daha iyi bir fiyatlandırma planı bulmak için <1>{{clickHere}}.", "UserQuotaHeader": "Yönetici/uzman kullanıcı sayısı aşılmak üzere: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/uk-UA/MainBar.json b/packages/client/public/locales/uk-UA/MainBar.json index ffc4e77bbe..8377345d4f 100644 --- a/packages/client/public/locales/uk-UA/MainBar.json +++ b/packages/client/public/locales/uk-UA/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Обсяг сховища скоро буде перевищено: {{currentValue}}/{{maxValue}}", "StorageQuotaUserDescription": "Ви можете видалити непотрібні файли, щоб звільнити місце на диску.", "TenantCustomQuotaDescription": "Ви можете видалити непотрібні файли або змінити квоту в <1>Параметрах керування сховищем.", - "UserQuotaDescription": "<1>{{clickHere}}, щоб знайти кращий тарифний план для вашого {{productName}}.", "UserQuotaHeader": "Кількість адміністраторів / досвідчених користувачів скоро буде перевищено: {{currentValue}}/{{maxValue}}." } diff --git a/packages/client/public/locales/vi/MainBar.json b/packages/client/public/locales/vi/MainBar.json index 9865075e68..4477487c78 100644 --- a/packages/client/public/locales/vi/MainBar.json +++ b/packages/client/public/locales/vi/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "Dung lượng lưu trữ sắp vượt quá:{{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "Bạn có thể xóa các tập tin không cần thiết để giải phóng dung lượng ổ đĩa.", "TenantCustomQuotaDescription": "Bạn có thể xóa các tập tin không cần thiết hoặc thay đổi hạn mức trong cài đặt Quản lý lưu trữ <1>.", - "UserQuotaDescription": "<1>{{clickHere}} để tìm gói dịch vụ có giá tốt hơn cho {{productName}} của bạn.", "UserQuotaHeader": "Sắp vượt quá số lượng quản trị viên/người dùng cấp cao:{{currentValue}}/{{maxValue}}." } diff --git a/packages/client/public/locales/zh-CN/MainBar.json b/packages/client/public/locales/zh-CN/MainBar.json index 31f5698f0d..d5e2021476 100644 --- a/packages/client/public/locales/zh-CN/MainBar.json +++ b/packages/client/public/locales/zh-CN/MainBar.json @@ -14,6 +14,5 @@ "StorageQuotaHeader": "存储空间数量即将超出限制:{{currentValue}}/{{maxValue}}", "StorageQuotaUserDescription": "您可以删除不必要的文件以释放磁盘空间。", "TenantCustomQuotaDescription": "您可以在<1>存储空间管理设置中删除不必要的文件,或更改配额。", - "UserQuotaDescription": "<1>{{clickHere}}为您的{{productName}}找到更好的定价计划。", "UserQuotaHeader": "管理员/高级用户的数量即将超过限制: {{currentValue}} / {{maxValue}}" } diff --git a/packages/client/src/components/MainBar/Bar.js b/packages/client/src/components/MainBar/Bar.js index 018b5a8cd3..3780497521 100644 --- a/packages/client/src/components/MainBar/Bar.js +++ b/packages/client/src/components/MainBar/Bar.js @@ -120,7 +120,7 @@ const Bar = (props) => { setBarVisible((value) => ({ ...value, roomQuota: !closed.includes(QuotaBarTypes.RoomQuota), - userQuota: !closed.includes(QuotaBarTypes.UserQuota), + storageAndRoomQuota: !closed.includes( QuotaBarTypes.UserAndStorageQuota, ), @@ -129,6 +129,12 @@ const Bar = (props) => { ), })); } + if (isAdmin || isRoomAdmin) { + setBarVisible((value) => ({ + ...value, + userQuota: !closed.includes(QuotaBarTypes.UserQuota), + })); + } if (isAdmin || isPowerUser || isRoomAdmin) { setBarVisible((value) => ({ ...value, @@ -148,7 +154,7 @@ const Bar = (props) => { roomQuota: isAdmin, storageQuota: isAdmin || isPowerUser || isRoomAdmin, tenantCustomQuota: isAdmin || isPowerUser || isRoomAdmin, - userQuota: isAdmin, + userQuota: isAdmin | isRoomAdmin, storageAndUserQuota: isAdmin, storageAndRoomQuota: isAdmin, confirmEmail: true, diff --git a/packages/client/src/components/MainBar/QuotasBar.js b/packages/client/src/components/MainBar/QuotasBar.js index 7414faca8f..a8dd2c5f7a 100644 --- a/packages/client/src/components/MainBar/QuotasBar.js +++ b/packages/client/src/components/MainBar/QuotasBar.js @@ -93,13 +93,14 @@ const QuotasBar = ({ ); }; const getUserQuotaDescription = () => { + if (!isAdmin) return t("UserTariffAlmostReached"); + return ( ); }; + const getQuotaInfo = () => { switch (type) { case QuotaBarTypes.RoomQuota: From 961ae16adc25297ecd3265fca35d86d89dd6a19c Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Tue, 13 Aug 2024 11:06:28 +0300 Subject: [PATCH 028/140] Client: Function renaming. --- packages/client/src/components/MainBar/Bar.js | 10 +++++----- packages/shared/store/CurrentQuotaStore.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/client/src/components/MainBar/Bar.js b/packages/client/src/components/MainBar/Bar.js index 3780497521..954a1149c9 100644 --- a/packages/client/src/components/MainBar/Bar.js +++ b/packages/client/src/components/MainBar/Bar.js @@ -69,7 +69,7 @@ const Bar = (props) => { showRoomQuotaBar, showStorageQuotaBar, - showUserQuotaBar, + showAlmostReachedUserTariffLimit, currentColorScheme, @@ -283,7 +283,7 @@ const Bar = (props) => { }; } if ( - showUserQuotaBar && + showAlmostReachedUserTariffLimit && showStorageQuotaBar && barVisible.storageAndUserQuota ) { @@ -316,7 +316,7 @@ const Bar = (props) => { }; } - if (showUserQuotaBar && barVisible.userQuota) { + if (showAlmostReachedUserTariffLimit && barVisible.userQuota) { return { type: QuotaBarTypes.UserQuota, maxValue: maxCountManagersByQuota, @@ -402,7 +402,7 @@ export default inject( showRoomQuotaBar, showStorageQuotaBar, - showUserQuotaBar, + showAlmostReachedUserTariffLimit, showUserPersonalQuotaBar, tenantCustomQuota, showTenantCustomQuotaBar, @@ -431,7 +431,7 @@ export default inject( showRoomQuotaBar, showStorageQuotaBar, - showUserQuotaBar, + showAlmostReachedUserTariffLimit, currentColorScheme, setMainBarVisible, diff --git a/packages/shared/store/CurrentQuotaStore.ts b/packages/shared/store/CurrentQuotaStore.ts index 52d09df6c0..735c003cdc 100644 --- a/packages/shared/store/CurrentQuotaStore.ts +++ b/packages/shared/store/CurrentQuotaStore.ts @@ -271,7 +271,7 @@ class CurrentQuotasStore { ); } - get showUserQuotaBar() { + get showAlmostReachedUserTariffLimit() { return ( this.addedManagersCount > 1 && this.maxCountManagersByQuota - this.addedManagersCount <= From 94d19ffdb8db2d96429ff30435fd64072f1a2689 Mon Sep 17 00:00:00 2001 From: Timofey Boyko Date: Tue, 13 Aug 2024 11:17:59 +0300 Subject: [PATCH 029/140] Shared:Themes:Dark: fix disabled input color text --- packages/shared/themes/dark.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared/themes/dark.ts b/packages/shared/themes/dark.ts index 2a7fe92f3c..1b0eb05898 100644 --- a/packages/shared/themes/dark.ts +++ b/packages/shared/themes/dark.ts @@ -663,7 +663,7 @@ const Dark: TTheme = { input: { color: white, - disableColor: grayDarkStrong, + disableColor: grayDarkText, backgroundColor: black, disableBackgroundColor: grayDarkStrong, From 57ac4a729fbe555beec0cc22b92a7698844bd7ed Mon Sep 17 00:00:00 2001 From: Timofey Boyko Date: Tue, 13 Aug 2024 11:30:43 +0300 Subject: [PATCH 030/140] Client:PortalSettings:OAuth: fix select group required color --- .../sub-components/ClientForm/components/SelectGroup.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/sub-components/ClientForm/components/SelectGroup.tsx b/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/sub-components/ClientForm/components/SelectGroup.tsx index d34a42fde6..25c15de91a 100644 --- a/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/sub-components/ClientForm/components/SelectGroup.tsx +++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/sub-components/ClientForm/components/SelectGroup.tsx @@ -2,6 +2,7 @@ import React from "react"; import { Text } from "@docspace/shared/components/text"; import { SelectorAddButton } from "@docspace/shared/components/selector-add-button"; +import { globalColors } from "@docspace/shared/themes"; import { StyledInputGroup } from "../ClientForm.styled"; @@ -55,7 +56,8 @@ const SelectGroup = ({ color="" textAlign="" > - {label} * + {label}{" "} + *
From ce448f9ddac9583c3b123f9524a6af9e909dfb7e Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Tue, 13 Aug 2024 12:09:40 +0300 Subject: [PATCH 031/140] Client: Renaming. --- packages/client/src/components/MainBar/Bar.js | 23 +++++++++++++------ .../src/components/MainBar/QuotasBar.js | 2 +- packages/client/src/helpers/constants.js | 2 +- packages/shared/store/CurrentQuotaStore.ts | 4 ++++ 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/packages/client/src/components/MainBar/Bar.js b/packages/client/src/components/MainBar/Bar.js index 954a1149c9..2cc0eae20a 100644 --- a/packages/client/src/components/MainBar/Bar.js +++ b/packages/client/src/components/MainBar/Bar.js @@ -86,7 +86,7 @@ const Bar = (props) => { roomQuota: false, storageQuota: false, tenantCustomQuota: false, - userQuota: false, + almostTariffLimitPerUser: false, storageAndUserQuota: false, storageAndRoomQuota: false, confirmEmail: false, @@ -132,7 +132,10 @@ const Bar = (props) => { if (isAdmin || isRoomAdmin) { setBarVisible((value) => ({ ...value, - userQuota: !closed.includes(QuotaBarTypes.UserQuota), + + almostTariffLimitPerUser: !closed.includes( + QuotaBarTypes.AlmostTariffLimitPerUser, + ), })); } if (isAdmin || isPowerUser || isRoomAdmin) { @@ -154,7 +157,7 @@ const Bar = (props) => { roomQuota: isAdmin, storageQuota: isAdmin || isPowerUser || isRoomAdmin, tenantCustomQuota: isAdmin || isPowerUser || isRoomAdmin, - userQuota: isAdmin | isRoomAdmin, + almostTariffLimitPerUser: isAdmin | isRoomAdmin, storageAndUserQuota: isAdmin, storageAndRoomQuota: isAdmin, confirmEmail: true, @@ -240,8 +243,11 @@ const Bar = (props) => { case QuotaBarTypes.TenantCustomQuota: setBarVisible((value) => ({ ...value, tenantCustomQuota: false })); break; - case QuotaBarTypes.UserQuota: - setBarVisible((value) => ({ ...value, userQuota: false })); + case QuotaBarTypes.AlmostTariffLimitPerUser: + setBarVisible((value) => ({ + ...value, + almostTariffLimitPerUser: false, + })); break; case QuotaBarTypes.UserAndStorageQuota: setBarVisible((value) => ({ ...value, storageAndUserQuota: false })); @@ -316,9 +322,12 @@ const Bar = (props) => { }; } - if (showAlmostReachedUserTariffLimit && barVisible.userQuota) { + if ( + showAlmostReachedUserTariffLimit && + barVisible.almostTariffLimitPerUser + ) { return { - type: QuotaBarTypes.UserQuota, + type: QuotaBarTypes.AlmostTariffLimitPerUser, maxValue: maxCountManagersByQuota, currentValue: addedManagersCount, }; diff --git a/packages/client/src/components/MainBar/QuotasBar.js b/packages/client/src/components/MainBar/QuotasBar.js index a8dd2c5f7a..c327b9127c 100644 --- a/packages/client/src/components/MainBar/QuotasBar.js +++ b/packages/client/src/components/MainBar/QuotasBar.js @@ -151,7 +151,7 @@ const QuotasBar = ({ header: t("StorageQuotaHeader", { currentValue, maxValue }), description: getTenantCustomQuota(), }; - case QuotaBarTypes.UserQuota: + case QuotaBarTypes.AlmostTariffLimitPerUser: return { header: t("UserQuotaHeader", { currentValue, maxValue }), description: getUserQuotaDescription(), diff --git a/packages/client/src/helpers/constants.js b/packages/client/src/helpers/constants.js index c40d85552f..690e518378 100644 --- a/packages/client/src/helpers/constants.js +++ b/packages/client/src/helpers/constants.js @@ -98,7 +98,7 @@ export const QuotaBarTypes = Object.freeze({ ConfirmEmail: "confirm-email", RoomQuota: "room-quota", StorageQuota: "storage-quota", - UserQuota: "user-quota", + AlmostTariffLimitPerUser: "user-quota", UserAndStorageQuota: "user-storage-quota", RoomAndStorageQuota: "room-storage-quota", PersonalUserQuota: "personal-user-quota", diff --git a/packages/shared/store/CurrentQuotaStore.ts b/packages/shared/store/CurrentQuotaStore.ts index 735c003cdc..94488251c9 100644 --- a/packages/shared/store/CurrentQuotaStore.ts +++ b/packages/shared/store/CurrentQuotaStore.ts @@ -280,6 +280,10 @@ class CurrentQuotasStore { ); } + get showReachedUserTariffLimit() { + return null; + } + get isPaidUserLimit() { return this.addedManagersCount >= this.maxCountManagersByQuota; } From 92cf12621dc1a5b601a1618fee27b7977bfbe7d3 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Tue, 13 Aug 2024 13:08:26 +0300 Subject: [PATCH 032/140] Client: Added a bar for reaching the user limit by tariff. --- .../client/public/locales/en/MainBar.json | 9 ++- packages/client/src/components/MainBar/Bar.js | 24 +++++++- .../src/components/MainBar/QuotasBar.js | 56 ++++++++++++++++++- packages/client/src/helpers/constants.js | 1 + packages/shared/store/CurrentQuotaStore.ts | 6 +- 5 files changed, 87 insertions(+), 9 deletions(-) diff --git a/packages/client/public/locales/en/MainBar.json b/packages/client/public/locales/en/MainBar.json index 2627e7627d..55ce471cc6 100644 --- a/packages/client/public/locales/en/MainBar.json +++ b/packages/client/public/locales/en/MainBar.json @@ -14,7 +14,10 @@ "StorageQuotaHeader": "Storage space amount is about to be exceeded: {{currentValue}} / {{maxValue}}", "StorageQuotaUserDescription": "You can remove the unnecessary files to free up disk space.", "TenantCustomQuotaDescription": "You can remove the unnecessary files or change quota in the <1>Storage management settings.", - "UserTariffAlmostReachedForAdmins": "Once the limit is reached, all users will be added with user permissions only. To be able to add further admins/power users, <1>click here to upgrade your tariff plan.", - "UserTariffAlmostReached": "Once the limit is reached, all users will be added with user permissions only. To be able to add further admins/power users, contact the DocSpace administrator to upgrade the tariff plan.", - "UserQuotaHeader": "The number of admins/power users is about to be exceeded: {{currentValue}} / {{maxValue}}." + "UserTariffAlmostReachedForAdmins": "Once the limit is reached, all users will be added with User permissions only. To be able to add further admins/power users, <1>click here to upgrade your tariff plan.", + "UserTariffAlmostReached": "Once the limit is reached, all users will be added with User permissions only. To be able to add further admins/power users, contact the DocSpace administrator to upgrade the tariff plan.", + "UserTariffReachedForAdmins": "All users will be added with User permissions only. To be able to add further admins/power users, <1>click here to upgrade your tariff plan.", + "UserTariffReached": "All users will be added with User permissions only. To be able to add further admins/power users, contact the DocSpace administrator to upgrade the tariff plan.", + "UserQuotaHeader": "The number of admins/power users is about to be exceeded: {{currentValue}} / {{maxValue}}.", + "UserTariffLimit": "The limit is reached for the number of admins/power users: {{currentValue}} / {{maxValue}}" } diff --git a/packages/client/src/components/MainBar/Bar.js b/packages/client/src/components/MainBar/Bar.js index 2cc0eae20a..e71c886f12 100644 --- a/packages/client/src/components/MainBar/Bar.js +++ b/packages/client/src/components/MainBar/Bar.js @@ -78,6 +78,7 @@ const Bar = (props) => { tenantCustomQuota, showTenantCustomQuotaBar, + isUserTariffLimit, } = props; const navigate = useNavigate(); @@ -87,6 +88,7 @@ const Bar = (props) => { storageQuota: false, tenantCustomQuota: false, almostTariffLimitPerUser: false, + tariffLimitPerUser: false, storageAndUserQuota: false, storageAndRoomQuota: false, confirmEmail: false, @@ -129,10 +131,13 @@ const Bar = (props) => { ), })); } + if (isAdmin || isRoomAdmin) { setBarVisible((value) => ({ ...value, - + tariffLimitPerUser: !closed.includes( + QuotaBarTypes.TariffLimitPerUser, + ), almostTariffLimitPerUser: !closed.includes( QuotaBarTypes.AlmostTariffLimitPerUser, ), @@ -158,6 +163,7 @@ const Bar = (props) => { storageQuota: isAdmin || isPowerUser || isRoomAdmin, tenantCustomQuota: isAdmin || isPowerUser || isRoomAdmin, almostTariffLimitPerUser: isAdmin | isRoomAdmin, + tariffLimitPerUser: isAdmin | isRoomAdmin, storageAndUserQuota: isAdmin, storageAndRoomQuota: isAdmin, confirmEmail: true, @@ -249,6 +255,12 @@ const Bar = (props) => { almostTariffLimitPerUser: false, })); break; + case QuotaBarTypes.TariffLimitPerUser: + setBarVisible((value) => ({ + ...value, + tariffLimitPerUser: false, + })); + break; case QuotaBarTypes.UserAndStorageQuota: setBarVisible((value) => ({ ...value, storageAndUserQuota: false })); break; @@ -322,6 +334,14 @@ const Bar = (props) => { }; } + if (isUserTariffLimit && barVisible.tariffLimitPerUser) { + return { + type: QuotaBarTypes.TariffLimitPerUser, + maxValue: maxCountManagersByQuota, + currentValue: addedManagersCount, + }; + } + if ( showAlmostReachedUserTariffLimit && barVisible.almostTariffLimitPerUser @@ -415,6 +435,7 @@ export default inject( showUserPersonalQuotaBar, tenantCustomQuota, showTenantCustomQuotaBar, + isUserTariffLimit, } = currentQuotaStore; const { currentColorScheme, setMainBarVisible } = settingsStore; @@ -448,6 +469,7 @@ export default inject( showUserPersonalQuotaBar, tenantCustomQuota, showTenantCustomQuotaBar, + isUserTariffLimit, }; }, )(withTranslation(["Profile", "Common"])(observer(Bar))); diff --git a/packages/client/src/components/MainBar/QuotasBar.js b/packages/client/src/components/MainBar/QuotasBar.js index c327b9127c..3933c8d1f1 100644 --- a/packages/client/src/components/MainBar/QuotasBar.js +++ b/packages/client/src/components/MainBar/QuotasBar.js @@ -116,7 +116,55 @@ const QuotasBar = ({ /> ); }; + const getUserTariffAlmostLimit = () => { + if (!isAdmin) return t("UserTariffAlmostReached"); + return ( + + ), + }} + /> + ); + }; + + const getUserTariffLimit = () => { + if (!isAdmin) return t("UserTariffReached"); + + return ( + + ), + }} + /> + ); + }; const getQuotaInfo = () => { switch (type) { case QuotaBarTypes.RoomQuota: @@ -154,9 +202,13 @@ const QuotasBar = ({ case QuotaBarTypes.AlmostTariffLimitPerUser: return { header: t("UserQuotaHeader", { currentValue, maxValue }), - description: getUserQuotaDescription(), + description: getUserTariffAlmostLimit(), + }; + case QuotaBarTypes.TariffLimitPerUser: + return { + header: t("UserTariffLimit", { currentValue, maxValue }), + description: getUserTariffLimit(), }; - case QuotaBarTypes.UserAndStorageQuota: return { header: t("StorageAndUserHeader", { currentValue, maxValue }), diff --git a/packages/client/src/helpers/constants.js b/packages/client/src/helpers/constants.js index 690e518378..4769beed84 100644 --- a/packages/client/src/helpers/constants.js +++ b/packages/client/src/helpers/constants.js @@ -99,6 +99,7 @@ export const QuotaBarTypes = Object.freeze({ RoomQuota: "room-quota", StorageQuota: "storage-quota", AlmostTariffLimitPerUser: "user-quota", + TariffLimitPerUser: "user-quota-limit", UserAndStorageQuota: "user-storage-quota", RoomAndStorageQuota: "room-storage-quota", PersonalUserQuota: "personal-user-quota", diff --git a/packages/shared/store/CurrentQuotaStore.ts b/packages/shared/store/CurrentQuotaStore.ts index 94488251c9..f6b56b75b7 100644 --- a/packages/shared/store/CurrentQuotaStore.ts +++ b/packages/shared/store/CurrentQuotaStore.ts @@ -276,12 +276,12 @@ class CurrentQuotasStore { this.addedManagersCount > 1 && this.maxCountManagersByQuota - this.addedManagersCount <= COUNT_FOR_SHOWING_BAR && - this.maxCountManagersByQuota >= this.addedManagersCount + this.maxCountManagersByQuota > this.addedManagersCount ); } - get showReachedUserTariffLimit() { - return null; + get isUserTariffLimit() { + return this.isPaidUserLimit; } get isPaidUserLimit() { From eb7c8380b565f45ba7fb1085b28b672cfb776eca Mon Sep 17 00:00:00 2001 From: Timofey Boyko Date: Tue, 13 Aug 2024 13:55:11 +0300 Subject: [PATCH 033/140] Client/Shared: fix drop down width from 'fit-content' to 'auto' for correct calculation at FF --- packages/client/src/components/AccessSelector/index.tsx | 2 +- packages/client/src/components/QuotaForm/index.js | 2 +- packages/client/src/components/SpaceQuota/index.js | 2 +- .../sub-components/ThirdPartyStorage/ThirdPartyComboBox.js | 2 +- .../sub-components/GroupMember/index.tsx | 2 +- .../src/pages/Home/InfoPanel/Body/views/Accounts/index.js | 2 +- .../src/pages/Home/InfoPanel/Body/views/Members/User.js | 2 +- .../Section/AccountsBody/InsideGroup/TableView/TableRow.js | 4 ++-- .../Home/Section/AccountsBody/People/TableView/TableRow.js | 2 +- .../AccountsTable/RowView/UsersTypeRowContent.js | 2 +- .../AccountsTable/TableView/UsersTypeTableRow.js | 2 +- .../AccountsTable/RowView/UsersRowContent.js | 2 +- .../AccountsTable/TableView/UsersTableRow.js | 2 +- .../AccountsTable/RowView/UsersTypeRowContent.js | 2 +- .../AccountsTable/TableView/UsersTypeTableRow.js | 2 +- packages/shared/components/drop-down/DropDown.styled.ts | 2 +- .../components/selector/sub-components/AccessSelector.tsx | 4 ++-- packages/shared/components/share/sub-components/LinkRow.tsx | 2 +- 18 files changed, 20 insertions(+), 20 deletions(-) diff --git a/packages/client/src/components/AccessSelector/index.tsx b/packages/client/src/components/AccessSelector/index.tsx index f68d953ca8..127938ec6b 100644 --- a/packages/client/src/components/AccessSelector/index.tsx +++ b/packages/client/src/components/AccessSelector/index.tsx @@ -146,7 +146,7 @@ const AccessSelector: React.FC = ({ directionX="right" directionY="top" fixedDirection - manualWidth="fit-content" + manualWidth="auto" isDefaultMode isAside={isMobileView} setIsOpenItemAccess={setIsOpenItemAccess} diff --git a/packages/client/src/components/QuotaForm/index.js b/packages/client/src/components/QuotaForm/index.js index 1305ef9e62..b34856cce8 100644 --- a/packages/client/src/components/QuotaForm/index.js +++ b/packages/client/src/components/QuotaForm/index.js @@ -218,7 +218,7 @@ const QuotaForm = ({ size="content" onSelect={onSelectComboBox} showDisabledItems - manualWidth={"fit-content"} + manualWidth="auto" directionY="both" />
diff --git a/packages/client/src/components/SpaceQuota/index.js b/packages/client/src/components/SpaceQuota/index.js index 182b955112..34a6cd2663 100644 --- a/packages/client/src/components/SpaceQuota/index.js +++ b/packages/client/src/components/SpaceQuota/index.js @@ -196,7 +196,7 @@ const SpaceQuota = (props) => { size="content" modernView isLoading={isLoading} - manualWidth="fit-content" + manualWidth="auto" directionY="both" /> diff --git a/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/ThirdPartyStorage/ThirdPartyComboBox.js b/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/ThirdPartyStorage/ThirdPartyComboBox.js index 41f5e19848..96c6867649 100644 --- a/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/ThirdPartyStorage/ThirdPartyComboBox.js +++ b/packages/client/src/components/dialogs/CreateEditRoomDialog/sub-components/ThirdPartyStorage/ThirdPartyComboBox.js @@ -239,7 +239,7 @@ const ThirdPartyComboBox = ({ scaled withBackdrop={isMobile} size="content" - manualWidth={"fit-content"} + manualWidth={"auto"} isMobileView={isMobileOnly} directionY="both" displaySelectedOption diff --git a/packages/client/src/components/dialogs/EditGroupMembersDialog/sub-components/GroupMember/index.tsx b/packages/client/src/components/dialogs/EditGroupMembersDialog/sub-components/GroupMember/index.tsx index 081701f4ea..b2dd4e92bf 100644 --- a/packages/client/src/components/dialogs/EditGroupMembersDialog/sub-components/GroupMember/index.tsx +++ b/packages/client/src/components/dialogs/EditGroupMembersDialog/sub-components/GroupMember/index.tsx @@ -170,7 +170,7 @@ const GroupMember = ({ member, infoPanelSelection }: GroupMemberProps) => { size="content" modernView title={t("Common:Role")} - manualWidth={"fit-content"} + manualWidth="auto" isMobileView={isMobileOnly} directionY="both" displaySelectedOption diff --git a/packages/client/src/pages/Home/InfoPanel/Body/views/Accounts/index.js b/packages/client/src/pages/Home/InfoPanel/Body/views/Accounts/index.js index 9988810e25..48e7058160 100644 --- a/packages/client/src/pages/Home/InfoPanel/Body/views/Accounts/index.js +++ b/packages/client/src/pages/Home/InfoPanel/Body/views/Accounts/index.js @@ -176,7 +176,7 @@ const Accounts = (props) => { size="content" displaySelectedOption modernView - manualWidth={"fit-content"} + manualWidth="auto" isLoading={isLoading} /> ); diff --git a/packages/client/src/pages/Home/InfoPanel/Body/views/Members/User.js b/packages/client/src/pages/Home/InfoPanel/Body/views/Members/User.js index d54dcc0ea3..5ae7ecbc74 100644 --- a/packages/client/src/pages/Home/InfoPanel/Body/views/Members/User.js +++ b/packages/client/src/pages/Home/InfoPanel/Body/views/Members/User.js @@ -378,7 +378,7 @@ const User = ({ size="content" modernView title={t("Common:Role")} - manualWidth={"fit-content"} + manualWidth="auto" isLoading={isLoading} isMobileView={isMobileOnly} directionY="both" diff --git a/packages/client/src/pages/Home/Section/AccountsBody/InsideGroup/TableView/TableRow.js b/packages/client/src/pages/Home/Section/AccountsBody/InsideGroup/TableView/TableRow.js index bc198c6201..9c4ca6f5aa 100644 --- a/packages/client/src/pages/Home/Section/AccountsBody/InsideGroup/TableView/TableRow.js +++ b/packages/client/src/pages/Home/Section/AccountsBody/InsideGroup/TableView/TableRow.js @@ -399,7 +399,7 @@ const InsideGroupTableRow = (props) => { directionY="both" size="content" modernView - manualWidth={"fit-content"} + manualWidth="auto" isLoading={isLoading} optionStyle={{ maxWidth: "400px" }} textOverflow @@ -442,7 +442,7 @@ const InsideGroupTableRow = (props) => { size="content" displaySelectedOption modernView - manualWidth={"fit-content"} + manualWidth="auto" isLoading={isLoading} /> ); diff --git a/packages/client/src/pages/Home/Section/AccountsBody/People/TableView/TableRow.js b/packages/client/src/pages/Home/Section/AccountsBody/People/TableView/TableRow.js index 45c74f06fc..7352bb5612 100644 --- a/packages/client/src/pages/Home/Section/AccountsBody/People/TableView/TableRow.js +++ b/packages/client/src/pages/Home/Section/AccountsBody/People/TableView/TableRow.js @@ -438,7 +438,7 @@ const PeopleTableRow = (props) => { size="content" displaySelectedOption modernView - manualWidth={"fit-content"} + manualWidth={"auto"} isLoading={isLoading} /> ); diff --git a/packages/client/src/pages/PortalSettings/categories/data-import/GoogleWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/RowView/UsersTypeRowContent.js b/packages/client/src/pages/PortalSettings/categories/data-import/GoogleWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/RowView/UsersTypeRowContent.js index 49978069f3..bec9750871 100644 --- a/packages/client/src/pages/PortalSettings/categories/data-import/GoogleWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/RowView/UsersTypeRowContent.js +++ b/packages/client/src/pages/PortalSettings/categories/data-import/GoogleWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/RowView/UsersTypeRowContent.js @@ -131,7 +131,7 @@ const UsersRowContent = ({ size="content" displaySelectedOption modernView - manualWidth="fit-content" + manualWidth="auto" /> , diff --git a/packages/client/src/pages/PortalSettings/categories/data-import/GoogleWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/TableView/UsersTypeTableRow.js b/packages/client/src/pages/PortalSettings/categories/data-import/GoogleWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/TableView/UsersTypeTableRow.js index 9cfb47cc25..4c59bdece7 100644 --- a/packages/client/src/pages/PortalSettings/categories/data-import/GoogleWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/TableView/UsersTypeTableRow.js +++ b/packages/client/src/pages/PortalSettings/categories/data-import/GoogleWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/TableView/UsersTypeTableRow.js @@ -126,7 +126,7 @@ const UsersTypeTableRow = ({ size="content" displaySelectedOption modernView - manualWidth="fit-content" + manualWidth="auto" /> diff --git a/packages/client/src/pages/PortalSettings/categories/data-import/NextCloudWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/RowView/UsersRowContent.js b/packages/client/src/pages/PortalSettings/categories/data-import/NextCloudWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/RowView/UsersRowContent.js index 3c9268a46c..d73ed0ffe3 100644 --- a/packages/client/src/pages/PortalSettings/categories/data-import/NextCloudWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/RowView/UsersRowContent.js +++ b/packages/client/src/pages/PortalSettings/categories/data-import/NextCloudWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/RowView/UsersRowContent.js @@ -132,7 +132,7 @@ const UsersRowContent = ({ size="content" displaySelectedOption modernView - manualWidth="fit-content" + manualWidth="auto" /> , diff --git a/packages/client/src/pages/PortalSettings/categories/data-import/NextCloudWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/TableView/UsersTableRow.js b/packages/client/src/pages/PortalSettings/categories/data-import/NextCloudWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/TableView/UsersTableRow.js index 9cfb47cc25..4c59bdece7 100644 --- a/packages/client/src/pages/PortalSettings/categories/data-import/NextCloudWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/TableView/UsersTableRow.js +++ b/packages/client/src/pages/PortalSettings/categories/data-import/NextCloudWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/TableView/UsersTableRow.js @@ -126,7 +126,7 @@ const UsersTypeTableRow = ({ size="content" displaySelectedOption modernView - manualWidth="fit-content" + manualWidth="auto" /> diff --git a/packages/client/src/pages/PortalSettings/categories/data-import/OnlyofficeWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/RowView/UsersTypeRowContent.js b/packages/client/src/pages/PortalSettings/categories/data-import/OnlyofficeWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/RowView/UsersTypeRowContent.js index 4730f3fe62..d55e29acf8 100644 --- a/packages/client/src/pages/PortalSettings/categories/data-import/OnlyofficeWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/RowView/UsersTypeRowContent.js +++ b/packages/client/src/pages/PortalSettings/categories/data-import/OnlyofficeWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/RowView/UsersTypeRowContent.js @@ -132,7 +132,7 @@ const UsersRowContent = ({ size="content" displaySelectedOption modernView - manualWidth="fit-content" + manualWidth="auto" /> , diff --git a/packages/client/src/pages/PortalSettings/categories/data-import/OnlyofficeWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/TableView/UsersTypeTableRow.js b/packages/client/src/pages/PortalSettings/categories/data-import/OnlyofficeWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/TableView/UsersTypeTableRow.js index 7382d83618..417e46d932 100644 --- a/packages/client/src/pages/PortalSettings/categories/data-import/OnlyofficeWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/TableView/UsersTypeTableRow.js +++ b/packages/client/src/pages/PortalSettings/categories/data-import/OnlyofficeWorkspace/Stepper/SelectUsersTypeStep/AccountsTable/TableView/UsersTypeTableRow.js @@ -126,7 +126,7 @@ const UsersTypeTableRow = ({ size="content" displaySelectedOption modernView - manualWidth="fit-content" + manualWidth="auto" /> diff --git a/packages/shared/components/drop-down/DropDown.styled.ts b/packages/shared/components/drop-down/DropDown.styled.ts index 4fa68fb4af..36418faf1c 100644 --- a/packages/shared/components/drop-down/DropDown.styled.ts +++ b/packages/shared/components/drop-down/DropDown.styled.ts @@ -106,7 +106,7 @@ const StyledDropdown = styled.div<{ border: ${(props) => props.theme.dropDown.border}; border-radius: ${(props) => props.theme.dropDown.borderRadius}; -moz-border-radius: ${(props) => props.theme.dropDown.borderRadius}; - -webkit-border-radius: ${(props) => props.theme.dropDown.borderRadius};dropDownMaxHeight + -webkit-border-radius: ${(props) => props.theme.dropDown.borderRadius}; box-shadow: ${(props) => props.theme.dropDown.boxShadow}; -moz-box-shadow: ${(props) => props.theme.dropDown.boxShadow}; -webkit-box-shadow: ${(props) => props.theme.dropDown.boxShadow}; diff --git a/packages/shared/components/selector/sub-components/AccessSelector.tsx b/packages/shared/components/selector/sub-components/AccessSelector.tsx index a7dd834da5..e501090f6e 100644 --- a/packages/shared/components/selector/sub-components/AccessSelector.tsx +++ b/packages/shared/components/selector/sub-components/AccessSelector.tsx @@ -63,7 +63,7 @@ const AccessSelector = (props: AccessSelectorProps) => { options={accessRights as TOption[]} size={ComboBoxSize.content} scaled={false} - manualWidth="fit-content" + manualWidth="auto" selectedOption={selectedAccessRight as TOption} showDisabledItems directionX="right" @@ -81,7 +81,7 @@ const AccessSelector = (props: AccessSelectorProps) => { directionX="right" directionY="top" fixedDirection={isMobileView} - manualWidth={isMobileView ? "fit-content" : `${width}px`} + manualWidth={isMobileView ? "auto" : `${width}px`} isAside={isMobileView} manualY={isMobileView ? "0px" : undefined} withoutBackground={isMobileView} diff --git a/packages/shared/components/share/sub-components/LinkRow.tsx b/packages/shared/components/share/sub-components/LinkRow.tsx index bf05ee7c76..a5e1cc4964 100644 --- a/packages/shared/components/share/sub-components/LinkRow.tsx +++ b/packages/shared/components/share/sub-components/LinkRow.tsx @@ -153,7 +153,7 @@ const LinkRow = ({ modernView type="onlyIcon" isDisabled={isExpiredLink || isLoaded} - manualWidth="fit-content" + manualWidth="auto" withBackdrop={false} /> From 42fea7f56f53784baf9330d4b40c3213b8b881cb Mon Sep 17 00:00:00 2001 From: Elyor Djalilov Date: Tue, 13 Aug 2024 16:02:03 +0500 Subject: [PATCH 034/140] Web: Client: Settings: Data Import: fixed display breakpoint warning --- .../categories/data-import/GoogleWorkspace/index.js | 2 +- .../categories/data-import/NextCloudWorkspace/index.js | 2 +- .../categories/data-import/OnlyofficeWorkspace/index.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/src/pages/PortalSettings/categories/data-import/GoogleWorkspace/index.js b/packages/client/src/pages/PortalSettings/categories/data-import/GoogleWorkspace/index.js index b84e8ce76a..e644d45ba3 100644 --- a/packages/client/src/pages/PortalSettings/categories/data-import/GoogleWorkspace/index.js +++ b/packages/client/src/pages/PortalSettings/categories/data-import/GoogleWorkspace/index.js @@ -219,7 +219,7 @@ const GoogleWorkspace = ({ return clearCheckedAccounts; }, []); - if (isMobile || isMobileBreakpoint()) + if (isMobileBreakpoint()) return ( { return clearCheckedAccounts; }, []); - if (isMobile || isMobileBreakpoint()) + if (isMobileBreakpoint()) return ( Date: Tue, 13 Aug 2024 16:00:26 +0300 Subject: [PATCH 035/140] Fix Bug 69637 - Rooms.Form.Embed. Fixed embedding mode --- packages/client/src/components/panels/EmbeddingPanel/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/panels/EmbeddingPanel/index.tsx b/packages/client/src/components/panels/EmbeddingPanel/index.tsx index 07d6332655..eaac632bc1 100644 --- a/packages/client/src/components/panels/EmbeddingPanel/index.tsx +++ b/packages/client/src/components/panels/EmbeddingPanel/index.tsx @@ -160,7 +160,7 @@ const EmbeddingPanelComponent = (props: EmbeddingPanelProps) => { ); const fileConfig = { - mode: "viewer", + mode: "editor", width: `${widthValue}${dataDimensions[0].label}`, height: `${heightValue}${dataDimensions[1].label}`, frameId: "ds-frame", From f3ebbe20ea75de9dd06bb713803df5bc803d315f Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Tue, 13 Aug 2024 16:01:01 +0300 Subject: [PATCH 036/140] Fixed Bug 69396: Zoom: Fixed wrong height on resize --- packages/shared/components/selector/sub-components/Body.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/shared/components/selector/sub-components/Body.tsx b/packages/shared/components/selector/sub-components/Body.tsx index 14d7af6d18..f05fd8a593 100644 --- a/packages/shared/components/selector/sub-components/Body.tsx +++ b/packages/shared/components/selector/sub-components/Body.tsx @@ -124,7 +124,9 @@ const Body = ({ const onBodyResize = React.useCallback(() => { if (bodyRef && bodyRef.current) { - setBodyHeight(bodyRef.current.offsetHeight); + setTimeout(() => { + setBodyHeight(bodyRef.current!.offsetHeight); + }, 20); } }, []); From 9821d4d969d4ed28b5d2bdc4f1e0732660afb54e Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Tue, 13 Aug 2024 16:32:43 +0300 Subject: [PATCH 037/140] Fixed Bug 69236: Zoom: Fixed ability to go to fill out the form during a call --- packages/doceditor/src/components/Editor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/doceditor/src/components/Editor.tsx b/packages/doceditor/src/components/Editor.tsx index f64cb053f9..06eb9976b8 100644 --- a/packages/doceditor/src/components/Editor.tsx +++ b/packages/doceditor/src/components/Editor.tsx @@ -305,7 +305,7 @@ const Editor = ({ newConfig.events.onRequestClose = onSDKRequestClose; } - if (config?.startFilling) { + if (config?.startFilling && !IS_ZOOM) { newConfig.events.onRequestStartFilling = () => onSDKRequestStartFilling?.(t("Common:ShareAndCollect")); } From 36226366d34f254b1d80403ce51d1fe53e3c72c5 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Tue, 13 Aug 2024 17:26:44 +0300 Subject: [PATCH 038/140] Fixed Bug 68537: JS-SDK: Restored missing value for viewTableColumns option --- .../categories/developer-tools/JavascriptSDK/presets/Manager.js | 1 + public/scripts/sdk/1.0.1/api.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/presets/Manager.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/presets/Manager.js index 7c7e509520..a3c1c572bb 100644 --- a/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/presets/Manager.js +++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/presets/Manager.js @@ -130,6 +130,7 @@ const Manager = (props) => { ); const [selectedColumns, setSelectedColumns] = useState([ { key: "Name", label: t("Common:Name") }, + { key: "Size", label: t("Common:Size") }, { key: "Type", label: t("Common:Type") }, { key: "Tags", label: t("Common:Tags") }, ]); diff --git a/public/scripts/sdk/1.0.1/api.js b/public/scripts/sdk/1.0.1/api.js index ae265191e0..f006b3753f 100644 --- a/public/scripts/sdk/1.0.1/api.js +++ b/public/scripts/sdk/1.0.1/api.js @@ -53,7 +53,7 @@ showSignOut: true, destroyText: "", viewAs: "row", //TODO: ["row", "table", "tile"] - viewTableColumns: "Name,Type,Tags", + viewTableColumns: "Name,Size,Type,Tags", checkCSP: true, disableActionButton: false, showSettings: false, From cf472787195c60cab2482c1fd545e690990eb35e Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Tue, 13 Aug 2024 17:54:45 +0300 Subject: [PATCH 039/140] Client: Renaming. --- packages/client/src/components/MainBar/Bar.js | 43 ++++++++----------- .../src/components/MainBar/QuotasBar.js | 4 +- packages/client/src/helpers/constants.js | 4 +- packages/shared/store/CurrentQuotaStore.ts | 2 +- 4 files changed, 23 insertions(+), 30 deletions(-) diff --git a/packages/client/src/components/MainBar/Bar.js b/packages/client/src/components/MainBar/Bar.js index e71c886f12..4ed374ec70 100644 --- a/packages/client/src/components/MainBar/Bar.js +++ b/packages/client/src/components/MainBar/Bar.js @@ -69,7 +69,7 @@ const Bar = (props) => { showRoomQuotaBar, showStorageQuotaBar, - showAlmostReachedUserTariffLimit, + isUserTariffAlmostLimit, currentColorScheme, @@ -87,8 +87,8 @@ const Bar = (props) => { roomQuota: false, storageQuota: false, tenantCustomQuota: false, - almostTariffLimitPerUser: false, - tariffLimitPerUser: false, + usersTariff: false, + usersTariffLimit: false, storageAndUserQuota: false, storageAndRoomQuota: false, confirmEmail: false, @@ -135,12 +135,8 @@ const Bar = (props) => { if (isAdmin || isRoomAdmin) { setBarVisible((value) => ({ ...value, - tariffLimitPerUser: !closed.includes( - QuotaBarTypes.TariffLimitPerUser, - ), - almostTariffLimitPerUser: !closed.includes( - QuotaBarTypes.AlmostTariffLimitPerUser, - ), + usersTariffLimit: !closed.includes(QuotaBarTypes.UsersTariffLimit), + usersTariff: !closed.includes(QuotaBarTypes.UsersTariff), })); } if (isAdmin || isPowerUser || isRoomAdmin) { @@ -162,8 +158,8 @@ const Bar = (props) => { roomQuota: isAdmin, storageQuota: isAdmin || isPowerUser || isRoomAdmin, tenantCustomQuota: isAdmin || isPowerUser || isRoomAdmin, - almostTariffLimitPerUser: isAdmin | isRoomAdmin, - tariffLimitPerUser: isAdmin | isRoomAdmin, + usersTariff: isAdmin | isRoomAdmin, + usersTariffLimit: isAdmin | isRoomAdmin, storageAndUserQuota: isAdmin, storageAndRoomQuota: isAdmin, confirmEmail: true, @@ -249,16 +245,16 @@ const Bar = (props) => { case QuotaBarTypes.TenantCustomQuota: setBarVisible((value) => ({ ...value, tenantCustomQuota: false })); break; - case QuotaBarTypes.AlmostTariffLimitPerUser: + case QuotaBarTypes.UsersTariff: setBarVisible((value) => ({ ...value, - almostTariffLimitPerUser: false, + usersTariff: false, })); break; - case QuotaBarTypes.TariffLimitPerUser: + case QuotaBarTypes.UsersTariffLimit: setBarVisible((value) => ({ ...value, - tariffLimitPerUser: false, + usersTariffLimit: false, })); break; case QuotaBarTypes.UserAndStorageQuota: @@ -301,7 +297,7 @@ const Bar = (props) => { }; } if ( - showAlmostReachedUserTariffLimit && + isUserTariffAlmostLimit && showStorageQuotaBar && barVisible.storageAndUserQuota ) { @@ -334,20 +330,17 @@ const Bar = (props) => { }; } - if (isUserTariffLimit && barVisible.tariffLimitPerUser) { + if (isUserTariffLimit && barVisible.usersTariffLimit) { return { - type: QuotaBarTypes.TariffLimitPerUser, + type: QuotaBarTypes.UsersTariffLimit, maxValue: maxCountManagersByQuota, currentValue: addedManagersCount, }; } - if ( - showAlmostReachedUserTariffLimit && - barVisible.almostTariffLimitPerUser - ) { + if (isUserTariffAlmostLimit && barVisible.usersTariff) { return { - type: QuotaBarTypes.AlmostTariffLimitPerUser, + type: QuotaBarTypes.UsersTariff, maxValue: maxCountManagersByQuota, currentValue: addedManagersCount, }; @@ -431,7 +424,7 @@ export default inject( showRoomQuotaBar, showStorageQuotaBar, - showAlmostReachedUserTariffLimit, + isUserTariffAlmostLimit, showUserPersonalQuotaBar, tenantCustomQuota, showTenantCustomQuotaBar, @@ -461,7 +454,7 @@ export default inject( showRoomQuotaBar, showStorageQuotaBar, - showAlmostReachedUserTariffLimit, + isUserTariffAlmostLimit, currentColorScheme, setMainBarVisible, diff --git a/packages/client/src/components/MainBar/QuotasBar.js b/packages/client/src/components/MainBar/QuotasBar.js index 3933c8d1f1..9d3a49b2f3 100644 --- a/packages/client/src/components/MainBar/QuotasBar.js +++ b/packages/client/src/components/MainBar/QuotasBar.js @@ -199,12 +199,12 @@ const QuotasBar = ({ header: t("StorageQuotaHeader", { currentValue, maxValue }), description: getTenantCustomQuota(), }; - case QuotaBarTypes.AlmostTariffLimitPerUser: + case QuotaBarTypes.UsersTariff: return { header: t("UserQuotaHeader", { currentValue, maxValue }), description: getUserTariffAlmostLimit(), }; - case QuotaBarTypes.TariffLimitPerUser: + case QuotaBarTypes.UsersTariffLimit: return { header: t("UserTariffLimit", { currentValue, maxValue }), description: getUserTariffLimit(), diff --git a/packages/client/src/helpers/constants.js b/packages/client/src/helpers/constants.js index 4769beed84..7c8722ec9a 100644 --- a/packages/client/src/helpers/constants.js +++ b/packages/client/src/helpers/constants.js @@ -98,8 +98,8 @@ export const QuotaBarTypes = Object.freeze({ ConfirmEmail: "confirm-email", RoomQuota: "room-quota", StorageQuota: "storage-quota", - AlmostTariffLimitPerUser: "user-quota", - TariffLimitPerUser: "user-quota-limit", + UsersTariff: "user-quota", + UsersTariffLimit: "user-quota-limit", UserAndStorageQuota: "user-storage-quota", RoomAndStorageQuota: "room-storage-quota", PersonalUserQuota: "personal-user-quota", diff --git a/packages/shared/store/CurrentQuotaStore.ts b/packages/shared/store/CurrentQuotaStore.ts index f6b56b75b7..fe24f099e6 100644 --- a/packages/shared/store/CurrentQuotaStore.ts +++ b/packages/shared/store/CurrentQuotaStore.ts @@ -271,7 +271,7 @@ class CurrentQuotasStore { ); } - get showAlmostReachedUserTariffLimit() { + get isUserTariffAlmostLimit() { return ( this.addedManagersCount > 1 && this.maxCountManagersByQuota - this.addedManagersCount <= From 625a7aa5a64bab61c038f6552c8a49944b5167f1 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Tue, 13 Aug 2024 18:10:38 +0300 Subject: [PATCH 040/140] JS-SDK: Added onNoAccess event --- .../src/components/EmptyContainer/RoomNoAccessContainer.js | 3 +++ packages/shared/types/Frame.ts | 2 ++ public/scripts/sdk/1.0.1/api.js | 1 + 3 files changed, 6 insertions(+) diff --git a/packages/client/src/components/EmptyContainer/RoomNoAccessContainer.js b/packages/client/src/components/EmptyContainer/RoomNoAccessContainer.js index e02dc9a77f..61df1e840f 100644 --- a/packages/client/src/components/EmptyContainer/RoomNoAccessContainer.js +++ b/packages/client/src/components/EmptyContainer/RoomNoAccessContainer.js @@ -38,6 +38,7 @@ import { IconButton } from "@docspace/shared/components/icon-button"; import RoomsFilter from "@docspace/shared/api/rooms/filter"; import { RoomSearchArea } from "@docspace/shared/enums"; +import { frameCallEvent } from "@docspace/shared/utils/common"; import { getCategoryUrl } from "SRC_DIR/helpers/utils"; import { CategoryType } from "SRC_DIR/helpers/constants"; @@ -60,6 +61,8 @@ const RoomNoAccessContainer = (props) => { const navigate = useNavigate(); React.useEffect(() => { + frameCallEvent({ event: "onNoAccess" }); + const timer = setTimeout(onGoToShared, 5000); return () => clearTimeout(timer); }, []); diff --git a/packages/shared/types/Frame.ts b/packages/shared/types/Frame.ts index 1dd42178ad..469ff145df 100644 --- a/packages/shared/types/Frame.ts +++ b/packages/shared/types/Frame.ts @@ -75,6 +75,7 @@ export type TFrameEvents = { onAuthSuccess: null | ((e: Event) => void); onSignOut: null | ((e: Event) => void); onDownload: null | ((e: Event) => void); + onNoAccess: null | ((e: Event) => void); }; export type TFrameConfig = { @@ -96,6 +97,7 @@ export type TFrameConfig = { showSelectorCancel: boolean; showSelectorHeader: boolean; showHeader: boolean; + showHeaderBanner: string; showTitle: boolean; showMenu: boolean; showFilter: boolean; diff --git a/public/scripts/sdk/1.0.1/api.js b/public/scripts/sdk/1.0.1/api.js index f006b3753f..cb263c3245 100644 --- a/public/scripts/sdk/1.0.1/api.js +++ b/public/scripts/sdk/1.0.1/api.js @@ -97,6 +97,7 @@ onAuthSuccess: null, onSignOut: null, onDownload: null, + onNoAccess: null, }, }; From 097adc82d529e9cc177bed6aa232356b3a489345 Mon Sep 17 00:00:00 2001 From: Aleksandr Lushkin Date: Tue, 13 Aug 2024 17:45:19 +0200 Subject: [PATCH 041/140] Client: EditGroupStore: Fix moving manager to members without setting new manager --- packages/client/src/store/EditGroupStore.ts | 11 +++++++++++ packages/shared/api/groups/index.ts | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/packages/client/src/store/EditGroupStore.ts b/packages/client/src/store/EditGroupStore.ts index 541ace92c8..570113fd75 100644 --- a/packages/client/src/store/EditGroupStore.ts +++ b/packages/client/src/store/EditGroupStore.ts @@ -125,6 +125,17 @@ class EditGroupStore { const addedIds = Array.from(this.addedMembersMap.keys()); const removedIds = Array.from(this.removedMembersMap.keys()); + const oldManager = this.group.manager; + const oldManagerRemovedButRemainsAsMember = + oldManager && + oldManager.id !== this.manager?.id && + !this.removedMembersMap.has(oldManager.id); + + // Requires when new group is without manager and old manager moved to members. updateGroup api method doesn't provide possibility to do it without setting new manager + if (this.manager === null && oldManagerRemovedButRemainsAsMember) { + await api.groups.removeGroupMembers(this.group.id, [oldManager.id]); + addedIds.push(oldManager.id); + } await updateGroup( this.group?.id, diff --git a/packages/shared/api/groups/index.ts b/packages/shared/api/groups/index.ts index 3b54cba3b1..36b1987c68 100644 --- a/packages/shared/api/groups/index.ts +++ b/packages/shared/api/groups/index.ts @@ -146,6 +146,14 @@ export const addGroupMembers = (groupId: string, members: string) => { }); }; +export const removeGroupMembers = (groupId: string, membersIds: string[]) => { + return request({ + method: "delete", + url: `/group/${groupId}/members`, + data: { id: groupId, members: membersIds }, + }) as Promise; +}; + // * Delete export const deleteGroup = (groupId: string) => { From ca7157a5b12699ef8292cf5cf83ddcc9c98c4123 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Tue, 13 Aug 2024 19:02:30 +0300 Subject: [PATCH 042/140] Fix Bug 69568 Backlighting of available dates not active --- packages/shared/components/calendar/utils/getCalendarYears.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared/components/calendar/utils/getCalendarYears.ts b/packages/shared/components/calendar/utils/getCalendarYears.ts index 8e0630cf57..82a2538044 100644 --- a/packages/shared/components/calendar/utils/getCalendarYears.ts +++ b/packages/shared/components/calendar/utils/getCalendarYears.ts @@ -29,7 +29,7 @@ import moment from "moment"; export const getCalendarYears = (observedDate: moment.Moment) => { const years = []; const selectedYear = observedDate.year(); - const firstYear = selectedYear - (selectedYear % 10) - 1; + const firstYear = selectedYear - 1; for (let i = firstYear; i <= firstYear + 15; i += 1) { years.push(moment(i, "YYYY").format("YYYY")); From da127707afbfa6adc0e40b14191cc73e1ee5efa7 Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Tue, 13 Aug 2024 20:42:44 +0400 Subject: [PATCH 043/140] LDAP: Remove error logging duplicate --- packages/client/src/store/LdapFormStore.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/client/src/store/LdapFormStore.js b/packages/client/src/store/LdapFormStore.js index c725630f72..ba929c76e1 100644 --- a/packages/client/src/store/LdapFormStore.js +++ b/packages/client/src/store/LdapFormStore.js @@ -518,7 +518,6 @@ class LdapFormStore { toastr.success(t("Common:SuccessfullyCompletedOperation")); } } catch (error) { - console.error(error); toastr.error(error); this.endProcess(); } From f23d1f7e960e53f7946f9a16ac8db99e7b3cf480 Mon Sep 17 00:00:00 2001 From: Vlada Gazizova <94864088+gazizova-vlada@users.noreply.github.com> Date: Tue, 13 Aug 2024 22:06:56 +0300 Subject: [PATCH 044/140] Shared:ContextMenu:Fixed the increase in the width of the second level menu on hover, when there is a scroll, or when the theme is dark. Added margins for the second menu level. --- .../context-menu/sub-components/SubMenu.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/shared/components/context-menu/sub-components/SubMenu.tsx b/packages/shared/components/context-menu/sub-components/SubMenu.tsx index fdfc1d3b3a..6ac8662057 100644 --- a/packages/shared/components/context-menu/sub-components/SubMenu.tsx +++ b/packages/shared/components/context-menu/sub-components/SubMenu.tsx @@ -158,13 +158,19 @@ const SubMenu = (props: { const widthMaxContent = Math.max(...optionsWidth); if (root) subListWidth = subListWidth || widthMaxContent; - else subListWidth = widthMaxContent; + else if (!subMenuRef?.current?.style.width) + subListWidth = Math.max(subListWidth, widthMaxContent); } if (subMenuRef.current) { let subMenuRefTop = null; - if (!isMobile()) subMenuRef.current.style.width = `${subListWidth}px`; + if (!isMobile()) { + if (root) subMenuRef.current.style.width = `${subListWidth}px`; + else if (!subMenuRef?.current?.style.width) { + subMenuRef.current.style.width = `${subListWidth}px`; + } + } if (!isMobile() && !root) { const firstList = parentItem?.firstChild as HTMLElement; @@ -218,6 +224,8 @@ const SubMenu = (props: { } else { subMenuRef.current.style.left = `${itemOuterWidth}px`; + if (!root) subMenuRef.current.style.marginLeft = `4px`; + if (!root && subListWidth > freeSpaceRight) { // If the menu extends beyond the screen const newWidth = freeSpaceRight - 3 * submenuListMargin; @@ -236,6 +244,8 @@ const SubMenu = (props: { if (notEnoughWidthRight && freeSpaceLeft > freeSpaceRight) { subMenuRef.current.style.left = `${-1 * subListWidth}px`; + if (!root) subMenuRef.current.style.marginLeft = `-4px`; + if ( notEnoughWidthRight && !root && From 56d9c6e774e55bfe0a07d274764038575e6e9c45 Mon Sep 17 00:00:00 2001 From: Timofey Boyko Date: Wed, 14 Aug 2024 10:03:39 +0300 Subject: [PATCH 045/140] Client:OAuth2: add generateDeveloperToken to store --- .../GenerateDevelopTokenDialog.tsx | 26 +++++++++++++++ packages/client/src/store/OAuthStore.ts | 33 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/sub-components/GenerateDevelopTokenDialog.tsx diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/sub-components/GenerateDevelopTokenDialog.tsx b/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/sub-components/GenerateDevelopTokenDialog.tsx new file mode 100644 index 0000000000..5492b9e903 --- /dev/null +++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/OAuth/sub-components/GenerateDevelopTokenDialog.tsx @@ -0,0 +1,26 @@ +import React from "react"; +import { inject, observer } from "mobx-react"; +import styled from "styled-components"; +import { useTranslation } from "react-i18next"; + +import { OAuthStoreProps } from "SRC_DIR/store/OAuthStore"; + +const GenerateDeveloperTokenDialog = () => { + return
; +}; + +export default inject(({ oauthStore }: { oauthStore: OAuthStoreProps }) => { + const { + setInfoDialogVisible, + bufferSelection, + scopeList, + getContextMenuItems, + } = oauthStore; + + return { + setInfoDialogVisible, + client: bufferSelection, + scopeList, + getContextMenuItems, + }; +})(observer(GenerateDeveloperTokenDialog)); diff --git a/packages/client/src/store/OAuthStore.ts b/packages/client/src/store/OAuthStore.ts index 2b7c356ddf..9c3895976d 100644 --- a/packages/client/src/store/OAuthStore.ts +++ b/packages/client/src/store/OAuthStore.ts @@ -58,6 +58,9 @@ export interface OAuthStoreProps { resetDialogVisible: boolean; setResetDialogVisible: (value: boolean) => void; + generateDeveloperTokenDialogVisible: boolean; + setGenerateDeveloperTokenDialogVisible: (value: boolean) => void; + deleteDialogVisible: boolean; setDeleteDialogVisible: (value: boolean) => void; @@ -157,6 +160,8 @@ class OAuthStore implements OAuthStoreProps { resetDialogVisible: boolean = false; + generateDeveloperTokenDialogVisible: boolean = false; + selection: string[] = []; bufferSelection: IClientProps | null = null; @@ -216,6 +221,10 @@ class OAuthStore implements OAuthStoreProps { this.resetDialogVisible = value; }; + setGenerateDeveloperTokenDialogVisible = (value: boolean) => { + this.generateDeveloperTokenDialogVisible = value; + }; + setClientSecret = (value: string) => { this.clientSecret = value; }; @@ -526,6 +535,7 @@ class OAuthStore implements OAuthStoreProps { this.setInfoDialogVisible(true); this.setDisableDialogVisible(false); this.setDeleteDialogVisible(false); + this.setGenerateDeveloperTokenDialogVisible(false); }; const onRevoke = () => { @@ -535,6 +545,7 @@ class OAuthStore implements OAuthStoreProps { this.setRevokeDialogVisible(true); this.setDisableDialogVisible(false); this.setDeleteDialogVisible(false); + this.setGenerateDeveloperTokenDialogVisible(false); }; const onDisable = () => { @@ -544,6 +555,17 @@ class OAuthStore implements OAuthStoreProps { this.setRevokeDialogVisible(false); this.setDisableDialogVisible(true); this.setDeleteDialogVisible(false); + this.setGenerateDeveloperTokenDialogVisible(false); + }; + + const onGenerateDevelopToken = () => { + this.setBufferSelection(clientId); + this.setPreviewDialogVisible(false); + this.setInfoDialogVisible(false); + this.setRevokeDialogVisible(false); + this.setDisableDialogVisible(false); + this.setDeleteDialogVisible(false); + this.setGenerateDeveloperTokenDialogVisible(true); }; const openOption = { @@ -598,6 +620,7 @@ class OAuthStore implements OAuthStoreProps { this.setRevokeDialogVisible(false); this.setDisableDialogVisible(false); this.setDeleteDialogVisible(true); + this.setGenerateDeveloperTokenDialogVisible(false); }; const onShowPreview = () => { @@ -607,6 +630,7 @@ class OAuthStore implements OAuthStoreProps { this.setRevokeDialogVisible(false); this.setDisableDialogVisible(false); this.setDeleteDialogVisible(false); + this.setGenerateDeveloperTokenDialogVisible(false); }; const onEnable = async (status: boolean) => { @@ -615,6 +639,7 @@ class OAuthStore implements OAuthStoreProps { this.setRevokeDialogVisible(false); this.setDisableDialogVisible(false); this.setDeleteDialogVisible(false); + this.setGenerateDeveloperTokenDialogVisible(false); if (isGroupContext) { try { @@ -673,7 +698,15 @@ class OAuthStore implements OAuthStoreProps { onClick: onDisable, }; + const generateDevelopTokenOption = { + key: "generate-token", + icon: EnableReactSvgUrl, + label: "Generate developer token", + onClick: onGenerateDevelopToken, + }; + const contextOptions = [ + { ...generateDevelopTokenOption }, { key: "Separator dropdownItem", isSeparator: true, From 7247363b02adc76762e5a208d63ee61c95b2283b Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Wed, 14 Aug 2024 11:17:01 +0300 Subject: [PATCH 046/140] Shared: Navigation: Disabled tariff bar inside sdk frame --- .../shared/components/navigation/sub-components/ControlBtn.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/shared/components/navigation/sub-components/ControlBtn.tsx b/packages/shared/components/navigation/sub-components/ControlBtn.tsx index ed362e6498..00f697c032 100644 --- a/packages/shared/components/navigation/sub-components/ControlBtn.tsx +++ b/packages/shared/components/navigation/sub-components/ControlBtn.tsx @@ -79,7 +79,8 @@ const ControlButtons = ({ onClick={onNavigationButtonClick} /> ) : null; - const children = tariffBar ? React.cloneElement(tariffBar, { title }) : null; + const children = + tariffBar && !isFrame ? React.cloneElement(tariffBar, { title }) : null; const isTabletView = isTablet(); const contextOptionsFolder = getContextOptionsFolder(); From 5994561951700b541f8e2dc07c94d0023c62c882 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Wed, 14 Aug 2024 11:35:11 +0300 Subject: [PATCH 047/140] Client: Added banners when the storage limit for a tariff is reached. --- .../client/public/locales/en/MainBar.json | 7 +- packages/client/src/components/MainBar/Bar.js | 155 ++++++++++-------- .../src/components/MainBar/QuotasBar.js | 41 ++++- packages/client/src/helpers/constants.js | 3 +- packages/shared/store/CurrentQuotaStore.ts | 13 +- 5 files changed, 146 insertions(+), 73 deletions(-) diff --git a/packages/client/public/locales/en/MainBar.json b/packages/client/public/locales/en/MainBar.json index 55ce471cc6..f43f6444c0 100644 --- a/packages/client/public/locales/en/MainBar.json +++ b/packages/client/public/locales/en/MainBar.json @@ -17,7 +17,10 @@ "UserTariffAlmostReachedForAdmins": "Once the limit is reached, all users will be added with User permissions only. To be able to add further admins/power users, <1>click here to upgrade your tariff plan.", "UserTariffAlmostReached": "Once the limit is reached, all users will be added with User permissions only. To be able to add further admins/power users, contact the DocSpace administrator to upgrade the tariff plan.", "UserTariffReachedForAdmins": "All users will be added with User permissions only. To be able to add further admins/power users, <1>click here to upgrade your tariff plan.", - "UserTariffReached": "All users will be added with User permissions only. To be able to add further admins/power users, contact the DocSpace administrator to upgrade the tariff plan.", + "UserTariffReached": "All users will be added with User permissions only. To be able to add further admins/power users, contact the {{productName}} administrator to upgrade the tariff plan.", "UserQuotaHeader": "The number of admins/power users is about to be exceeded: {{currentValue}} / {{maxValue}}.", - "UserTariffLimit": "The limit is reached for the number of admins/power users: {{currentValue}} / {{maxValue}}" + "UserTariffLimit": "The limit is reached for the number of admins/power users: {{currentValue}} / {{maxValue}}", + "StorageTariffLimit": "The limit is reached for storage space: {{currentValue}} / {{maxValue}}", + "RemoveFilesOrClickToUpgrade": "Remove the unnecessary files or <1>click here to upgrade your tariff plan.", + "RemoveFilesOrContactToUpgrade": "Remove the unnecessary files or contact the {{productName}} administrator to upgrade the tariff plan." } diff --git a/packages/client/src/components/MainBar/Bar.js b/packages/client/src/components/MainBar/Bar.js index 4ed374ec70..21721eb7b6 100644 --- a/packages/client/src/components/MainBar/Bar.js +++ b/packages/client/src/components/MainBar/Bar.js @@ -68,7 +68,7 @@ const Bar = (props) => { addedManagersCount, showRoomQuotaBar, - showStorageQuotaBar, + isStorageTariffAlmostLimit, isUserTariffAlmostLimit, currentColorScheme, @@ -77,7 +77,7 @@ const Bar = (props) => { showUserPersonalQuotaBar, tenantCustomQuota, - showTenantCustomQuotaBar, + isStorageTariffLimit, isUserTariffLimit, } = props; @@ -85,7 +85,8 @@ const Bar = (props) => { const [barVisible, setBarVisible] = useState({ roomQuota: false, - storageQuota: false, + storageTariff: false, + storageTariffLimit: false, tenantCustomQuota: false, usersTariff: false, usersTariffLimit: false, @@ -139,10 +140,17 @@ const Bar = (props) => { usersTariff: !closed.includes(QuotaBarTypes.UsersTariff), })); } + console.log( + "!closed.includes(QuotaBarTypes.StorageTariff)", + !closed.includes(QuotaBarTypes.StorageTariff), + ); if (isAdmin || isPowerUser || isRoomAdmin) { setBarVisible((value) => ({ ...value, - storageQuota: !closed.includes(QuotaBarTypes.StorageQuota), + storageTariff: !closed.includes(QuotaBarTypes.StorageTariff), + storageTariffLimit: !closed.includes( + QuotaBarTypes.StorageTariffLimit, + ), tenantCustomQuota: !closed.includes(QuotaBarTypes.TenantCustomQuota), })); } @@ -156,7 +164,8 @@ const Bar = (props) => { } else { setBarVisible({ roomQuota: isAdmin, - storageQuota: isAdmin || isPowerUser || isRoomAdmin, + storageTariff: isAdmin || isPowerUser || isRoomAdmin, + storageTariffLimit: isAdmin || isPowerUser || isRoomAdmin, tenantCustomQuota: isAdmin || isPowerUser || isRoomAdmin, usersTariff: isAdmin | isRoomAdmin, usersTariffLimit: isAdmin | isRoomAdmin, @@ -236,15 +245,18 @@ const Bar = (props) => { localStorage.setItem("barClose", JSON.stringify(closed)); switch (currentBar) { - case QuotaBarTypes.RoomQuota: - setBarVisible((value) => ({ ...value, roomQuota: false })); + // case QuotaBarTypes.RoomQuota: + // setBarVisible((value) => ({ ...value, roomQuota: false })); + // break; + case QuotaBarTypes.StorageTariff: + setBarVisible((value) => ({ ...value, storageTariff: false })); break; - case QuotaBarTypes.StorageQuota: - setBarVisible((value) => ({ ...value, storageQuota: false })); - break; - case QuotaBarTypes.TenantCustomQuota: - setBarVisible((value) => ({ ...value, tenantCustomQuota: false })); + case QuotaBarTypes.StorageTariffLimit: + setBarVisible((value) => ({ ...value, storageTariffLimit: false })); break; + // case QuotaBarTypes.TenantCustomQuota: + // setBarVisible((value) => ({ ...value, tenantCustomQuota: false })); + // break; case QuotaBarTypes.UsersTariff: setBarVisible((value) => ({ ...value, @@ -257,15 +269,15 @@ const Bar = (props) => { usersTariffLimit: false, })); break; - case QuotaBarTypes.UserAndStorageQuota: - setBarVisible((value) => ({ ...value, storageAndUserQuota: false })); - break; - case QuotaBarTypes.RoomAndStorageQuota: - setBarVisible((value) => ({ ...value, storageAndRoomQuota: false })); - break; - case QuotaBarTypes.PersonalUserQuota: - setBarVisible((value) => ({ ...value, personalUserQuota: false })); - break; + // case QuotaBarTypes.UserAndStorageQuota: + // setBarVisible((value) => ({ ...value, storageAndUserQuota: false })); + // break; + // case QuotaBarTypes.RoomAndStorageQuota: + // setBarVisible((value) => ({ ...value, storageAndRoomQuota: false })); + // break; + // case QuotaBarTypes.PersonalUserQuota: + // setBarVisible((value) => ({ ...value, personalUserQuota: false })); + // break; } setMaintenanceExist(false); @@ -285,47 +297,62 @@ const Bar = (props) => { }; const getCurrentBar = () => { - if ( - showRoomQuotaBar && - showStorageQuotaBar && - barVisible.storageAndRoomQuota - ) { - return { - type: QuotaBarTypes.RoomAndStorageQuota, - maxValue: null, - currentValue: null, - }; - } - if ( - isUserTariffAlmostLimit && - showStorageQuotaBar && - barVisible.storageAndUserQuota - ) { - return { - type: QuotaBarTypes.UserAndStorageQuota, - maxValue: null, - currentValue: null, - }; - } + // if ( + // showRoomQuotaBar && + // isStorageTariffAlmostLimit && + // barVisible.storageAndRoomQuota + // ) { + // return { + // type: QuotaBarTypes.RoomAndStorageQuota, + // maxValue: null, + // currentValue: null, + // }; + // } + // if ( + // isUserTariffAlmostLimit && + // isStorageTariffAlmostLimit && + // barVisible.storageAndUserQuota + // ) { + // return { + // type: QuotaBarTypes.UserAndStorageQuota, + // maxValue: null, + // currentValue: null, + // }; + // } - if (showRoomQuotaBar && barVisible.roomQuota) { + // if (showRoomQuotaBar && barVisible.roomQuota) { + // return { + // type: QuotaBarTypes.RoomQuota, + // maxValue: maxCountRoomsByQuota, + // currentValue: usedRoomsCount, + // }; + // } + + // if (isStorageTariffLimit && barVisible.tenantCustomQuota) { + // return { + // type: QuotaBarTypes.TenantCustomQuota, + // maxValue: getConvertedSize(t, tenantCustomQuota), + // currentValue: getConvertedSize(t, usedTotalStorageSizeCount), + // }; + // } + + console.log( + "isStorageTariffAlmostLimit", + isStorageTariffAlmostLimit, + barVisible.storageTariff, + ); + if (isStorageTariffAlmostLimit && barVisible.storageTariff) { return { - type: QuotaBarTypes.RoomQuota, - maxValue: maxCountRoomsByQuota, - currentValue: usedRoomsCount, - }; - } - if (showStorageQuotaBar && barVisible.storageQuota) { - return { - type: QuotaBarTypes.StorageQuota, + type: QuotaBarTypes.StorageTariff, maxValue: getConvertedSize(t, maxTotalSizeByQuota), currentValue: getConvertedSize(t, usedTotalStorageSizeCount), }; } - if (showTenantCustomQuotaBar && barVisible.tenantCustomQuota) { + + if (isStorageTariffLimit && barVisible.storageTariffLimit) { return { - type: QuotaBarTypes.TenantCustomQuota, - maxValue: getConvertedSize(t, tenantCustomQuota), + type: QuotaBarTypes.StorageTariffLimit, + maxValue: getConvertedSize(t, maxTotalSizeByQuota), currentValue: getConvertedSize(t, usedTotalStorageSizeCount), }; } @@ -346,11 +373,11 @@ const Bar = (props) => { }; } - if (showUserPersonalQuotaBar && barVisible.personalUserQuota) { - return { - type: QuotaBarTypes.PersonalUserQuota, - }; - } + // if (showUserPersonalQuotaBar && barVisible.personalUserQuota) { + // return { + // type: QuotaBarTypes.PersonalUserQuota, + // }; + // } return null; }; @@ -423,11 +450,11 @@ export default inject( addedManagersCount, showRoomQuotaBar, - showStorageQuotaBar, + isStorageTariffAlmostLimit, isUserTariffAlmostLimit, showUserPersonalQuotaBar, tenantCustomQuota, - showTenantCustomQuotaBar, + isStorageTariffLimit, isUserTariffLimit, } = currentQuotaStore; @@ -453,7 +480,7 @@ export default inject( addedManagersCount, showRoomQuotaBar, - showStorageQuotaBar, + isStorageTariffAlmostLimit, isUserTariffAlmostLimit, currentColorScheme, @@ -461,7 +488,7 @@ export default inject( showUserPersonalQuotaBar, tenantCustomQuota, - showTenantCustomQuotaBar, + isStorageTariffLimit, isUserTariffLimit, }; }, diff --git a/packages/client/src/components/MainBar/QuotasBar.js b/packages/client/src/components/MainBar/QuotasBar.js index 9d3a49b2f3..ac4590f779 100644 --- a/packages/client/src/components/MainBar/QuotasBar.js +++ b/packages/client/src/components/MainBar/QuotasBar.js @@ -117,7 +117,10 @@ const QuotasBar = ({ ); }; const getUserTariffAlmostLimit = () => { - if (!isAdmin) return t("UserTariffAlmostReached"); + if (!isAdmin) + return t("UserTariffAlmostReached", { + productName: t("Common:ProductName"), + }); return ( ); }; + + const getStorageTariffDescription = () => { + if (!isAdmin) + return t("RemoveFilesOrContactToUpgrade", { + productName: t("Common:ProductName"), + }); + + return ( + + ), + }} + /> + ); + }; const getQuotaInfo = () => { switch (type) { case QuotaBarTypes.RoomQuota: @@ -189,10 +217,15 @@ const QuotasBar = ({ ), }; - case QuotaBarTypes.StorageQuota: + case QuotaBarTypes.StorageTariff: return { header: t("StorageQuotaHeader", { currentValue, maxValue }), - description: getStorageQuotaDescription(), + description: getStorageTariffDescription(), + }; + case QuotaBarTypes.StorageTariffLimit: + return { + header: t("StorageTariffLimit", { currentValue, maxValue }), + description: getStorageTariffDescription(), }; case QuotaBarTypes.TenantCustomQuota: return { @@ -204,7 +237,7 @@ const QuotasBar = ({ header: t("UserQuotaHeader", { currentValue, maxValue }), description: getUserTariffAlmostLimit(), }; - case QuotaBarTypes.UsersTariffLimit: + case QuotaBarTypes.TariffLimitPerUser: return { header: t("UserTariffLimit", { currentValue, maxValue }), description: getUserTariffLimit(), diff --git a/packages/client/src/helpers/constants.js b/packages/client/src/helpers/constants.js index 7c8722ec9a..51277596ed 100644 --- a/packages/client/src/helpers/constants.js +++ b/packages/client/src/helpers/constants.js @@ -97,7 +97,8 @@ export const TableVersions = Object.freeze({ export const QuotaBarTypes = Object.freeze({ ConfirmEmail: "confirm-email", RoomQuota: "room-quota", - StorageQuota: "storage-quota", + StorageTariff: "storage-quota", + StorageTariffLimit: "storage-quota-limit", UsersTariff: "user-quota", UsersTariffLimit: "user-quota-limit", UserAndStorageQuota: "user-storage-quota", diff --git a/packages/shared/store/CurrentQuotaStore.ts b/packages/shared/store/CurrentQuotaStore.ts index fe24f099e6..f3d87984dd 100644 --- a/packages/shared/store/CurrentQuotaStore.ts +++ b/packages/shared/store/CurrentQuotaStore.ts @@ -252,10 +252,19 @@ class CurrentQuotasStore { ); } - get showStorageQuotaBar() { + get isStorageTariffAlmostLimit() { return ( (this.usedTotalStorageSizeCount / this.maxTotalSizeByQuota) * 100 >= - PERCENTAGE_FOR_SHOWING_BAR + PERCENTAGE_FOR_SHOWING_BAR && + this.usedTotalStorageSizeCount < this.maxTotalSizeByQuota + ); + } + + get isStorageTariffLimit() { + return ( + (this.usedTotalStorageSizeCount / this.maxTotalSizeByQuota) * 100 >= + PERCENTAGE_FOR_SHOWING_BAR && + this.usedTotalStorageSizeCount >= this.maxTotalSizeByQuota ); } From 01a8d48354673a771853b0669febf7b9139fe097 Mon Sep 17 00:00:00 2001 From: Akmal Isomadinov Date: Wed, 14 Aug 2024 16:07:10 +0500 Subject: [PATCH 048/140] Shared:MediaViewer Disabled context menu in viewer --- .../media-viewer/sub-components/ImageViewer/index.tsx | 1 + .../media-viewer/sub-components/PlayerBigPlayButton/index.tsx | 4 +++- .../media-viewer/sub-components/ViewerPlayer/index.tsx | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/shared/components/media-viewer/sub-components/ImageViewer/index.tsx b/packages/shared/components/media-viewer/sub-components/ImageViewer/index.tsx index 1bbd458427..9f33ad2172 100644 --- a/packages/shared/components/media-viewer/sub-components/ImageViewer/index.tsx +++ b/packages/shared/components/media-viewer/sub-components/ImageViewer/index.tsx @@ -996,6 +996,7 @@ export const ImageViewer = ({ onDoubleClick={handleDoubleTapOrClick} onLoad={imageLoaded} onError={onError} + onContextMenu={(event) => event.preventDefault()} /> diff --git a/packages/shared/components/media-viewer/sub-components/PlayerBigPlayButton/index.tsx b/packages/shared/components/media-viewer/sub-components/PlayerBigPlayButton/index.tsx index 67c79059f9..8876178cc4 100644 --- a/packages/shared/components/media-viewer/sub-components/PlayerBigPlayButton/index.tsx +++ b/packages/shared/components/media-viewer/sub-components/PlayerBigPlayButton/index.tsx @@ -36,7 +36,9 @@ export const PlayerBigPlayButton = ({ if (!visible) return; return ( - + event.preventDefault()} + > ); diff --git a/packages/shared/components/media-viewer/sub-components/ViewerPlayer/index.tsx b/packages/shared/components/media-viewer/sub-components/ViewerPlayer/index.tsx index e908d44628..3be4de5d14 100644 --- a/packages/shared/components/media-viewer/sub-components/ViewerPlayer/index.tsx +++ b/packages/shared/components/media-viewer/sub-components/ViewerPlayer/index.tsx @@ -653,6 +653,7 @@ export const ViewerPlayer = ({ onDurationChange={handleDurationChange} onLoadedMetadata={handleLoadedMetaDataVideo} onPlay={() => setIsPlaying(true)} + onContextMenu={(event) => event.preventDefault()} /> Date: Wed, 14 Aug 2024 14:46:06 +0300 Subject: [PATCH 049/140] Client: Changed translation for personal quota. --- .../client/public/locales/en/MainBar.json | 4 +- packages/client/src/components/MainBar/Bar.js | 37 ++++++-------- .../src/components/MainBar/QuotasBar.js | 49 ++++++++++++------- packages/shared/store/CurrentQuotaStore.ts | 2 +- 4 files changed, 50 insertions(+), 42 deletions(-) diff --git a/packages/client/public/locales/en/MainBar.json b/packages/client/public/locales/en/MainBar.json index f43f6444c0..a94d079d43 100644 --- a/packages/client/public/locales/en/MainBar.json +++ b/packages/client/public/locales/en/MainBar.json @@ -22,5 +22,7 @@ "UserTariffLimit": "The limit is reached for the number of admins/power users: {{currentValue}} / {{maxValue}}", "StorageTariffLimit": "The limit is reached for storage space: {{currentValue}} / {{maxValue}}", "RemoveFilesOrClickToUpgrade": "Remove the unnecessary files or <1>click here to upgrade your tariff plan.", - "RemoveFilesOrContactToUpgrade": "Remove the unnecessary files or contact the {{productName}} administrator to upgrade the tariff plan." + "RemoveFilesOrContactToUpgrade": "Remove the unnecessary files or contact the {{productName}} administrator to upgrade the tariff plan.", + "StorageQuotaPerUserExceeded": "Storage quota per user exceeded", + "PersonalStorageQuotaExceed": "Your personal storage quota exceeded" } diff --git a/packages/client/src/components/MainBar/Bar.js b/packages/client/src/components/MainBar/Bar.js index 21721eb7b6..a21a94cb26 100644 --- a/packages/client/src/components/MainBar/Bar.js +++ b/packages/client/src/components/MainBar/Bar.js @@ -74,7 +74,7 @@ const Bar = (props) => { currentColorScheme, setMainBarVisible, - showUserPersonalQuotaBar, + isPersonalQuotaLimit, tenantCustomQuota, isStorageTariffLimit, @@ -140,10 +140,7 @@ const Bar = (props) => { usersTariff: !closed.includes(QuotaBarTypes.UsersTariff), })); } - console.log( - "!closed.includes(QuotaBarTypes.StorageTariff)", - !closed.includes(QuotaBarTypes.StorageTariff), - ); + if (isAdmin || isPowerUser || isRoomAdmin) { setBarVisible((value) => ({ ...value, @@ -151,7 +148,9 @@ const Bar = (props) => { storageTariffLimit: !closed.includes( QuotaBarTypes.StorageTariffLimit, ), + tenantCustomQuota: !closed.includes(QuotaBarTypes.TenantCustomQuota), + personalUserQuota: !closed.includes(QuotaBarTypes.PersonalUserQuota), })); } @@ -172,7 +171,7 @@ const Bar = (props) => { storageAndUserQuota: isAdmin, storageAndRoomQuota: isAdmin, confirmEmail: true, - personalUserQuota: true, + personalUserQuota: isAdmin || isPowerUser || isRoomAdmin, }); } @@ -275,9 +274,9 @@ const Bar = (props) => { // case QuotaBarTypes.RoomAndStorageQuota: // setBarVisible((value) => ({ ...value, storageAndRoomQuota: false })); // break; - // case QuotaBarTypes.PersonalUserQuota: - // setBarVisible((value) => ({ ...value, personalUserQuota: false })); - // break; + case QuotaBarTypes.PersonalUserQuota: + setBarVisible((value) => ({ ...value, personalUserQuota: false })); + break; } setMaintenanceExist(false); @@ -336,11 +335,6 @@ const Bar = (props) => { // }; // } - console.log( - "isStorageTariffAlmostLimit", - isStorageTariffAlmostLimit, - barVisible.storageTariff, - ); if (isStorageTariffAlmostLimit && barVisible.storageTariff) { return { type: QuotaBarTypes.StorageTariff, @@ -372,12 +366,13 @@ const Bar = (props) => { currentValue: addedManagersCount, }; } + console.log("isPersonalQuotaLimit", isPersonalQuotaLimit); + if (isPersonalQuotaLimit && barVisible.personalUserQuota) { + return { + type: QuotaBarTypes.PersonalUserQuota, + }; + } - // if (showUserPersonalQuotaBar && barVisible.personalUserQuota) { - // return { - // type: QuotaBarTypes.PersonalUserQuota, - // }; - // } return null; }; @@ -452,7 +447,7 @@ export default inject( showRoomQuotaBar, isStorageTariffAlmostLimit, isUserTariffAlmostLimit, - showUserPersonalQuotaBar, + isPersonalQuotaLimit, tenantCustomQuota, isStorageTariffLimit, isUserTariffLimit, @@ -486,7 +481,7 @@ export default inject( currentColorScheme, setMainBarVisible, - showUserPersonalQuotaBar, + isPersonalQuotaLimit, tenantCustomQuota, isStorageTariffLimit, isUserTariffLimit, diff --git a/packages/client/src/components/MainBar/QuotasBar.js b/packages/client/src/components/MainBar/QuotasBar.js index ac4590f779..3a0dab8335 100644 --- a/packages/client/src/components/MainBar/QuotasBar.js +++ b/packages/client/src/components/MainBar/QuotasBar.js @@ -193,6 +193,33 @@ const QuotasBar = ({ /> ); }; + + const getPersonalQuotaDescription = () => { + if (!isAdmin) return t("PersonalUserQuotaDescription"); + + return ( + + ), + }} + /> + ); + }; + + const getPersonalQuotaHeader = () => { + if (!isAdmin) return t("PersonalStorageQuotaExceed"); + return t("StorageQuotaPerUserExceeded"); + }; const getQuotaInfo = () => { switch (type) { case QuotaBarTypes.RoomQuota: @@ -237,7 +264,7 @@ const QuotasBar = ({ header: t("UserQuotaHeader", { currentValue, maxValue }), description: getUserTariffAlmostLimit(), }; - case QuotaBarTypes.TariffLimitPerUser: + case QuotaBarTypes.UsersTariffLimit: return { header: t("UserTariffLimit", { currentValue, maxValue }), description: getUserTariffLimit(), @@ -253,25 +280,9 @@ const QuotasBar = ({ description: getUserQuotaDescription(), }; case QuotaBarTypes.PersonalUserQuota: - const description = !isAdmin ? ( - t("PersonalUserQuotaDescription") - ) : ( - - To upload and create new files and folders, please free up disk - space, or manage quota per user in the - - Storage management settings. - - - ); return { - header: t("StorageQuotaExceeded"), - description, + header: getPersonalQuotaHeader(), + description: getPersonalQuotaDescription(), }; default: diff --git a/packages/shared/store/CurrentQuotaStore.ts b/packages/shared/store/CurrentQuotaStore.ts index f3d87984dd..9542a4224f 100644 --- a/packages/shared/store/CurrentQuotaStore.ts +++ b/packages/shared/store/CurrentQuotaStore.ts @@ -304,7 +304,7 @@ class CurrentQuotasStore { return this.currentTariffStatusStore?.isGracePeriod; }; - get showUserPersonalQuotaBar() { + get isPersonalQuotaLimit() { const personalQuotaLimitReached = this.userStore?.personalQuotaLimitReached; if (!this.isDefaultUsersQuotaSet) return false; From f2997597fe30bdc625a5080c11d5859105bbb2e6 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Wed, 14 Aug 2024 15:36:41 +0300 Subject: [PATCH 050/140] Client: Updated bar for storage tenant quota. --- .../client/public/locales/en/MainBar.json | 1 + packages/client/src/components/MainBar/Bar.js | 51 +++++++++++++------ .../src/components/MainBar/QuotasBar.js | 9 +++- packages/client/src/helpers/constants.js | 3 +- packages/shared/store/CurrentQuotaStore.ts | 19 ++++++- 5 files changed, 62 insertions(+), 21 deletions(-) diff --git a/packages/client/public/locales/en/MainBar.json b/packages/client/public/locales/en/MainBar.json index a94d079d43..77fc67d337 100644 --- a/packages/client/public/locales/en/MainBar.json +++ b/packages/client/public/locales/en/MainBar.json @@ -23,6 +23,7 @@ "StorageTariffLimit": "The limit is reached for storage space: {{currentValue}} / {{maxValue}}", "RemoveFilesOrClickToUpgrade": "Remove the unnecessary files or <1>click here to upgrade your tariff plan.", "RemoveFilesOrContactToUpgrade": "Remove the unnecessary files or contact the {{productName}} administrator to upgrade the tariff plan.", + "RemoveFilesOrContactToUpgradeQuota": "Remove the unnecessary files or contact the {{productName}} administrator to increase the storage quota.", "StorageQuotaPerUserExceeded": "Storage quota per user exceeded", "PersonalStorageQuotaExceed": "Your personal storage quota exceeded" } diff --git a/packages/client/src/components/MainBar/Bar.js b/packages/client/src/components/MainBar/Bar.js index a21a94cb26..bc96545e21 100644 --- a/packages/client/src/components/MainBar/Bar.js +++ b/packages/client/src/components/MainBar/Bar.js @@ -79,6 +79,8 @@ const Bar = (props) => { tenantCustomQuota, isStorageTariffLimit, isUserTariffLimit, + isStorageQuotaAlmostLimit, + isStorageQuotaLimit, } = props; const navigate = useNavigate(); @@ -87,7 +89,8 @@ const Bar = (props) => { roomQuota: false, storageTariff: false, storageTariffLimit: false, - tenantCustomQuota: false, + storageQuota: false, + storageQuotaLimit: false, usersTariff: false, usersTariffLimit: false, storageAndUserQuota: false, @@ -148,8 +151,8 @@ const Bar = (props) => { storageTariffLimit: !closed.includes( QuotaBarTypes.StorageTariffLimit, ), - - tenantCustomQuota: !closed.includes(QuotaBarTypes.TenantCustomQuota), + storageQuota: !closed.includes(QuotaBarTypes.StorageQuota), + storageQuotaLimit: !closed.includes(QuotaBarTypes.StorageQuotaLimit), personalUserQuota: !closed.includes(QuotaBarTypes.PersonalUserQuota), })); } @@ -165,7 +168,8 @@ const Bar = (props) => { roomQuota: isAdmin, storageTariff: isAdmin || isPowerUser || isRoomAdmin, storageTariffLimit: isAdmin || isPowerUser || isRoomAdmin, - tenantCustomQuota: isAdmin || isPowerUser || isRoomAdmin, + storageQuota: isAdmin || isPowerUser || isRoomAdmin, + storageQuotaLimit: isAdmin || isPowerUser || isRoomAdmin, usersTariff: isAdmin | isRoomAdmin, usersTariffLimit: isAdmin | isRoomAdmin, storageAndUserQuota: isAdmin, @@ -216,7 +220,7 @@ const Bar = (props) => { }; const onClickQuota = (type, e) => { - type === QuotaBarTypes.TenantCustomQuota || + type === QuotaBarTypes.StorageQuota || type === QuotaBarTypes.PersonalUserQuota ? onClickTenantCustomQuota() : onPaymentsClick(e); @@ -253,9 +257,12 @@ const Bar = (props) => { case QuotaBarTypes.StorageTariffLimit: setBarVisible((value) => ({ ...value, storageTariffLimit: false })); break; - // case QuotaBarTypes.TenantCustomQuota: - // setBarVisible((value) => ({ ...value, tenantCustomQuota: false })); - // break; + case QuotaBarTypes.StorageQuota: + setBarVisible((value) => ({ ...value, storageQuota: false })); + break; + case QuotaBarTypes.StorageQuotaLimit: + setBarVisible((value) => ({ ...value, storageQuotaLimit: false })); + break; case QuotaBarTypes.UsersTariff: setBarVisible((value) => ({ ...value, @@ -327,13 +334,21 @@ const Bar = (props) => { // }; // } - // if (isStorageTariffLimit && barVisible.tenantCustomQuota) { - // return { - // type: QuotaBarTypes.TenantCustomQuota, - // maxValue: getConvertedSize(t, tenantCustomQuota), - // currentValue: getConvertedSize(t, usedTotalStorageSizeCount), - // }; - // } + if (isStorageQuotaAlmostLimit && barVisible.storageQuota) { + return { + type: QuotaBarTypes.StorageQuota, + maxValue: getConvertedSize(t, tenantCustomQuota), + currentValue: getConvertedSize(t, usedTotalStorageSizeCount), + }; + } + + if (isStorageQuotaLimit && barVisible.storageQuotaLimit) { + return { + type: QuotaBarTypes.StorageQuotaLimit, + maxValue: getConvertedSize(t, tenantCustomQuota), + currentValue: getConvertedSize(t, usedTotalStorageSizeCount), + }; + } if (isStorageTariffAlmostLimit && barVisible.storageTariff) { return { @@ -366,7 +381,7 @@ const Bar = (props) => { currentValue: addedManagersCount, }; } - console.log("isPersonalQuotaLimit", isPersonalQuotaLimit); + if (isPersonalQuotaLimit && barVisible.personalUserQuota) { return { type: QuotaBarTypes.PersonalUserQuota, @@ -451,6 +466,8 @@ export default inject( tenantCustomQuota, isStorageTariffLimit, isUserTariffLimit, + isStorageQuotaAlmostLimit, + isStorageQuotaLimit, } = currentQuotaStore; const { currentColorScheme, setMainBarVisible } = settingsStore; @@ -485,6 +502,8 @@ export default inject( tenantCustomQuota, isStorageTariffLimit, isUserTariffLimit, + isStorageQuotaAlmostLimit, + isStorageQuotaLimit, }; }, )(withTranslation(["Profile", "Common"])(observer(Bar))); diff --git a/packages/client/src/components/MainBar/QuotasBar.js b/packages/client/src/components/MainBar/QuotasBar.js index 3a0dab8335..987ae1b3a0 100644 --- a/packages/client/src/components/MainBar/QuotasBar.js +++ b/packages/client/src/components/MainBar/QuotasBar.js @@ -76,7 +76,7 @@ const QuotasBar = ({ ); }; const getTenantCustomQuota = () => { - if (!isAdmin) return t("StorageQuotaUserDescription"); + if (!isAdmin) return t("RemoveFilesOrContactToUpgradeQuota"); return ( @@ -254,11 +254,16 @@ const QuotasBar = ({ header: t("StorageTariffLimit", { currentValue, maxValue }), description: getStorageTariffDescription(), }; - case QuotaBarTypes.TenantCustomQuota: + case QuotaBarTypes.StorageQuota: return { header: t("StorageQuotaHeader", { currentValue, maxValue }), description: getTenantCustomQuota(), }; + case QuotaBarTypes.StorageQuotaLimit: + return { + header: t("StorageTariffLimit", { currentValue, maxValue }), + description: getTenantCustomQuota(), + }; case QuotaBarTypes.UsersTariff: return { header: t("UserQuotaHeader", { currentValue, maxValue }), diff --git a/packages/client/src/helpers/constants.js b/packages/client/src/helpers/constants.js index 51277596ed..a882281fd1 100644 --- a/packages/client/src/helpers/constants.js +++ b/packages/client/src/helpers/constants.js @@ -104,7 +104,8 @@ export const QuotaBarTypes = Object.freeze({ UserAndStorageQuota: "user-storage-quota", RoomAndStorageQuota: "room-storage-quota", PersonalUserQuota: "personal-user-quota", - TenantCustomQuota: "tenant-custom-quota", + StorageQuota: "tenant-custom-quota", + StorageQuotaLimit: "tenant-custom-quota-limit", }); export const BINDING_POST = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"; diff --git a/packages/shared/store/CurrentQuotaStore.ts b/packages/shared/store/CurrentQuotaStore.ts index 9542a4224f..81f5834f15 100644 --- a/packages/shared/store/CurrentQuotaStore.ts +++ b/packages/shared/store/CurrentQuotaStore.ts @@ -268,7 +268,8 @@ class CurrentQuotasStore { ); } - get showTenantCustomQuotaBar() { + // For standalone mode + get isStorageQuotaAlmostLimit() { if (!this.isTenantCustomQuotaSet || this.tenantCustomQuota === undefined) return false; @@ -276,7 +277,21 @@ class CurrentQuotasStore { return ( (this.usedTotalStorageSizeCount / this.tenantCustomQuota) * 100 >= - PERCENTAGE_FOR_SHOWING_BAR + PERCENTAGE_FOR_SHOWING_BAR && + this.tenantCustomQuota > this.usedTotalStorageSizeCount + ); + } + + get isStorageQuotaLimit() { + if (!this.isTenantCustomQuotaSet || this.tenantCustomQuota === undefined) + return false; + + if (+this.tenantCustomQuota === -1) return false; + + return ( + (this.usedTotalStorageSizeCount / this.tenantCustomQuota) * 100 >= + PERCENTAGE_FOR_SHOWING_BAR && + this.tenantCustomQuota <= this.usedTotalStorageSizeCount ); } From 921ff8dc718a51f7daeee9f0a10f74aad1a0d1ce Mon Sep 17 00:00:00 2001 From: Akmal Isomadinov Date: Wed, 14 Aug 2024 17:47:20 +0500 Subject: [PATCH 051/140] Shared:MediaViewer Fixed: player rewind functionality --- .../media-viewer/sub-components/ViewerPlayer/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/shared/components/media-viewer/sub-components/ViewerPlayer/index.tsx b/packages/shared/components/media-viewer/sub-components/ViewerPlayer/index.tsx index 3be4de5d14..2845b7db6d 100644 --- a/packages/shared/components/media-viewer/sub-components/ViewerPlayer/index.tsx +++ b/packages/shared/components/media-viewer/sub-components/ViewerPlayer/index.tsx @@ -406,6 +406,10 @@ export const ViewerPlayer = ({ const percent = Number(event.target.value); const newCurrentTime = (percent / 100) * videoRef.current.duration; + const videoCurrentTime = videoRef.current.currentTime; + + if (Math.abs(newCurrentTime - videoCurrentTime) <= 0.1) return; + handleProgress(); setTimeline(percent); setCurrentTime(newCurrentTime); From 76c47dcedbbe2ff00ee45da7cfdb9e52bc6b4c4f Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Wed, 14 Aug 2024 16:37:10 +0300 Subject: [PATCH 052/140] Client: Updated bar for user and storage. --- .../client/public/locales/en/MainBar.json | 13 ++-- packages/client/src/components/MainBar/Bar.js | 69 +++++++++++++------ .../src/components/MainBar/QuotasBar.js | 46 ++++++++++--- packages/client/src/helpers/constants.js | 3 +- packages/shared/store/CurrentQuotaStore.ts | 5 ++ 5 files changed, 101 insertions(+), 35 deletions(-) diff --git a/packages/client/public/locales/en/MainBar.json b/packages/client/public/locales/en/MainBar.json index 77fc67d337..b7dfbb1dca 100644 --- a/packages/client/public/locales/en/MainBar.json +++ b/packages/client/public/locales/en/MainBar.json @@ -8,7 +8,8 @@ "RoomQuotaDescription": "You can archive the unnecessary rooms or <1>{{clickHere}} to find a more suitable pricing plan for your {{productName}}.", "RoomQuotaHeader": "The number of rooms is about to be exceeded: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Storage and rooms limits are about to be exceeded.", - "StorageAndUserHeader": "Storage and admins/power users limits are about to be exceeded.", + "StorageAndUserHeader": "The limit for storage space and the number of admins/power users is about to be exceeded.", + "StorageAndUserTariffLimitHeader": "The limit is reached for storage space and the number of admins/power users ", "StorageQuotaDescription": "You can remove the unnecessary files or <1>{{clickHere}} to find a more suitable pricing plan for your {{productName}}.", "StorageQuotaExceeded": "Storage quota exceeded", "StorageQuotaHeader": "Storage space amount is about to be exceeded: {{currentValue}} / {{maxValue}}", @@ -19,11 +20,13 @@ "UserTariffReachedForAdmins": "All users will be added with User permissions only. To be able to add further admins/power users, <1>click here to upgrade your tariff plan.", "UserTariffReached": "All users will be added with User permissions only. To be able to add further admins/power users, contact the {{productName}} administrator to upgrade the tariff plan.", "UserQuotaHeader": "The number of admins/power users is about to be exceeded: {{currentValue}} / {{maxValue}}.", - "UserTariffLimit": "The limit is reached for the number of admins/power users: {{currentValue}} / {{maxValue}}", - "StorageTariffLimit": "The limit is reached for storage space: {{currentValue}} / {{maxValue}}", + "UserTariffLimitHeader": "The limit is reached for the number of admins/power users: {{currentValue}} / {{maxValue}}", + "StorageLimitHeader": "The limit is reached for storage space: {{currentValue}} / {{maxValue}}", "RemoveFilesOrClickToUpgrade": "Remove the unnecessary files or <1>click here to upgrade your tariff plan.", "RemoveFilesOrContactToUpgrade": "Remove the unnecessary files or contact the {{productName}} administrator to upgrade the tariff plan.", "RemoveFilesOrContactToUpgradeQuota": "Remove the unnecessary files or contact the {{productName}} administrator to increase the storage quota.", - "StorageQuotaPerUserExceeded": "Storage quota per user exceeded", - "PersonalStorageQuotaExceed": "Your personal storage quota exceeded" + "PersonalQuotaHeaderForAdmins": "Storage quota per user exceeded", + "PersonalQuotaHeader": "Your personal storage quota exceeded", + "ClickToUpgradeTariff": "<1>Click here to upgrade your tariff plan.", + "ContactToUpgradeTariff": "Contact the {{productName}} administrator to upgrade the tariff plan." } diff --git a/packages/client/src/components/MainBar/Bar.js b/packages/client/src/components/MainBar/Bar.js index bc96545e21..b85645ee70 100644 --- a/packages/client/src/components/MainBar/Bar.js +++ b/packages/client/src/components/MainBar/Bar.js @@ -93,7 +93,8 @@ const Bar = (props) => { storageQuotaLimit: false, usersTariff: false, usersTariffLimit: false, - storageAndUserQuota: false, + storageAndUserTariff: false, + storageAndUserTariffLimit: false, storageAndRoomQuota: false, confirmEmail: false, personalUserQuota: false, @@ -128,10 +129,7 @@ const Bar = (props) => { roomQuota: !closed.includes(QuotaBarTypes.RoomQuota), storageAndRoomQuota: !closed.includes( - QuotaBarTypes.UserAndStorageQuota, - ), - storageAndUserQuota: !closed.includes( - QuotaBarTypes.RoomAndStorageQuota, + QuotaBarTypes.UserAndStorageTariff, ), })); } @@ -141,6 +139,12 @@ const Bar = (props) => { ...value, usersTariffLimit: !closed.includes(QuotaBarTypes.UsersTariffLimit), usersTariff: !closed.includes(QuotaBarTypes.UsersTariff), + storageAndUserTariff: !closed.includes( + QuotaBarTypes.UserAndStorageTariff, + ), + storageAndUserTariffLimit: !closed.includes( + QuotaBarTypes.UserAndStorageTariffLimit, + ), })); } @@ -172,7 +176,8 @@ const Bar = (props) => { storageQuotaLimit: isAdmin || isPowerUser || isRoomAdmin, usersTariff: isAdmin | isRoomAdmin, usersTariffLimit: isAdmin | isRoomAdmin, - storageAndUserQuota: isAdmin, + storageAndUserTariff: isAdmin | isRoomAdmin, + storageAndUserTariffLimit: isAdmin | isRoomAdmin, storageAndRoomQuota: isAdmin, confirmEmail: true, personalUserQuota: isAdmin || isPowerUser || isRoomAdmin, @@ -275,9 +280,15 @@ const Bar = (props) => { usersTariffLimit: false, })); break; - // case QuotaBarTypes.UserAndStorageQuota: - // setBarVisible((value) => ({ ...value, storageAndUserQuota: false })); - // break; + case QuotaBarTypes.UserAndStorageTariff: + setBarVisible((value) => ({ ...value, storageAndUserTariff: false })); + break; + case QuotaBarTypes.UserAndStorageTariffLimit: + setBarVisible((value) => ({ + ...value, + storageAndUserTariffLimit: false, + })); + break; // case QuotaBarTypes.RoomAndStorageQuota: // setBarVisible((value) => ({ ...value, storageAndRoomQuota: false })); // break; @@ -314,18 +325,34 @@ const Bar = (props) => { // currentValue: null, // }; // } - // if ( - // isUserTariffAlmostLimit && - // isStorageTariffAlmostLimit && - // barVisible.storageAndUserQuota - // ) { - // return { - // type: QuotaBarTypes.UserAndStorageQuota, - // maxValue: null, - // currentValue: null, - // }; - // } - + console.log( + "isUserTariffAlmostLimit", + isUserTariffAlmostLimit, + isStorageTariffAlmostLimit, + barVisible.storageAndUserTariff, + ); + if ( + isUserTariffAlmostLimit && + isStorageTariffAlmostLimit && + barVisible.storageAndUserTariff + ) { + return { + type: QuotaBarTypes.UserAndStorageTariff, + maxValue: null, + currentValue: null, + }; + } + if ( + isUserTariffLimit && + isStorageTariffLimit && + barVisible.storageAndUserTariffLimit + ) { + return { + type: QuotaBarTypes.UserAndStorageTariffLimit, + maxValue: null, + currentValue: null, + }; + } // if (showRoomQuotaBar && barVisible.roomQuota) { // return { // type: QuotaBarTypes.RoomQuota, diff --git a/packages/client/src/components/MainBar/QuotasBar.js b/packages/client/src/components/MainBar/QuotasBar.js index 987ae1b3a0..3da38d4f5d 100644 --- a/packages/client/src/components/MainBar/QuotasBar.js +++ b/packages/client/src/components/MainBar/QuotasBar.js @@ -217,8 +217,33 @@ const QuotasBar = ({ }; const getPersonalQuotaHeader = () => { - if (!isAdmin) return t("PersonalStorageQuotaExceed"); - return t("StorageQuotaPerUserExceeded"); + if (!isAdmin) return t("PersonalQuotaHeader"); + return t("PersonalQuotaHeaderForAdmins"); + }; + + const getUpgradeTariffDescription = () => { + if (!isAdmin) + return t("ContactToUpgradeTariff", { + productName: t("Common:ProductName"), + }); + + return ( + + ), + }} + /> + ); }; const getQuotaInfo = () => { switch (type) { @@ -251,7 +276,7 @@ const QuotasBar = ({ }; case QuotaBarTypes.StorageTariffLimit: return { - header: t("StorageTariffLimit", { currentValue, maxValue }), + header: t("StorageLimitHeader", { currentValue, maxValue }), description: getStorageTariffDescription(), }; case QuotaBarTypes.StorageQuota: @@ -261,7 +286,7 @@ const QuotasBar = ({ }; case QuotaBarTypes.StorageQuotaLimit: return { - header: t("StorageTariffLimit", { currentValue, maxValue }), + header: t("StorageLimitHeader", { currentValue, maxValue }), description: getTenantCustomQuota(), }; case QuotaBarTypes.UsersTariff: @@ -271,13 +296,18 @@ const QuotasBar = ({ }; case QuotaBarTypes.UsersTariffLimit: return { - header: t("UserTariffLimit", { currentValue, maxValue }), + header: t("UserTariffLimitHeader", { currentValue, maxValue }), description: getUserTariffLimit(), }; - case QuotaBarTypes.UserAndStorageQuota: + case QuotaBarTypes.UserAndStorageTariff: return { - header: t("StorageAndUserHeader", { currentValue, maxValue }), - description: getUserQuotaDescription(), + header: t("StorageAndUserHeader"), + description: getUpgradeTariffDescription(), + }; + case QuotaBarTypes.UserAndStorageTariffLimit: + return { + header: t("StorageAndUserTariffLimitHeader"), + description: getUpgradeTariffDescription(), }; case QuotaBarTypes.RoomAndStorageQuota: return { diff --git a/packages/client/src/helpers/constants.js b/packages/client/src/helpers/constants.js index a882281fd1..de55a43626 100644 --- a/packages/client/src/helpers/constants.js +++ b/packages/client/src/helpers/constants.js @@ -101,7 +101,8 @@ export const QuotaBarTypes = Object.freeze({ StorageTariffLimit: "storage-quota-limit", UsersTariff: "user-quota", UsersTariffLimit: "user-quota-limit", - UserAndStorageQuota: "user-storage-quota", + UserAndStorageTariff: "user-storage-quota", + UserAndStorageTariffLimit: "user-storage-quota-limit", RoomAndStorageQuota: "room-storage-quota", PersonalUserQuota: "personal-user-quota", StorageQuota: "tenant-custom-quota", diff --git a/packages/shared/store/CurrentQuotaStore.ts b/packages/shared/store/CurrentQuotaStore.ts index 81f5834f15..4c664eb3f6 100644 --- a/packages/shared/store/CurrentQuotaStore.ts +++ b/packages/shared/store/CurrentQuotaStore.ts @@ -296,6 +296,11 @@ class CurrentQuotasStore { } get isUserTariffAlmostLimit() { + console.log( + "isUserTariffAlmostLimit", + this.addedManagersCount, + this.maxCountManagersByQuota, + ); return ( this.addedManagersCount > 1 && this.maxCountManagersByQuota - this.addedManagersCount <= From 2ba823d7c831d5e5a754376aec8a4e3713bb5eb8 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Wed, 14 Aug 2024 17:03:15 +0300 Subject: [PATCH 053/140] Delete useless translations. --- .../client/public/locales/ar-SA/MainBar.json | 3 --- .../client/public/locales/az/MainBar.json | 3 --- .../client/public/locales/bg/MainBar.json | 3 --- .../client/public/locales/cs/MainBar.json | 3 --- .../client/public/locales/de/MainBar.json | 3 --- .../client/public/locales/el-GR/MainBar.json | 3 --- .../client/public/locales/en/MainBar.json | 3 --- .../client/public/locales/es/MainBar.json | 3 --- .../client/public/locales/fi/MainBar.json | 3 --- .../client/public/locales/fr/MainBar.json | 3 --- .../client/public/locales/hy-AM/MainBar.json | 3 --- .../client/public/locales/it/MainBar.json | 3 --- .../client/public/locales/ja-JP/MainBar.json | 3 --- .../client/public/locales/ko-KR/MainBar.json | 3 --- .../client/public/locales/lo-LA/MainBar.json | 2 -- .../client/public/locales/lv/MainBar.json | 3 --- .../client/public/locales/nl/MainBar.json | 3 --- .../client/public/locales/pl/MainBar.json | 3 --- .../client/public/locales/pt-BR/MainBar.json | 3 --- .../client/public/locales/pt/MainBar.json | 3 --- .../client/public/locales/ro/MainBar.json | 3 --- .../client/public/locales/ru/MainBar.json | 3 --- .../client/public/locales/si/MainBar.json | 2 -- .../client/public/locales/sk/MainBar.json | 3 --- .../client/public/locales/sl/MainBar.json | 3 --- .../public/locales/sr-Cyrl-RS/MainBar.json | 3 --- .../public/locales/sr-Latn-RS/MainBar.json | 3 --- .../client/public/locales/tr/MainBar.json | 3 --- .../client/public/locales/uk-UA/MainBar.json | 3 --- .../client/public/locales/vi/MainBar.json | 3 --- .../client/public/locales/zh-CN/MainBar.json | 3 --- .../src/components/MainBar/QuotasBar.js | 22 ------------------- 32 files changed, 113 deletions(-) diff --git a/packages/client/public/locales/ar-SA/MainBar.json b/packages/client/public/locales/ar-SA/MainBar.json index 32e5421c71..e585a96e73 100644 --- a/packages/client/public/locales/ar-SA/MainBar.json +++ b/packages/client/public/locales/ar-SA/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "عدد الغرف على وشك أن يتجاوز: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "حدود مساحة التخزين والغرف على وشك أن يتم تجاوزها.", "StorageAndUserHeader": "حدود مساحة التخزين والمشرفين / المستخدمين المتميزين على وشك أن يتم تجاوزها.", - "StorageQuotaDescription": "يمكنك إزالة الملفات غير الضرورية أو <1> {{clickHere}} للعثور على خطة تسعير أكثر ملاءمة لـ {{productName}} الخاص بك.", - "StorageQuotaExceeded": "تم تجاوز حصة التخزين", "StorageQuotaHeader": "حجم مساحة التخزين على وشك أن يتم تجاوزها: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "يمكنك إزالة الملفات غير الضرورية لتحرير مساحة القرص.", "TenantCustomQuotaDescription": "يمكنك إزالة الملفات غير الضرورية أو تغيير الحصة النسبية في <1> إعدادات إدارة التخزين.", "UserQuotaHeader": "عدد المشرفين المستخدمين المتميزين على وشك أن يتم تجاوزه: {{currentValue}} / {{maxValue}}" } diff --git a/packages/client/public/locales/az/MainBar.json b/packages/client/public/locales/az/MainBar.json index 7512be97c8..76526201bf 100644 --- a/packages/client/public/locales/az/MainBar.json +++ b/packages/client/public/locales/az/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Otaqlar keçmək üzrədir: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Yaddaş və otaq limitləri aşmaq üzrədir.", "StorageAndUserHeader": "Yaddaş və administratorlar/ekspert istifadəçilər limitləri aşmaq üzrədir.", - "StorageQuotaDescription": "Siz lazımsız faylları silə və ya {{productName}} üçün daha uyğun qiymət planı tapmaq üçün <1>{{clickHere}} edə bilərsiniz.", - "StorageQuotaExceeded": "Yaddaş kvotası limiti keçib", "StorageQuotaHeader": "Yaddaş sahəsinin həcmi keçmək üzrədir : {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Diskdə yer boşaltmaq üçün lazımsız faylları silə bilərsiniz.", "TenantCustomQuotaDescription": "<1>Yaddaş idarəetmə parametrlərində lazımsız faylları silə və ya kvotanı dəyişə bilərsiniz.", "UserQuotaHeader": "Admin/ekspert istifadəçilərin sayı keçmək üzrədir: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/bg/MainBar.json b/packages/client/public/locales/bg/MainBar.json index 1edc75727e..a84219e25f 100644 --- a/packages/client/public/locales/bg/MainBar.json +++ b/packages/client/public/locales/bg/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Стаите са на път да бъдат надвишени: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "На път сте да превишите ограниченията за съхранение и помещения.", "StorageAndUserHeader": "На път сте да превишите ограниченията за съхранение и администратори/опитни потребители.", - "StorageQuotaDescription": "Можете да премахнете ненужните файлове или <1>{{clickHere}}, за да намерите по-подходящ ценови план за вашия {{productName}}.", - "StorageQuotaExceeded": "Квотата за съхранение е надвишена", "StorageQuotaHeader": "Размерът на пространството за съхранение е на път да бъде надвишен: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Можете да премахнете ненужните файлове, за да освободите дисково пространство.", "TenantCustomQuotaDescription": "Можете да премахнете ненужните файлове или да промените квотата от <1>Настройки за управление на хранилището.", "UserQuotaHeader": "На път сте да превишите броят на администраторите/опитните потребители: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/cs/MainBar.json b/packages/client/public/locales/cs/MainBar.json index d8e240839f..73deea3057 100644 --- a/packages/client/public/locales/cs/MainBar.json +++ b/packages/client/public/locales/cs/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Počet místností bude brzy překročen: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Limity úložiště a místností budou brzy překročeny.", "StorageAndUserHeader": "Limity pro úložiště a správce/oprávněné uživatele budou brzy překročeny.", - "StorageQuotaDescription": "Nepotřebné soubory můžete odstranit nebo <1>{{clickHere}}} pro nalezení vhodnějšího cenového tarifu pro váš {{productName}}.", - "StorageQuotaExceeded": "Překročení kvóty úložiště", "StorageQuotaHeader": "Množství úložného prostoru bude brzy překročeno: {{currentValue}} / {{maxValue}}.", - "StorageQuotaUserDescription": "Nepotřebné soubory můžete odstranit a uvolnit tak místo na disku.", "TenantCustomQuotaDescription": "Nepotřebné soubory můžete odstranit nebo změnit kvótu v <1>Nastavení správy úložiště.", "UserQuotaHeader": "Počet administrátorů/přístupných uživatelů bude brzy překročen: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/de/MainBar.json b/packages/client/public/locales/de/MainBar.json index ffe0b4bbbd..e890c24282 100644 --- a/packages/client/public/locales/de/MainBar.json +++ b/packages/client/public/locales/de/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Die Anzahl von Räumen wird bald überschritten sein: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Die Speicher- und Raumlimits werden bald überschritten sein.", "StorageAndUserHeader": "Limits für Speicherplatz und Admins/Power-User werden bald überschritten sein.", - "StorageQuotaDescription": "Sie können die unerwünschten Dateien entfernen oder <1>{{{clickHere}} einen geeigneteren Preisplan für Ihren {{productName}} finden.", - "StorageQuotaExceeded": "Speicherquote überschritten", "StorageQuotaHeader": "Das Speicherplatzlimit wird bald überschritten: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Sie können die nicht benötigten Dateien entfernen, um Speicherplatz freizugeben.", "TenantCustomQuotaDescription": "Sie können unnötige Dateien entfernen oder die Quote in den <1>Speicherverwaltungseinstellungen ändern", "UserQuotaHeader": "Die Anzahl der Admins/Power-User wird bald überschritten sein: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/el-GR/MainBar.json b/packages/client/public/locales/el-GR/MainBar.json index 7929aec0f6..278fd442de 100644 --- a/packages/client/public/locales/el-GR/MainBar.json +++ b/packages/client/public/locales/el-GR/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Πρόκειται να γίνει υπέρβαση ορίου για τα δωμάτια: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Τα όρια αποθηκευτικού χώρου και δωματίων πρόκειται να ξεπεραστούν.", "StorageAndUserHeader": "Τα όρια αποθηκευτικού χώρου και διαχειριστών/χρηστών ισχύος πρόκειται να ξεπεραστούν.", - "StorageQuotaDescription": "Μπορείτε να αφαιρέσετε τα περιττά αρχεία ή <1>{{clickHere}} για να βρείτε ένα πιο κατάλληλο πρόγραμμα τιμολόγησης για το {{productName}} σας.", - "StorageQuotaExceeded": "Υπέρβαση ποσόστωσης αποθ. χώρου", "StorageQuotaHeader": "Το ποσό του χώρου αποθήκευσης πρόκειται να ξεπεραστεί: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Μπορείτε να αφαιρέσετε τα περιττά αρχεία για να ελευθερώσετε χώρο στον δίσκο.", "TenantCustomQuotaDescription": "Μπορείτε να αφαιρέσετε τα περιττά αρχεία ή να αλλάξετε την ποσόστωση στις <1>Ρυθμίσεις διαχείρισης αποθ. χώρου.", "UserQuotaHeader": "Ο αριθμός των διαχειριστών/χρηστών ισχύος πρόκειται να ξεπεραστεί: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/en/MainBar.json b/packages/client/public/locales/en/MainBar.json index b7dfbb1dca..b109ff1e83 100644 --- a/packages/client/public/locales/en/MainBar.json +++ b/packages/client/public/locales/en/MainBar.json @@ -10,10 +10,7 @@ "StorageAndRoomHeader": "Storage and rooms limits are about to be exceeded.", "StorageAndUserHeader": "The limit for storage space and the number of admins/power users is about to be exceeded.", "StorageAndUserTariffLimitHeader": "The limit is reached for storage space and the number of admins/power users ", - "StorageQuotaDescription": "You can remove the unnecessary files or <1>{{clickHere}} to find a more suitable pricing plan for your {{productName}}.", - "StorageQuotaExceeded": "Storage quota exceeded", "StorageQuotaHeader": "Storage space amount is about to be exceeded: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "You can remove the unnecessary files to free up disk space.", "TenantCustomQuotaDescription": "You can remove the unnecessary files or change quota in the <1>Storage management settings.", "UserTariffAlmostReachedForAdmins": "Once the limit is reached, all users will be added with User permissions only. To be able to add further admins/power users, <1>click here to upgrade your tariff plan.", "UserTariffAlmostReached": "Once the limit is reached, all users will be added with User permissions only. To be able to add further admins/power users, contact the DocSpace administrator to upgrade the tariff plan.", diff --git a/packages/client/public/locales/es/MainBar.json b/packages/client/public/locales/es/MainBar.json index fe918a6b54..d05cc4ae7c 100644 --- a/packages/client/public/locales/es/MainBar.json +++ b/packages/client/public/locales/es/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Las salas están a punto de excederse: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Los límites de almacenamiento y de salas están a punto de excederse.", "StorageAndUserHeader": "Los límites de almacenamiento y de administradores/usuarios avanzados están a punto de excederse.", - "StorageQuotaDescription": "Puede eliminar los archivos innecesarios o <1>{{clickHere}} para encontrar un plan de precios más adecuado para su {{productName}}.", - "StorageQuotaExceeded": "Se ha superado la cuota de almacenamiento", "StorageQuotaHeader": "La cantidad de espacio de almacenamiento está a punto de excederse: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Puede eliminar los archivos innecesarios para liberar espacio en disco.", "TenantCustomQuotaDescription": "Puede eliminar los archivos innecesarios o cambiar la cuota en la <1>Configuración de administración de almacenamiento.", "UserQuotaHeader": "El número de administradores/usuarios avanzados está a punto de excederse: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/fi/MainBar.json b/packages/client/public/locales/fi/MainBar.json index fca964ab01..e91336630b 100644 --- a/packages/client/public/locales/fi/MainBar.json +++ b/packages/client/public/locales/fi/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Huoneet täyttyvät pian {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Muisti ja huoneiden määrän raja on ylittymässä. ", "StorageAndUserHeader": "Muisti ja ylläpitäjien/tehokäyttäjien määrän raja on ylittymässä.", - "StorageQuotaDescription": "Voit poistaa tarpeettomat tiedostot tai <1>{{clickHere}} löytääksesi sopivamman hintaohjelman {{productName}}-llesi.", - "StorageQuotaExceeded": "Muistin kiintiö ylitetty", "StorageQuotaHeader": "Tallennustilan määrä on ylittymässä: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Voit poistaa tarpeettomat tiedostot vapauttaaksesi levytilaa.", "TenantCustomQuotaDescription": "Voit poistaa tarpeettomat tiedostot tai muuttaa kiintiötä <1>Muistinhallinta-asetuksissa.", "UserQuotaHeader": "Ylläpitäjien/tehokäyttäjien määrän raja on ylittymässä: {{currentValue}} / {{maxValue}}" } diff --git a/packages/client/public/locales/fr/MainBar.json b/packages/client/public/locales/fr/MainBar.json index 35e58a087a..7dd6f75150 100644 --- a/packages/client/public/locales/fr/MainBar.json +++ b/packages/client/public/locales/fr/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Salles est sur le point d’être dépassée : {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Les limites de stockage et de salles sont sur le point d’être dépassées.", "StorageAndUserHeader": "Les limites de stockage et d'administrateurs/utilisateurs avancés sont sur le point d'être dépassées.", - "StorageQuotaDescription": "Vous pouvez supprimer les fichiers inutiles ou <1>{{clickHere}} pour trouver un plan tarifaire plus adapté à votre {{productName}}.", - "StorageQuotaExceeded": "Quota de stockage est dépassé", "StorageQuotaHeader": "L’espace de stockage est sur le point d’être dépassé : {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Vous pouvez supprimer les fichiers inutiles pour libérer de l'espace disque.", "TenantCustomQuotaDescription": "Vous pouvez supprimer les fichiers inutiles ou modifier le quota dans la section <1>Paramètres de gestion du stockage.", "UserQuotaHeader": "Le nombre d'administrateurs/utilisateurs avancés est sur le point d'être dépassé : {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/hy-AM/MainBar.json b/packages/client/public/locales/hy-AM/MainBar.json index b123eac882..c65ec559cd 100644 --- a/packages/client/public/locales/hy-AM/MainBar.json +++ b/packages/client/public/locales/hy-AM/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Սենյակները շուտով գերազանցելու են՝ {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Պահեստի և սենյակների սահմանաչափերը շուտով կգերազանցվեն:", "StorageAndUserHeader": "Պահպանման և ադմինիստրատորների/հզոր օգտագործողների սահմանաչափերը շուտով կգերազանցվեն:", - "StorageQuotaDescription": "Դուք կարող եք հեռացնել ավելորդ ֆայլերը կամ <1>{{clickHere}}՝ ձեր {{productName}}-ի համար ավելի հարմար գնային պլան գտնելու համար:", - "StorageQuotaExceeded": "Պահպանման սահմանաչափը գերազանցվել է", "StorageQuotaHeader": "Պահեստային տարածքի քանակը քիչ է մնում գերազանցվի՝ {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Դուք կարող եք հեռացնել ավելորդ ֆայլերը՝ սկավառակի տարածքը ազատելու համար:", "TenantCustomQuotaDescription": "Դուք կարող եք հեռացնել ավելորդ ֆայլերը կամ փոխել սահմանաչափը <1>Պահպանման կառավարման կարգավորումներ:", "UserQuotaHeader": "Ադմինիստրատորների/հզոր օգտատերերի թիվը պատրաստվում է գերազանցել՝ {{currentValue}} / {{maxValue}}:" } diff --git a/packages/client/public/locales/it/MainBar.json b/packages/client/public/locales/it/MainBar.json index 7c5078eaf6..ce1ca7a592 100644 --- a/packages/client/public/locales/it/MainBar.json +++ b/packages/client/public/locales/it/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Sta per essere superato il limite di stanze: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "I limiti di spazio di archiviazione e stanze stanno per essere superati.", "StorageAndUserHeader": "I limiti di spazio di archiviazione e amministratori/utenti esperti stanno per essere superati.", - "StorageQuotaDescription": "Puoi rimuovere i file non necessari o <1>{{clickHere}} per trovare un piano tariffario più adatto per il tuo {{productName}}.", - "StorageQuotaExceeded": "Quota di archiviazione superata", "StorageQuotaHeader": "Lo spazio di archiviazione sta per essere esaurito: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Puoi rimuovere i file non necessari per liberare spazio sul disco.", "TenantCustomQuotaDescription": "Puoi rimuovere i file non necessari o modificare la quota nelle <1>mpostazioni di gestione dello spazio di archiviazione.", "UserQuotaHeader": "Il numero di amministratori/utenti esperti sta per essere superato: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/ja-JP/MainBar.json b/packages/client/public/locales/ja-JP/MainBar.json index 6822986538..95a6010f42 100644 --- a/packages/client/public/locales/ja-JP/MainBar.json +++ b/packages/client/public/locales/ja-JP/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "このルームは、もうすぐ制限を超えます:{{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "ストレージやルームの制限を超えそうです。", "StorageAndUserHeader": "ストレージと管理者/パワーユーザーの制限を超えそうです。", - "StorageQuotaDescription": "不要なファイルを削除するか、<1>{{clickHere}}して、{{productName}}に適した料金プランを見つけることができます。", - "StorageQuotaExceeded": "ストレージ容量制限を超えています", "StorageQuotaHeader": "ストレージのスペースは、もうすぐサイズ上限を超えます:{{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "不要なファイルを削除して、ディスク領域を確保できます。", "TenantCustomQuotaDescription": "不要ファイルを削除するか、<1>ストレージ管理設定で容量制限の変更ができます。", "UserQuotaHeader": "管理者/パワーユーザー数を超えそうです:{{currentValue}} / {{maxValue}}" } diff --git a/packages/client/public/locales/ko-KR/MainBar.json b/packages/client/public/locales/ko-KR/MainBar.json index 05cda64776..a437ee6f9f 100644 --- a/packages/client/public/locales/ko-KR/MainBar.json +++ b/packages/client/public/locales/ko-KR/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "방이 곧 초과될 예정입니다: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "곧 저장 용량 및 방 한도를 초과하게 됩니다.", "StorageAndUserHeader": "곧 저장 용량 및 관리자/고급 사용자 수 한도를 초과하게 됩니다.", - "StorageQuotaDescription": "불필요한 파일을 삭제하거나 <1>{{clickHere}}하여 더 적합한 {{productName}} 요금제를 찾으세요.", - "StorageQuotaExceeded": "스토리지 할당량을 초과했습니다", "StorageQuotaHeader": "저장 공간 용량이 곧 초과될 예정입니다: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "불필요한 파일을 제거하여 디스크 공간을 확보할 수 있습니다.", "TenantCustomQuotaDescription": "<1>스토리지 관리 설정에서 할당량을 변경하거나 불필요한 파일을 삭제하세요.", "UserQuotaHeader": "곧 관리자/고급 사용자 수 한도를 초과하게 됩니다: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/lo-LA/MainBar.json b/packages/client/public/locales/lo-LA/MainBar.json index 1fbacf1160..9363f573a7 100644 --- a/packages/client/public/locales/lo-LA/MainBar.json +++ b/packages/client/public/locales/lo-LA/MainBar.json @@ -9,8 +9,6 @@ "RoomQuotaHeader": "ຫ້ອງກຳລັງຈະເກີນ: {{ currentValue }} / {{ maxValue }}", "StorageAndRoomHeader": "ກໍາລັງຈະເກີນຂີດຈຳກັດບ່ອນຈັດເກັບຂໍ້ມູນ ແລະຫ້ອງ.", "StorageAndUserHeader": "ບ່ອນຈັດເກັບຂໍ້ມູນ ແລະ ຜູ້ເບິ່ງແຍງລະບົບ/ຜູ້ໃຊ້ກຳລັງຈະເກີນຂີດຈຳກັດ.", - "StorageQuotaDescription": "ທ່ານສາມາດລຶບໄຟລ໌ທີ່ບໍ່ຈໍາເປັນອອກ ຫຼື <1 >{{clickHere}} ເພື່ອຊອກຫາແຜນລາຄາທີ່ເໝາະສົມກວ່າສໍາລັບ {{productName}} ຂອງທ່ານ.", - "StorageQuotaExceeded": "ເກີນໂຄຕ້າບ່ອນຈັດເກັບຂໍ້ມູນ", "StorageQuotaHeader": "ຈຳນວນພື້ນທີ່ຈັດເກັບກຳລັງຈະເກີນ: {{ currentValue }} / {{ maxValue }}", "TenantCustomQuotaDescription": "ທ່ານສາມາດລຶບໄຟລ໌ທີ່ບໍ່ຈໍາເປັນອອກ ຫຼືປ່ຽນໂຄຕ້າໄດ້ໃນ <1>ການຕັ້ງຄ່າການຈັດການບ່ອນເກັບຂໍ້ມູນ.", "UserQuotaHeader": "ຈຳນວນຜູ້ເບິ່ງແຍງລະບົບ/ຜູ້ໃຊ້ກຳລັງຈະເກີນ: {{ currentValue }} / {{ maxValue }}." diff --git a/packages/client/public/locales/lv/MainBar.json b/packages/client/public/locales/lv/MainBar.json index d386088266..ff794e6c2c 100644 --- a/packages/client/public/locales/lv/MainBar.json +++ b/packages/client/public/locales/lv/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Tūlīt tiks pārsniegtas telpas: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Drīz tiks pārsniegti krātuves un telpu ierobežojumi.", "StorageAndUserHeader": "Tūlīt tiks pārsniegti krātuves un administratoru/prasmīgo lietotāju ierobežojumi.", - "StorageQuotaDescription": "Varat noņemt nevajadzīgos failus vai <1>{{clickHere}}, lai atrastu savam {{productName}} piemērotāku cenu plānu.", - "StorageQuotaExceeded": "Pārsniegta krātuves kvota", "StorageQuotaHeader": "Tūlīt tiks pārsniegts krātuves vietas apjoms: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Jūs varat noņemt nevajadzīgos failus, lai atbrīvotu vietu diskā.", "TenantCustomQuotaDescription": "Jūs varat noņemt nevajadzīgos failus vai mainīt kvotu <1>Krātuves pārvaldības iestatījumos.", "UserQuotaHeader": "Tūlīt tiks pārsniegts administratoru/prasmīgo lietotāju skaits:{{currentValue}}/{{maxValue}}." } diff --git a/packages/client/public/locales/nl/MainBar.json b/packages/client/public/locales/nl/MainBar.json index 49f50b8f80..e5abd3efd1 100644 --- a/packages/client/public/locales/nl/MainBar.json +++ b/packages/client/public/locales/nl/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Kamers staat op het punt overschreden te worden: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Opslag- en kamerlimieten staan op het punt overschreden te worden.", "StorageAndUserHeader": "De beperkingen voor opslag en beheerders/power users worden binnenkort overschreden.", - "StorageQuotaDescription": "U kunt de overbodige bestanden verwijderen of <1>{{clickHere}} om een meer geschikt prijsplan voor uw {{productName}} te vinden.", - "StorageQuotaExceeded": "Opslagquota overschreden", "StorageQuotaHeader": "De hoeveelheid opslagruimte staat op het punt overschreden te worden: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "U kunt de onnodige bestanden verwijderen om schijfruimte vrij te maken.", "TenantCustomQuotaDescription": "U kunt de onnodige bestanden verwijderen of de quota wijzigen in de <1>Instellingen voor opslagbeheer.", "UserQuotaHeader": "Het aantal beheerders/power users staan op het punt overschreden te worden: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/pl/MainBar.json b/packages/client/public/locales/pl/MainBar.json index 243e5db445..2114066201 100644 --- a/packages/client/public/locales/pl/MainBar.json +++ b/packages/client/public/locales/pl/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Liczba pokoi zostanie niedługo przekroczona: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Limity pamięci i pokoi zostaną wkrótce przekroczone.", "StorageAndUserHeader": "Limity pamięci/użytkowników z większą liczbą uprawnień zostaną wkrótce przekroczone.", - "StorageQuotaDescription": "Możesz usunąć niepotrzebne pliki lub <1>{{clickHere}}, aby znaleźć bardziej odpowiedni plan cenowy dla swojego konta {{productName}}.", - "StorageQuotaExceeded": "Przekroczono limit pamięci", "StorageQuotaHeader": "Ilość miejsca w pamięci zostanie wkrótce przekroczona: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Możesz usunąć niepotrzebne pliki, aby zwolnić miejsce na dysku.", "TenantCustomQuotaDescription": "Możesz usunąć niepotrzebne pliki lub zmienić limit w <1>ustawieniach zarządzania pamięcią.", "UserQuotaHeader": "Liczba administratorów/użytkowników z większą liczbą uprawnień zostanie wkrótce przekroczona: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/pt-BR/MainBar.json b/packages/client/public/locales/pt-BR/MainBar.json index 1b915a1ec7..e996f4e6b4 100644 --- a/packages/client/public/locales/pt-BR/MainBar.json +++ b/packages/client/public/locales/pt-BR/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "As salas estão prestes a ser excedidos: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Os limites de armazenamento e salas estão prestes a ser excedidos.", "StorageAndUserHeader": "Os limites de armazenamento e administradores/usuários avançados estão prestes a ser excedidos.", - "StorageQuotaDescription": "Você pode remover os arquivos desnecessários ou <1>{{clickHere}} para encontrar um plano de preços mais adequado para o seu {{productName}}.", - "StorageQuotaExceeded": "Cota de armazenamento excedida", "StorageQuotaHeader": "A quantidade de espaço de armazenamento está prestes a ser excedida: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Você pode remover os arquivos desnecessários para liberar espaço em disco.", "TenantCustomQuotaDescription": "Você pode remover os arquivos desnecessários ou alterar a cota nas <1>Configurações de gerenciamento de armazenamento.", "UserQuotaHeader": "O número de administradores/usuários avançados está prestes a ser excedido: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/pt/MainBar.json b/packages/client/public/locales/pt/MainBar.json index b558ffa79a..f97bc4808b 100644 --- a/packages/client/public/locales/pt/MainBar.json +++ b/packages/client/public/locales/pt/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Salas que estão prestes a ser excedidas: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Os limites de armazenamento e de salas estão prestes a ser excedidos.", "StorageAndUserHeader": "Os limites para o armazenamento e para o número de administradores/utilizadores com poder estão prestes a ser excedidos.", - "StorageQuotaDescription": "Pode remover os ficheiros desnecessários ou <1>{{clickHere}} para encontrar um plano de preços mais adequado para o seu {{productName}}.", - "StorageQuotaExceeded": "Cota de armazenamento excedida", "StorageQuotaHeader": "A capacidade de armazenamento do espaço está prestes a ser excedida: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Você pode remover os arquivos desnecessários para liberar espaço em disco.", "TenantCustomQuotaDescription": "Você pode remover os arquivos desnecessários ou alterar a cota nas <1>Configurações de gerenciamento de armazenamento.", "UserQuotaHeader": "O número de administradores/utilizadores com poder está prestes a ser excedido: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/ro/MainBar.json b/packages/client/public/locales/ro/MainBar.json index bee73eb2fc..218c2a2eb3 100644 --- a/packages/client/public/locales/ro/MainBar.json +++ b/packages/client/public/locales/ro/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Cota sălilor este pe punctul de a fi depăşită: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Limite de stocare și cota sălilor sunt pe punctul de a fi depăşiti.", "StorageAndUserHeader": "Limite de stocare pentru administratori/utilizatori avansați sunt pe punctul de a fi depăşiti.", - "StorageQuotaDescription": "Puteţi elimina fişierele inutile sau <1>{{{clickHere}} pentru a găsi un abonament mai potrivit pentru spaţiul dvs {{productName}}.", - "StorageQuotaExceeded": "Cotă de stocare a fost depășită", "StorageQuotaHeader": "Cota spaţiului de stocare este pe punctul de a fi depăşită: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Puteți elimina fișiere inutile pentru a elibera spațiu de stocare.", "TenantCustomQuotaDescription": "Puteţi elimina fişierele inutile sau modifica cotă de stocare din secțiunea <1>Setările de gestionare a spațiului de stocare..", "UserQuotaHeader": "Numărul maxim de administratori/utilizatori avansați este pe punctul de a fi depăşit. {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/ru/MainBar.json b/packages/client/public/locales/ru/MainBar.json index 6c5291b103..e7c2fafab0 100644 --- a/packages/client/public/locales/ru/MainBar.json +++ b/packages/client/public/locales/ru/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Количество комнат скоро будет превышено: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Объем дискового пространства и количество комнат скоро будут превышены.", "StorageAndUserHeader": "Объем дискового пространства и количество администраторов/опытных пользователей скоро будут превышены. ", - "StorageQuotaDescription": "Вы можете удалить ненужные файлы или <1>{{clickHere}}, чтобы найти лучший тарифный план для {{productName}}.", - "StorageQuotaExceeded": "Превышена квота хранилища", "StorageQuotaHeader": "Объем дискового пространства скоро будет превышен: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Вы можете удалить ненужные файлы, чтобы освободить место на диске.", "TenantCustomQuotaDescription": "Удалить ненужные файлы или изменить квоту можно в <1>Настройках управления хранилищем.", "UserQuotaHeader": "Количество администраторов/опытных пользователей скоро будет превышено: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/si/MainBar.json b/packages/client/public/locales/si/MainBar.json index 2a1ecce35a..2f100ad2d3 100644 --- a/packages/client/public/locales/si/MainBar.json +++ b/packages/client/public/locales/si/MainBar.json @@ -9,8 +9,6 @@ "RoomQuotaHeader": "කාමර ගණන ඉක්මවීමට ආසන්නයි: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "ආචයනය සහ කාමර සීමා ඉක්මවා යාමට ආසන්නයි.", "StorageAndUserHeader": "ආචයනය සහ පරිපාලකයින්/බලවත් පරිශ්‍රීලකයින්ගේ සීමා ඉක්මවා යාමට ආසන්නයි.", - "StorageQuotaDescription": "ඔබට අනවශ්‍ය ගොනු ඉවත් කිරීමට හැකිය හෝ ඔබගේ {{productName}} සඳහා වඩාත් සුදුසු මිලකරණ සැලසුමක් සොයා ගැනීමට <1>{{clickHere}}.", - "StorageQuotaExceeded": "ආචයන සලාකය ඉක්මවා ඇත", "StorageQuotaHeader": "ආචයනයේ ඉඩ ඉක්මවීමට ආසන්නයි: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "ඔබට <1>ආචයන කළමනාකරණ සැකසුම් මගින් අනවශ්‍ය ගොනු ඉවත් කිරීමට හෝ සලාකය වෙනස් කිරීමට හැකිය.", "UserQuotaHeader": "පරිපාලකයින්/බලවත් පරිශ්‍රීලකයින් ගණන ඉක්මවීමට ආසන්නයි: {{currentValue}} / {{maxValue}}." diff --git a/packages/client/public/locales/sk/MainBar.json b/packages/client/public/locales/sk/MainBar.json index 1e4537d6a0..71cc0d3c1e 100644 --- a/packages/client/public/locales/sk/MainBar.json +++ b/packages/client/public/locales/sk/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Počet miestností bude čoskoro prekročený: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Limity úložísk a miestností budú čoskoro prekročené.", "StorageAndUserHeader": "Objem úložísk a maximálny počet administrátorov/pokročilých používateľov budú čoskoro prekročené.", - "StorageQuotaDescription": "Môžete odstrániť súbory, ktore nepotrebujete alebo <1>{{clickHere}} nájsť lepší plán pre svoj {{productName}}.", - "StorageQuotaExceeded": "Kvóta úložiska prekročená", "StorageQuotaHeader": "Veľkosť úložného priestoru bude čoskoro prekročená: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Nepotrebné súbory môžete odstrániť, aby ste uvoľnili miesto na disku.", "TenantCustomQuotaDescription": "Nepotrebné súbory môžete odstrániť alebo zmeniť kvótu v <1> Nastaveniach spravovania úložísk.", "UserQuotaHeader": "Maximálny počet administrátorov/pokročilých používateľov bude čoskoro prekročený: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/sl/MainBar.json b/packages/client/public/locales/sl/MainBar.json index 43af753205..354b2c5c6b 100644 --- a/packages/client/public/locales/sl/MainBar.json +++ b/packages/client/public/locales/sl/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Sobe bodo kmalu presežene: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Omejitve prostora za shranjevanje in število sob bodo kmalu presežene.", "StorageAndUserHeader": "Omejitve prostora za shranjevanje in število skrbnikov/naprednih uporabnikov bodo kmalu presežene.", - "StorageQuotaDescription": "Nepotrebne datoteke lahko odstranite ali <1>{{clickHere}} poiščete primernejši finančni paket za vaš {{productName}}.", - "StorageQuotaExceeded": "Kvota prostora za shranjevanje je presežena", "StorageQuotaHeader": "Dovoljen prostor za shranjevanje bo kmalu presežen: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Nepotrebne datoteke lahko odstraniš, da sprostiš prostor na disku.", "TenantCustomQuotaDescription": "Nepotrebne datoteke lahko odstranite ali spremenite kvoto v <1>Nastavitvah upravljanja shrambe.", "UserQuotaHeader": "Število skrbnikov/naprednih uporabnikov bo kmalu preseženo: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/sr-Cyrl-RS/MainBar.json b/packages/client/public/locales/sr-Cyrl-RS/MainBar.json index 9df586d972..07e7c5b69a 100644 --- a/packages/client/public/locales/sr-Cyrl-RS/MainBar.json +++ b/packages/client/public/locales/sr-Cyrl-RS/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Број соба ц́е ускоро бити прекорачен: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Ограничења складишта и соба ће ускоро бити прекорачена.", "StorageAndUserHeader": "Ограничења складишта и администратора/напредних корисника ће ускоро бити прекорачена.", - "StorageQuotaDescription": "Можете да уклоните непотребне датотеке или <1>{{clickHere}} да бисте пронашли прикладнији план цена за ваш {{productName}}.", - "StorageQuotaExceeded": "Квота складишта прекорачена", "StorageQuotaHeader": "Количина меморијског простора ц́е ускоро бити прекорачена: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Можете уклонити непотребне датотеке да бисте ослободили простор на диску.", "TenantCustomQuotaDescription": "Можете уклонити непотребне датотеке или променити квоту у <1>Storage management settings.", "UserQuotaHeader": "Број администратора/напредних корисника ће ускоро бити прекорачен: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/sr-Latn-RS/MainBar.json b/packages/client/public/locales/sr-Latn-RS/MainBar.json index a8443ddd4b..3b924ad9d2 100644 --- a/packages/client/public/locales/sr-Latn-RS/MainBar.json +++ b/packages/client/public/locales/sr-Latn-RS/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Broj soba će uskoro biti prekoračen: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Ograničenja skladišta i soba će uskoro biti prekoračena.", "StorageAndUserHeader": "Ograničenja skladišta i administratora/naprednih korisnika će uskoro biti prekoračena.", - "StorageQuotaDescription": "Možete da uklonite nepotrebne datoteke ili <1>{{clickHere}} da biste pronašli prikladniji plan cena za vaš {{productName}}.", - "StorageQuotaExceeded": "Kvota skladišta prekoračena", "StorageQuotaHeader": "Količina memorijskog prostora će uskoro biti prekoračena: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Možete ukloniti nepotrebne datoteke da biste oslobodili prostor na disku.", "TenantCustomQuotaDescription": "Možete ukloniti nepotrebne datoteke ili promeniti kvotu u <1>Storage management settings.", "UserQuotaHeader": "Broj administratora/naprednih korisnika će uskoro biti prekoračen: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/tr/MainBar.json b/packages/client/public/locales/tr/MainBar.json index 791ca190fe..d6ae1158fb 100644 --- a/packages/client/public/locales/tr/MainBar.json +++ b/packages/client/public/locales/tr/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Odalar aşılmak üzere: {{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Depolama ve oda limitleri aşılmak üzere.", "StorageAndUserHeader": "Depolama ve yöneticiler/uzman kullanıcılar limitleri aşılmak üzere.", - "StorageQuotaDescription": "Gereksiz dosyaları arşivleyebilirsiniz veya <1>{{clickHere}} ile {{productName}}'iniz için daha uygun bir fiyatlandırma planı bulabilirsiniz.", - "StorageQuotaExceeded": "Depolama kotası aşıldı", "StorageQuotaHeader": "Depolama alanı miktarı aşılmak üzere: {{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Disk alanını boşaltmak için gereksiz dosyaları kaldırabilirsiniz.", "TenantCustomQuotaDescription": "Gereksiz dosyaları kaldırabilir veya <1>Depolama yönetimi ayarlarından kotayı değiştirebilirsiniz.", "UserQuotaHeader": "Yönetici/uzman kullanıcı sayısı aşılmak üzere: {{currentValue}} / {{maxValue}}." } diff --git a/packages/client/public/locales/uk-UA/MainBar.json b/packages/client/public/locales/uk-UA/MainBar.json index 8377345d4f..f9a9318d57 100644 --- a/packages/client/public/locales/uk-UA/MainBar.json +++ b/packages/client/public/locales/uk-UA/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Кількість кімнат скоро буде перевищено: {{currentValue}}/{{maxValue}}", "StorageAndRoomHeader": "Обмеження сховища та кількості кімнат скоро буде перевищено.", "StorageAndUserHeader": "Обмеження сховища та обмеження для адміністраторів / досвідчених користувачів скоро буде перевищено.", - "StorageQuotaDescription": "Ви можете видалити непотрібні файли, або <1>{{clickHere}}, щоб знайти більш підходящий тарифний план для вашого {{productName}}.", - "StorageQuotaExceeded": "Квоту сховища перевищено", "StorageQuotaHeader": "Обсяг сховища скоро буде перевищено: {{currentValue}}/{{maxValue}}", - "StorageQuotaUserDescription": "Ви можете видалити непотрібні файли, щоб звільнити місце на диску.", "TenantCustomQuotaDescription": "Ви можете видалити непотрібні файли або змінити квоту в <1>Параметрах керування сховищем.", "UserQuotaHeader": "Кількість адміністраторів / досвідчених користувачів скоро буде перевищено: {{currentValue}}/{{maxValue}}." } diff --git a/packages/client/public/locales/vi/MainBar.json b/packages/client/public/locales/vi/MainBar.json index 4477487c78..eab15b887e 100644 --- a/packages/client/public/locales/vi/MainBar.json +++ b/packages/client/public/locales/vi/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "Phòng sắp vượt quá:{{currentValue}} / {{maxValue}}", "StorageAndRoomHeader": "Sắp vượt quá giới hạn lưu trữ và phòng.", "StorageAndUserHeader": "Sắp vượt quá giới hạn lưu trữ và quản trị viên/người dùng cấp cao.", - "StorageQuotaDescription": "Bạn có thể xóa các tập tin không cần thiết hoặc <1>{{clickHere}} để tìm gói dịch vụ có giá phù hợp hơn cho {{productName}} của mình.", - "StorageQuotaExceeded": "Đã vượt quá hạn mức lưu trữ", "StorageQuotaHeader": "Dung lượng lưu trữ sắp vượt quá:{{currentValue}} / {{maxValue}}", - "StorageQuotaUserDescription": "Bạn có thể xóa các tập tin không cần thiết để giải phóng dung lượng ổ đĩa.", "TenantCustomQuotaDescription": "Bạn có thể xóa các tập tin không cần thiết hoặc thay đổi hạn mức trong cài đặt Quản lý lưu trữ <1>.", "UserQuotaHeader": "Sắp vượt quá số lượng quản trị viên/người dùng cấp cao:{{currentValue}}/{{maxValue}}." } diff --git a/packages/client/public/locales/zh-CN/MainBar.json b/packages/client/public/locales/zh-CN/MainBar.json index d5e2021476..46664f1b46 100644 --- a/packages/client/public/locales/zh-CN/MainBar.json +++ b/packages/client/public/locales/zh-CN/MainBar.json @@ -9,10 +9,7 @@ "RoomQuotaHeader": "房间数量即将超出限制:{{currentValue}}/{{maxValue}}", "StorageAndRoomHeader": "存储和房间的限制即将被超过。", "StorageAndUserHeader": "存储和管理员/高级用户的数量限制即将被超过。", - "StorageQuotaDescription": "您可以删除不必要的文件或 <1>{{clickHere}}为您的{{productName}}找到更合适的定价计划。", - "StorageQuotaExceeded": "超出存储空间配额", "StorageQuotaHeader": "存储空间数量即将超出限制:{{currentValue}}/{{maxValue}}", - "StorageQuotaUserDescription": "您可以删除不必要的文件以释放磁盘空间。", "TenantCustomQuotaDescription": "您可以在<1>存储空间管理设置中删除不必要的文件,或更改配额。", "UserQuotaHeader": "管理员/高级用户的数量即将超过限制: {{currentValue}} / {{maxValue}}" } diff --git a/packages/client/src/components/MainBar/QuotasBar.js b/packages/client/src/components/MainBar/QuotasBar.js index 3da38d4f5d..fb29bc30b5 100644 --- a/packages/client/src/components/MainBar/QuotasBar.js +++ b/packages/client/src/components/MainBar/QuotasBar.js @@ -53,28 +53,6 @@ const QuotasBar = ({ onClose && onClose(type); }; - const getStorageQuotaDescription = () => { - if (!isAdmin) return t("StorageQuotaUserDescription"); - - return ( - - You can remove the unnecessary files or - - {{ clickHere: t("ClickHere").toLowerCase() }} - {" "} - to find a better pricing plan for your portal. - - ); - }; const getTenantCustomQuota = () => { if (!isAdmin) return t("RemoveFilesOrContactToUpgradeQuota"); From 5ab2fbeb15e2d9b864489fb7501d555a7ea00924 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Wed, 14 Aug 2024 17:06:39 +0300 Subject: [PATCH 054/140] Refactoring. --- packages/client/public/locales/en/MainBar.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/client/public/locales/en/MainBar.json b/packages/client/public/locales/en/MainBar.json index b109ff1e83..d90890896e 100644 --- a/packages/client/public/locales/en/MainBar.json +++ b/packages/client/public/locales/en/MainBar.json @@ -1,29 +1,29 @@ { "ClickHere": "Click here", + "ClickToUpgradeTariff": "<1>Click here to upgrade your tariff plan.", + "ContactToUpgradeTariff": "Contact the {{productName}} administrator to upgrade the tariff plan.", "ConfirmEmailDescription": "Use the link provided in the activation email. Haven't received an email with the activation link?", "ConfirmEmailHeader": "Please activate your email ({{ email }}) to get access to the {{productName}} features.", "PersonalUserQuotaAdminsDescription": "To upload and create new files and folders, please free up disk space, or manage quota per user in the <1>Storage management settings.", "PersonalUserQuotaDescription": "To upload and create new files and folders, please free up disk space, or contact the administrator to increase the storage quota.", + "PersonalQuotaHeaderForAdmins": "Storage quota per user exceeded", + "PersonalQuotaHeader": "Your personal storage quota exceeded", "RequestActivation": "Request activation once again", "RoomQuotaDescription": "You can archive the unnecessary rooms or <1>{{clickHere}} to find a more suitable pricing plan for your {{productName}}.", "RoomQuotaHeader": "The number of rooms is about to be exceeded: {{currentValue}} / {{maxValue}}", + "RemoveFilesOrClickToUpgrade": "Remove the unnecessary files or <1>click here to upgrade your tariff plan.", + "RemoveFilesOrContactToUpgrade": "Remove the unnecessary files or contact the {{productName}} administrator to upgrade the tariff plan.", + "RemoveFilesOrContactToUpgradeQuota": "Remove the unnecessary files or contact the {{productName}} administrator to increase the storage quota.", "StorageAndRoomHeader": "Storage and rooms limits are about to be exceeded.", "StorageAndUserHeader": "The limit for storage space and the number of admins/power users is about to be exceeded.", "StorageAndUserTariffLimitHeader": "The limit is reached for storage space and the number of admins/power users ", "StorageQuotaHeader": "Storage space amount is about to be exceeded: {{currentValue}} / {{maxValue}}", + "StorageLimitHeader": "The limit is reached for storage space: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "You can remove the unnecessary files or change quota in the <1>Storage management settings.", "UserTariffAlmostReachedForAdmins": "Once the limit is reached, all users will be added with User permissions only. To be able to add further admins/power users, <1>click here to upgrade your tariff plan.", "UserTariffAlmostReached": "Once the limit is reached, all users will be added with User permissions only. To be able to add further admins/power users, contact the DocSpace administrator to upgrade the tariff plan.", "UserTariffReachedForAdmins": "All users will be added with User permissions only. To be able to add further admins/power users, <1>click here to upgrade your tariff plan.", "UserTariffReached": "All users will be added with User permissions only. To be able to add further admins/power users, contact the {{productName}} administrator to upgrade the tariff plan.", "UserQuotaHeader": "The number of admins/power users is about to be exceeded: {{currentValue}} / {{maxValue}}.", - "UserTariffLimitHeader": "The limit is reached for the number of admins/power users: {{currentValue}} / {{maxValue}}", - "StorageLimitHeader": "The limit is reached for storage space: {{currentValue}} / {{maxValue}}", - "RemoveFilesOrClickToUpgrade": "Remove the unnecessary files or <1>click here to upgrade your tariff plan.", - "RemoveFilesOrContactToUpgrade": "Remove the unnecessary files or contact the {{productName}} administrator to upgrade the tariff plan.", - "RemoveFilesOrContactToUpgradeQuota": "Remove the unnecessary files or contact the {{productName}} administrator to increase the storage quota.", - "PersonalQuotaHeaderForAdmins": "Storage quota per user exceeded", - "PersonalQuotaHeader": "Your personal storage quota exceeded", - "ClickToUpgradeTariff": "<1>Click here to upgrade your tariff plan.", - "ContactToUpgradeTariff": "Contact the {{productName}} administrator to upgrade the tariff plan." + "UserTariffLimitHeader": "The limit is reached for the number of admins/power users: {{currentValue}} / {{maxValue}}" } From 645adf6050cfb110c4361cdfb52d210758f8e312 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Wed, 14 Aug 2024 17:40:33 +0300 Subject: [PATCH 055/140] Shared: ErrorContainer: Fixed vertical scroll on clouds animation --- .../shared/components/error-container/ErrorContainer.styled.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared/components/error-container/ErrorContainer.styled.ts b/packages/shared/components/error-container/ErrorContainer.styled.ts index b0b3556f97..8a987d39a2 100644 --- a/packages/shared/components/error-container/ErrorContainer.styled.ts +++ b/packages/shared/components/error-container/ErrorContainer.styled.ts @@ -40,7 +40,7 @@ const StyledErrorContainer = styled.div<{ isEditor: boolean }>` css` position: absolute; `} - overflow-x: hidden; + overflow: hidden; display: flex; flex-direction: column; align-items: center; From 1b250eaac01c3536b4ff3e7ac4d4e5c9468e6d44 Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Wed, 14 Aug 2024 20:15:45 +0400 Subject: [PATCH 056/140] Bug 69700 - [LDAP] Checking for incorrect LDAP server settings ends with a "successful" save --- packages/client/src/store/LdapFormStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/store/LdapFormStore.js b/packages/client/src/store/LdapFormStore.js index ba929c76e1..17a374eb53 100644 --- a/packages/client/src/store/LdapFormStore.js +++ b/packages/client/src/store/LdapFormStore.js @@ -489,7 +489,7 @@ class LdapFormStore { completed: true, percents: 100, certificateConfirmRequest: null, - error: "", + error: t("Common:UnexpectedError"), }; } From 266fdabc75d82e9c8e3da54253693fead4cf1bba Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Wed, 14 Aug 2024 22:04:05 +0300 Subject: [PATCH 057/140] Client: Updated room and storage bar when almost reaching the tariff limit. --- .../client/public/locales/en/MainBar.json | 2 +- packages/client/src/components/MainBar/Bar.js | 28 +++++++++++++++++-- .../src/components/MainBar/QuotasBar.js | 6 ++-- packages/client/src/helpers/constants.js | 2 +- packages/shared/store/CurrentQuotaStore.ts | 12 ++++---- 5 files changed, 37 insertions(+), 13 deletions(-) diff --git a/packages/client/public/locales/en/MainBar.json b/packages/client/public/locales/en/MainBar.json index d90890896e..dc9d27b0db 100644 --- a/packages/client/public/locales/en/MainBar.json +++ b/packages/client/public/locales/en/MainBar.json @@ -14,7 +14,7 @@ "RemoveFilesOrClickToUpgrade": "Remove the unnecessary files or <1>click here to upgrade your tariff plan.", "RemoveFilesOrContactToUpgrade": "Remove the unnecessary files or contact the {{productName}} administrator to upgrade the tariff plan.", "RemoveFilesOrContactToUpgradeQuota": "Remove the unnecessary files or contact the {{productName}} administrator to increase the storage quota.", - "StorageAndRoomHeader": "Storage and rooms limits are about to be exceeded.", + "StorageAndRoomHeader": "The limit for storage space and the number of rooms is about to be exceeded.", "StorageAndUserHeader": "The limit for storage space and the number of admins/power users is about to be exceeded.", "StorageAndUserTariffLimitHeader": "The limit is reached for storage space and the number of admins/power users ", "StorageQuotaHeader": "Storage space amount is about to be exceeded: {{currentValue}} / {{maxValue}}", diff --git a/packages/client/src/components/MainBar/Bar.js b/packages/client/src/components/MainBar/Bar.js index b85645ee70..16cd65fadd 100644 --- a/packages/client/src/components/MainBar/Bar.js +++ b/packages/client/src/components/MainBar/Bar.js @@ -81,6 +81,7 @@ const Bar = (props) => { isUserTariffLimit, isStorageQuotaAlmostLimit, isStorageQuotaLimit, + isRoomTariffAlmostLimit, } = props; const navigate = useNavigate(); @@ -95,6 +96,7 @@ const Bar = (props) => { usersTariffLimit: false, storageAndUserTariff: false, storageAndUserTariffLimit: false, + roomsAndStorageTariff: false, storageAndRoomQuota: false, confirmEmail: false, personalUserQuota: false, @@ -142,6 +144,9 @@ const Bar = (props) => { storageAndUserTariff: !closed.includes( QuotaBarTypes.UserAndStorageTariff, ), + roomsAndStorageTariff: closed.includes( + QuotaBarTypes.RoomsAndStorageTariff, + ), storageAndUserTariffLimit: !closed.includes( QuotaBarTypes.UserAndStorageTariffLimit, ), @@ -177,6 +182,7 @@ const Bar = (props) => { usersTariff: isAdmin | isRoomAdmin, usersTariffLimit: isAdmin | isRoomAdmin, storageAndUserTariff: isAdmin | isRoomAdmin, + roomsAndStorageTariff: isAdmin | isRoomAdmin, storageAndUserTariffLimit: isAdmin | isRoomAdmin, storageAndRoomQuota: isAdmin, confirmEmail: true, @@ -289,9 +295,9 @@ const Bar = (props) => { storageAndUserTariffLimit: false, })); break; - // case QuotaBarTypes.RoomAndStorageQuota: - // setBarVisible((value) => ({ ...value, storageAndRoomQuota: false })); - // break; + case QuotaBarTypes.RoomsAndStorageTariff: + setBarVisible((value) => ({ ...value, roomsAndStorageTariff: false })); + break; case QuotaBarTypes.PersonalUserQuota: setBarVisible((value) => ({ ...value, personalUserQuota: false })); break; @@ -331,6 +337,19 @@ const Bar = (props) => { isStorageTariffAlmostLimit, barVisible.storageAndUserTariff, ); + + if ( + isRoomTariffAlmostLimit && + isStorageTariffAlmostLimit && + barVisible.roomsAndStorageTariff + ) { + return { + type: QuotaBarTypes.RoomsAndStorageTariff, + maxValue: null, + currentValue: null, + }; + } + if ( isUserTariffAlmostLimit && isStorageTariffAlmostLimit && @@ -342,6 +361,7 @@ const Bar = (props) => { currentValue: null, }; } + if ( isUserTariffLimit && isStorageTariffLimit && @@ -495,6 +515,7 @@ export default inject( isUserTariffLimit, isStorageQuotaAlmostLimit, isStorageQuotaLimit, + isRoomTariffAlmostLimit, } = currentQuotaStore; const { currentColorScheme, setMainBarVisible } = settingsStore; @@ -531,6 +552,7 @@ export default inject( isUserTariffLimit, isStorageQuotaAlmostLimit, isStorageQuotaLimit, + isRoomTariffAlmostLimit, }; }, )(withTranslation(["Profile", "Common"])(observer(Bar))); diff --git a/packages/client/src/components/MainBar/QuotasBar.js b/packages/client/src/components/MainBar/QuotasBar.js index fb29bc30b5..b88056246d 100644 --- a/packages/client/src/components/MainBar/QuotasBar.js +++ b/packages/client/src/components/MainBar/QuotasBar.js @@ -287,10 +287,10 @@ const QuotasBar = ({ header: t("StorageAndUserTariffLimitHeader"), description: getUpgradeTariffDescription(), }; - case QuotaBarTypes.RoomAndStorageQuota: + case QuotaBarTypes.RoomsAndStorageTariff: return { - header: t("StorageAndRoomHeader", { currentValue, maxValue }), - description: getUserQuotaDescription(), + header: t("StorageAndRoomHeader"), + description: getUpgradeTariffDescription(), }; case QuotaBarTypes.PersonalUserQuota: return { diff --git a/packages/client/src/helpers/constants.js b/packages/client/src/helpers/constants.js index de55a43626..d10d88214b 100644 --- a/packages/client/src/helpers/constants.js +++ b/packages/client/src/helpers/constants.js @@ -103,7 +103,7 @@ export const QuotaBarTypes = Object.freeze({ UsersTariffLimit: "user-quota-limit", UserAndStorageTariff: "user-storage-quota", UserAndStorageTariffLimit: "user-storage-quota-limit", - RoomAndStorageQuota: "room-storage-quota", + RoomsAndStorageTariff: "room-storage-quota", PersonalUserQuota: "personal-user-quota", StorageQuota: "tenant-custom-quota", StorageQuotaLimit: "tenant-custom-quota-limit", diff --git a/packages/shared/store/CurrentQuotaStore.ts b/packages/shared/store/CurrentQuotaStore.ts index 4c664eb3f6..8fa13cf3d1 100644 --- a/packages/shared/store/CurrentQuotaStore.ts +++ b/packages/shared/store/CurrentQuotaStore.ts @@ -252,6 +252,13 @@ class CurrentQuotasStore { ); } + get isRoomTariffAlmostLimit() { + return ( + this.maxCountRoomsByQuota - this.usedRoomsCount <= + COUNT_FOR_SHOWING_BAR && this.usedRoomsCount < this.maxCountRoomsByQuota + ); + } + get isStorageTariffAlmostLimit() { return ( (this.usedTotalStorageSizeCount / this.maxTotalSizeByQuota) * 100 >= @@ -296,11 +303,6 @@ class CurrentQuotasStore { } get isUserTariffAlmostLimit() { - console.log( - "isUserTariffAlmostLimit", - this.addedManagersCount, - this.maxCountManagersByQuota, - ); return ( this.addedManagersCount > 1 && this.maxCountManagersByQuota - this.addedManagersCount <= From 1b4180e8cdd986b3e7dc176d3ea47107a1935323 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Thu, 15 Aug 2024 10:21:57 +0300 Subject: [PATCH 058/140] Client: Deleted useless translation. --- .../client/public/locales/ar-SA/MainBar.json | 1 - .../client/public/locales/az/MainBar.json | 1 - .../client/public/locales/bg/MainBar.json | 1 - .../client/public/locales/cs/MainBar.json | 1 - .../client/public/locales/de/MainBar.json | 1 - .../client/public/locales/el-GR/MainBar.json | 1 - .../client/public/locales/es/MainBar.json | 1 - .../client/public/locales/fi/MainBar.json | 1 - .../client/public/locales/fr/MainBar.json | 1 - .../client/public/locales/hy-AM/MainBar.json | 1 - .../client/public/locales/it/MainBar.json | 1 - .../client/public/locales/ja-JP/MainBar.json | 1 - .../client/public/locales/ko-KR/MainBar.json | 1 - .../client/public/locales/lo-LA/MainBar.json | 1 - .../client/public/locales/lv/MainBar.json | 1 - .../client/public/locales/nl/MainBar.json | 1 - .../client/public/locales/pl/MainBar.json | 1 - .../client/public/locales/pt-BR/MainBar.json | 1 - .../client/public/locales/pt/MainBar.json | 1 - .../client/public/locales/ro/MainBar.json | 1 - .../client/public/locales/ru/MainBar.json | 1 - .../client/public/locales/si/MainBar.json | 1 - .../client/public/locales/sk/MainBar.json | 1 - .../client/public/locales/sl/MainBar.json | 1 - .../public/locales/sr-Cyrl-RS/MainBar.json | 1 - .../public/locales/sr-Latn-RS/MainBar.json | 1 - .../client/public/locales/tr/MainBar.json | 1 - .../client/public/locales/uk-UA/MainBar.json | 1 - .../client/public/locales/vi/MainBar.json | 1 - .../client/public/locales/zh-CN/MainBar.json | 1 - .../src/components/MainBar/QuotasBar.js | 23 ------------------- 31 files changed, 53 deletions(-) diff --git a/packages/client/public/locales/ar-SA/MainBar.json b/packages/client/public/locales/ar-SA/MainBar.json index e585a96e73..b6a04d640a 100644 --- a/packages/client/public/locales/ar-SA/MainBar.json +++ b/packages/client/public/locales/ar-SA/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "اطلب التفعيل مرة أخرى", "RoomQuotaDescription": "يمكنك أرشفة الغرف غير الضرورية أو <1> {{clickHere}} للعثور على خطة أسعار أكثر ملاءمة لـ {{productName}}", "RoomQuotaHeader": "عدد الغرف على وشك أن يتجاوز: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "حدود مساحة التخزين والغرف على وشك أن يتم تجاوزها.", "StorageAndUserHeader": "حدود مساحة التخزين والمشرفين / المستخدمين المتميزين على وشك أن يتم تجاوزها.", "StorageQuotaHeader": "حجم مساحة التخزين على وشك أن يتم تجاوزها: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "يمكنك إزالة الملفات غير الضرورية أو تغيير الحصة النسبية في <1> إعدادات إدارة التخزين.", diff --git a/packages/client/public/locales/az/MainBar.json b/packages/client/public/locales/az/MainBar.json index 76526201bf..d9c95487e6 100644 --- a/packages/client/public/locales/az/MainBar.json +++ b/packages/client/public/locales/az/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Yenidən aktivləşdirmə tələb edin", "RoomQuotaDescription": "{{productName}} üçün daha uyğun qiymət planı tapmaq üçün lazımsız otaqları arxivləşdirə və ya <1>{{clickHere}} edə bilərsiniz.", "RoomQuotaHeader": "Otaqlar keçmək üzrədir: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Yaddaş və otaq limitləri aşmaq üzrədir.", "StorageAndUserHeader": "Yaddaş və administratorlar/ekspert istifadəçilər limitləri aşmaq üzrədir.", "StorageQuotaHeader": "Yaddaş sahəsinin həcmi keçmək üzrədir : {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "<1>Yaddaş idarəetmə parametrlərində lazımsız faylları silə və ya kvotanı dəyişə bilərsiniz.", diff --git a/packages/client/public/locales/bg/MainBar.json b/packages/client/public/locales/bg/MainBar.json index a84219e25f..232b1c7643 100644 --- a/packages/client/public/locales/bg/MainBar.json +++ b/packages/client/public/locales/bg/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Отново заявете активиране", "RoomQuotaDescription": "Можете да архивирате ненужните стаи или <1>{{clickHere}}, за да намерите по-подходящ ценови план за вашия {{productName}}.", "RoomQuotaHeader": "Стаите са на път да бъдат надвишени: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "На път сте да превишите ограниченията за съхранение и помещения.", "StorageAndUserHeader": "На път сте да превишите ограниченията за съхранение и администратори/опитни потребители.", "StorageQuotaHeader": "Размерът на пространството за съхранение е на път да бъде надвишен: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Можете да премахнете ненужните файлове или да промените квотата от <1>Настройки за управление на хранилището.", diff --git a/packages/client/public/locales/cs/MainBar.json b/packages/client/public/locales/cs/MainBar.json index 73deea3057..c8bfb437e6 100644 --- a/packages/client/public/locales/cs/MainBar.json +++ b/packages/client/public/locales/cs/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Znovu požádat o o aktivaci", "RoomQuotaDescription": "Nepotřebné místnosti můžete archivovat nebo <1>{{clickHere}}} pro nalezení vhodnějšího cenového tarifu pro váš {{productName}}.", "RoomQuotaHeader": "Počet místností bude brzy překročen: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Limity úložiště a místností budou brzy překročeny.", "StorageAndUserHeader": "Limity pro úložiště a správce/oprávněné uživatele budou brzy překročeny.", "StorageQuotaHeader": "Množství úložného prostoru bude brzy překročeno: {{currentValue}} / {{maxValue}}.", "TenantCustomQuotaDescription": "Nepotřebné soubory můžete odstranit nebo změnit kvótu v <1>Nastavení správy úložiště.", diff --git a/packages/client/public/locales/de/MainBar.json b/packages/client/public/locales/de/MainBar.json index e890c24282..02f8d358d3 100644 --- a/packages/client/public/locales/de/MainBar.json +++ b/packages/client/public/locales/de/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Erneute Aktivierung anfordern", "RoomQuotaDescription": "Sie können die überflüssigen Räume archivieren oder <1>{{clickHere}} einen passenderen Preisplan für Ihren {{productName}} finden.", "RoomQuotaHeader": "Die Anzahl von Räumen wird bald überschritten sein: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Die Speicher- und Raumlimits werden bald überschritten sein.", "StorageAndUserHeader": "Limits für Speicherplatz und Admins/Power-User werden bald überschritten sein.", "StorageQuotaHeader": "Das Speicherplatzlimit wird bald überschritten: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Sie können unnötige Dateien entfernen oder die Quote in den <1>Speicherverwaltungseinstellungen ändern", diff --git a/packages/client/public/locales/el-GR/MainBar.json b/packages/client/public/locales/el-GR/MainBar.json index 278fd442de..f4559b7af3 100644 --- a/packages/client/public/locales/el-GR/MainBar.json +++ b/packages/client/public/locales/el-GR/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Ζητήστε εκ νέου ενεργοποίηση", "RoomQuotaDescription": "Μπορείτε να αρχειοθετήσετε τα περιττά δωμάτια ή <1>{{clickHere}} για να βρείτε ένα πιο κατάλληλο πρόγραμμα τιμολόγησης για το {{productName}} σας.", "RoomQuotaHeader": "Πρόκειται να γίνει υπέρβαση ορίου για τα δωμάτια: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Τα όρια αποθηκευτικού χώρου και δωματίων πρόκειται να ξεπεραστούν.", "StorageAndUserHeader": "Τα όρια αποθηκευτικού χώρου και διαχειριστών/χρηστών ισχύος πρόκειται να ξεπεραστούν.", "StorageQuotaHeader": "Το ποσό του χώρου αποθήκευσης πρόκειται να ξεπεραστεί: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Μπορείτε να αφαιρέσετε τα περιττά αρχεία ή να αλλάξετε την ποσόστωση στις <1>Ρυθμίσεις διαχείρισης αποθ. χώρου.", diff --git a/packages/client/public/locales/es/MainBar.json b/packages/client/public/locales/es/MainBar.json index d05cc4ae7c..00a6878ff5 100644 --- a/packages/client/public/locales/es/MainBar.json +++ b/packages/client/public/locales/es/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Volver a solicitar la activación", "RoomQuotaDescription": "Puede archivar las salas innecesarias o <1>{{clickHere}} para encontrar un plan de precios más adecuado para su {{productName}}.", "RoomQuotaHeader": "Las salas están a punto de excederse: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Los límites de almacenamiento y de salas están a punto de excederse.", "StorageAndUserHeader": "Los límites de almacenamiento y de administradores/usuarios avanzados están a punto de excederse.", "StorageQuotaHeader": "La cantidad de espacio de almacenamiento está a punto de excederse: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Puede eliminar los archivos innecesarios o cambiar la cuota en la <1>Configuración de administración de almacenamiento.", diff --git a/packages/client/public/locales/fi/MainBar.json b/packages/client/public/locales/fi/MainBar.json index e91336630b..2a0853cdf8 100644 --- a/packages/client/public/locales/fi/MainBar.json +++ b/packages/client/public/locales/fi/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Pyydä aktivointia vielä kerran", "RoomQuotaDescription": "Voit arkistoida huoneita, joita et käytä tai <1>{{clickHere}} löytääksesi sopivamman hinnoitteluohjelman {{productName}}-llesi.", "RoomQuotaHeader": "Huoneet täyttyvät pian {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Muisti ja huoneiden määrän raja on ylittymässä. ", "StorageAndUserHeader": "Muisti ja ylläpitäjien/tehokäyttäjien määrän raja on ylittymässä.", "StorageQuotaHeader": "Tallennustilan määrä on ylittymässä: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Voit poistaa tarpeettomat tiedostot tai muuttaa kiintiötä <1>Muistinhallinta-asetuksissa.", diff --git a/packages/client/public/locales/fr/MainBar.json b/packages/client/public/locales/fr/MainBar.json index 7dd6f75150..7744e4f742 100644 --- a/packages/client/public/locales/fr/MainBar.json +++ b/packages/client/public/locales/fr/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Demander à nouveau l’activation", "RoomQuotaDescription": "Vous pouvez archiver les salles inutiles ou <1>{{clickHere}} pour trouver un plan tarifaire plus adapté à votre {{productName}}.", "RoomQuotaHeader": "Salles est sur le point d’être dépassée : {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Les limites de stockage et de salles sont sur le point d’être dépassées.", "StorageAndUserHeader": "Les limites de stockage et d'administrateurs/utilisateurs avancés sont sur le point d'être dépassées.", "StorageQuotaHeader": "L’espace de stockage est sur le point d’être dépassé : {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Vous pouvez supprimer les fichiers inutiles ou modifier le quota dans la section <1>Paramètres de gestion du stockage.", diff --git a/packages/client/public/locales/hy-AM/MainBar.json b/packages/client/public/locales/hy-AM/MainBar.json index c65ec559cd..081fa022eb 100644 --- a/packages/client/public/locales/hy-AM/MainBar.json +++ b/packages/client/public/locales/hy-AM/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Խնդրեք ակտիվացում ևս մեկ անգամ", "RoomQuotaDescription": "Դուք կարող եք արխիվացնել ավելորդ սենյակները կամ <1>{{clickHere}}՝ ձեր {{productName}}-ի համար ավելի հարմար գնային պլան գտնելու համար:", "RoomQuotaHeader": "Սենյակները շուտով գերազանցելու են՝ {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Պահեստի և սենյակների սահմանաչափերը շուտով կգերազանցվեն:", "StorageAndUserHeader": "Պահպանման և ադմինիստրատորների/հզոր օգտագործողների սահմանաչափերը շուտով կգերազանցվեն:", "StorageQuotaHeader": "Պահեստային տարածքի քանակը քիչ է մնում գերազանցվի՝ {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Դուք կարող եք հեռացնել ավելորդ ֆայլերը կամ փոխել սահմանաչափը <1>Պահպանման կառավարման կարգավորումներ:", diff --git a/packages/client/public/locales/it/MainBar.json b/packages/client/public/locales/it/MainBar.json index ce1ca7a592..c244f2e182 100644 --- a/packages/client/public/locales/it/MainBar.json +++ b/packages/client/public/locales/it/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Richiedi l’attivazione ancora una volta", "RoomQuotaDescription": "Puoi archiviare le stanze non necessarie o <1>{{clickHere}} per trovare un piano tariffario più adatto per il tuo {{productName}}.", "RoomQuotaHeader": "Sta per essere superato il limite di stanze: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "I limiti di spazio di archiviazione e stanze stanno per essere superati.", "StorageAndUserHeader": "I limiti di spazio di archiviazione e amministratori/utenti esperti stanno per essere superati.", "StorageQuotaHeader": "Lo spazio di archiviazione sta per essere esaurito: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Puoi rimuovere i file non necessari o modificare la quota nelle <1>mpostazioni di gestione dello spazio di archiviazione.", diff --git a/packages/client/public/locales/ja-JP/MainBar.json b/packages/client/public/locales/ja-JP/MainBar.json index 95a6010f42..6709a73ad3 100644 --- a/packages/client/public/locales/ja-JP/MainBar.json +++ b/packages/client/public/locales/ja-JP/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "もう一度アクティベーションを要求する", "RoomQuotaDescription": "不要なルームをアーカイブしたり、<1>{{clickHere}}して、{{productName}}にもっと適した料金プランを見つけることができます。", "RoomQuotaHeader": "このルームは、もうすぐ制限を超えます:{{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "ストレージやルームの制限を超えそうです。", "StorageAndUserHeader": "ストレージと管理者/パワーユーザーの制限を超えそうです。", "StorageQuotaHeader": "ストレージのスペースは、もうすぐサイズ上限を超えます:{{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "不要ファイルを削除するか、<1>ストレージ管理設定で容量制限の変更ができます。", diff --git a/packages/client/public/locales/ko-KR/MainBar.json b/packages/client/public/locales/ko-KR/MainBar.json index a437ee6f9f..43ba0a8aad 100644 --- a/packages/client/public/locales/ko-KR/MainBar.json +++ b/packages/client/public/locales/ko-KR/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "다시 한 번 활성화 요청", "RoomQuotaDescription": "불필요한 방을 아카이브하거나 <1>{{clickHere}}하여 더 적합한 {{productName}} 요금제를 찾으세요.", "RoomQuotaHeader": "방이 곧 초과될 예정입니다: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "곧 저장 용량 및 방 한도를 초과하게 됩니다.", "StorageAndUserHeader": "곧 저장 용량 및 관리자/고급 사용자 수 한도를 초과하게 됩니다.", "StorageQuotaHeader": "저장 공간 용량이 곧 초과될 예정입니다: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "<1>스토리지 관리 설정에서 할당량을 변경하거나 불필요한 파일을 삭제하세요.", diff --git a/packages/client/public/locales/lo-LA/MainBar.json b/packages/client/public/locales/lo-LA/MainBar.json index 9363f573a7..731946e6b3 100644 --- a/packages/client/public/locales/lo-LA/MainBar.json +++ b/packages/client/public/locales/lo-LA/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "ຮ້ອງຂໍການເປີດໃຊ້ອີກເທື່ອຫນຶ່ງ", "RoomQuotaDescription": "ທ່ານສາມາດຈັດເກັບຫ້ອງທີ່ບໍ່ຈໍາເປັນໄວ້ ຫຼື <1 >{{clickHere}} ເພື່ອຊອກຫາແຜນລາຄາທີ່ເໝາະສົມກວ່າສໍາລັບ {{productName}} ຂອງທ່ານ.", "RoomQuotaHeader": "ຫ້ອງກຳລັງຈະເກີນ: {{ currentValue }} / {{ maxValue }}", - "StorageAndRoomHeader": "ກໍາລັງຈະເກີນຂີດຈຳກັດບ່ອນຈັດເກັບຂໍ້ມູນ ແລະຫ້ອງ.", "StorageAndUserHeader": "ບ່ອນຈັດເກັບຂໍ້ມູນ ແລະ ຜູ້ເບິ່ງແຍງລະບົບ/ຜູ້ໃຊ້ກຳລັງຈະເກີນຂີດຈຳກັດ.", "StorageQuotaHeader": "ຈຳນວນພື້ນທີ່ຈັດເກັບກຳລັງຈະເກີນ: {{ currentValue }} / {{ maxValue }}", "TenantCustomQuotaDescription": "ທ່ານສາມາດລຶບໄຟລ໌ທີ່ບໍ່ຈໍາເປັນອອກ ຫຼືປ່ຽນໂຄຕ້າໄດ້ໃນ <1>ການຕັ້ງຄ່າການຈັດການບ່ອນເກັບຂໍ້ມູນ.", diff --git a/packages/client/public/locales/lv/MainBar.json b/packages/client/public/locales/lv/MainBar.json index ff794e6c2c..12709f3d7f 100644 --- a/packages/client/public/locales/lv/MainBar.json +++ b/packages/client/public/locales/lv/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Vēreiz pieprasīt aktivizāciju", "RoomQuotaDescription": "Varat arhivēt nevajadzīgās telpas vai <1>{{clickHere}}, lai atrastu savam {{productName}} piemērotāku cenu plānu.", "RoomQuotaHeader": "Tūlīt tiks pārsniegtas telpas: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Drīz tiks pārsniegti krātuves un telpu ierobežojumi.", "StorageAndUserHeader": "Tūlīt tiks pārsniegti krātuves un administratoru/prasmīgo lietotāju ierobežojumi.", "StorageQuotaHeader": "Tūlīt tiks pārsniegts krātuves vietas apjoms: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Jūs varat noņemt nevajadzīgos failus vai mainīt kvotu <1>Krātuves pārvaldības iestatījumos.", diff --git a/packages/client/public/locales/nl/MainBar.json b/packages/client/public/locales/nl/MainBar.json index e5abd3efd1..5396f375c3 100644 --- a/packages/client/public/locales/nl/MainBar.json +++ b/packages/client/public/locales/nl/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Activatie opnieuw aanvragen", "RoomQuotaDescription": "U kunt de overbodige kamers archiveren of <1>{{clickHere}} om een meer geschikt prijsplan voor uw {{productName}} te vinden.", "RoomQuotaHeader": "Kamers staat op het punt overschreden te worden: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Opslag- en kamerlimieten staan op het punt overschreden te worden.", "StorageAndUserHeader": "De beperkingen voor opslag en beheerders/power users worden binnenkort overschreden.", "StorageQuotaHeader": "De hoeveelheid opslagruimte staat op het punt overschreden te worden: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "U kunt de onnodige bestanden verwijderen of de quota wijzigen in de <1>Instellingen voor opslagbeheer.", diff --git a/packages/client/public/locales/pl/MainBar.json b/packages/client/public/locales/pl/MainBar.json index 2114066201..319268b2f8 100644 --- a/packages/client/public/locales/pl/MainBar.json +++ b/packages/client/public/locales/pl/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Poproś o aktywację jeszcze raz", "RoomQuotaDescription": "Możesz zarchiwizować niepotrzebne pokoje lub <1>{{clickHere}}, aby znaleźć bardziej odpowiedni plan cenowy dla swojego konta {{productName}}.", "RoomQuotaHeader": "Liczba pokoi zostanie niedługo przekroczona: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Limity pamięci i pokoi zostaną wkrótce przekroczone.", "StorageAndUserHeader": "Limity pamięci/użytkowników z większą liczbą uprawnień zostaną wkrótce przekroczone.", "StorageQuotaHeader": "Ilość miejsca w pamięci zostanie wkrótce przekroczona: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Możesz usunąć niepotrzebne pliki lub zmienić limit w <1>ustawieniach zarządzania pamięcią.", diff --git a/packages/client/public/locales/pt-BR/MainBar.json b/packages/client/public/locales/pt-BR/MainBar.json index e996f4e6b4..4db970ab83 100644 --- a/packages/client/public/locales/pt-BR/MainBar.json +++ b/packages/client/public/locales/pt-BR/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Solicitar ativação mais uma vez", "RoomQuotaDescription": "Você pode arquivar as salas desnecessárias ou <1>{{clickHere}} para encontrar um plano de preços mais adequado para o seu {{productName}}.", "RoomQuotaHeader": "As salas estão prestes a ser excedidos: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Os limites de armazenamento e salas estão prestes a ser excedidos.", "StorageAndUserHeader": "Os limites de armazenamento e administradores/usuários avançados estão prestes a ser excedidos.", "StorageQuotaHeader": "A quantidade de espaço de armazenamento está prestes a ser excedida: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Você pode remover os arquivos desnecessários ou alterar a cota nas <1>Configurações de gerenciamento de armazenamento.", diff --git a/packages/client/public/locales/pt/MainBar.json b/packages/client/public/locales/pt/MainBar.json index f97bc4808b..9c16f5c6fe 100644 --- a/packages/client/public/locales/pt/MainBar.json +++ b/packages/client/public/locales/pt/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Solicitar a ativação novamente", "RoomQuotaDescription": "Pode arquivar as salas desnecessárias ou <1>{{clickHere}} para encontrar um plano de preços mais adequado para o seu {{productName}}.", "RoomQuotaHeader": "Salas que estão prestes a ser excedidas: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Os limites de armazenamento e de salas estão prestes a ser excedidos.", "StorageAndUserHeader": "Os limites para o armazenamento e para o número de administradores/utilizadores com poder estão prestes a ser excedidos.", "StorageQuotaHeader": "A capacidade de armazenamento do espaço está prestes a ser excedida: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Você pode remover os arquivos desnecessários ou alterar a cota nas <1>Configurações de gerenciamento de armazenamento.", diff --git a/packages/client/public/locales/ro/MainBar.json b/packages/client/public/locales/ro/MainBar.json index 218c2a2eb3..77dd19eba2 100644 --- a/packages/client/public/locales/ro/MainBar.json +++ b/packages/client/public/locales/ro/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Solicitaţi activarea din nou", "RoomQuotaDescription": "Puteţi arhiva sălile inutile sau <1>{{clickHere}} pentru a găsi un abonament mai potrivit pentru spaţiul dvs {{productName}}.", "RoomQuotaHeader": "Cota sălilor este pe punctul de a fi depăşită: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Limite de stocare și cota sălilor sunt pe punctul de a fi depăşiti.", "StorageAndUserHeader": "Limite de stocare pentru administratori/utilizatori avansați sunt pe punctul de a fi depăşiti.", "StorageQuotaHeader": "Cota spaţiului de stocare este pe punctul de a fi depăşită: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Puteţi elimina fişierele inutile sau modifica cotă de stocare din secțiunea <1>Setările de gestionare a spațiului de stocare..", diff --git a/packages/client/public/locales/ru/MainBar.json b/packages/client/public/locales/ru/MainBar.json index e7c2fafab0..6262b482bf 100644 --- a/packages/client/public/locales/ru/MainBar.json +++ b/packages/client/public/locales/ru/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Запросить активацию еще раз", "RoomQuotaDescription": "Вы можете заархивировать ненужные комнаты или <1>{{clickHere}} , чтобы найти лучший тарифный план для {{productName}}.", "RoomQuotaHeader": "Количество комнат скоро будет превышено: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Объем дискового пространства и количество комнат скоро будут превышены.", "StorageAndUserHeader": "Объем дискового пространства и количество администраторов/опытных пользователей скоро будут превышены. ", "StorageQuotaHeader": "Объем дискового пространства скоро будет превышен: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Удалить ненужные файлы или изменить квоту можно в <1>Настройках управления хранилищем.", diff --git a/packages/client/public/locales/si/MainBar.json b/packages/client/public/locales/si/MainBar.json index 2f100ad2d3..cfdd4013c7 100644 --- a/packages/client/public/locales/si/MainBar.json +++ b/packages/client/public/locales/si/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "නැවත වරක් සක්‍රියනය ඉල්ලන්න", "RoomQuotaDescription": "ඔබට අනවශ්‍ය කාමර සංරක්‍ෂණය කිරීමට හැකිය හෝ ඔබගේ {{productName}} සඳහා වඩාත් සුදුසු මිලකරණ සැලසුමක් සොයා ගැනීමට <1>{{clickHere}}.", "RoomQuotaHeader": "කාමර ගණන ඉක්මවීමට ආසන්නයි: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "ආචයනය සහ කාමර සීමා ඉක්මවා යාමට ආසන්නයි.", "StorageAndUserHeader": "ආචයනය සහ පරිපාලකයින්/බලවත් පරිශ්‍රීලකයින්ගේ සීමා ඉක්මවා යාමට ආසන්නයි.", "StorageQuotaHeader": "ආචයනයේ ඉඩ ඉක්මවීමට ආසන්නයි: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "ඔබට <1>ආචයන කළමනාකරණ සැකසුම් මගින් අනවශ්‍ය ගොනු ඉවත් කිරීමට හෝ සලාකය වෙනස් කිරීමට හැකිය.", diff --git a/packages/client/public/locales/sk/MainBar.json b/packages/client/public/locales/sk/MainBar.json index 71cc0d3c1e..80d5b2945d 100644 --- a/packages/client/public/locales/sk/MainBar.json +++ b/packages/client/public/locales/sk/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Požiadať o aktiváciu ešte raz", "RoomQuotaDescription": "Miestnosti, ktore nepotrebujete môžete archivovať alebo <1>{{clickHere}} nájsť lepší plán pre svoj {{productName}}.", "RoomQuotaHeader": "Počet miestností bude čoskoro prekročený: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Limity úložísk a miestností budú čoskoro prekročené.", "StorageAndUserHeader": "Objem úložísk a maximálny počet administrátorov/pokročilých používateľov budú čoskoro prekročené.", "StorageQuotaHeader": "Veľkosť úložného priestoru bude čoskoro prekročená: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Nepotrebné súbory môžete odstrániť alebo zmeniť kvótu v <1> Nastaveniach spravovania úložísk.", diff --git a/packages/client/public/locales/sl/MainBar.json b/packages/client/public/locales/sl/MainBar.json index 354b2c5c6b..fefc89588b 100644 --- a/packages/client/public/locales/sl/MainBar.json +++ b/packages/client/public/locales/sl/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Ponovno zahtevaj aktivacijo", "RoomQuotaDescription": "Nepotrebne sobe lahko arhivirate ali <1>{{clickHere}} poiščete primerjenši finančni paket za vaš {{productName}}.", "RoomQuotaHeader": "Sobe bodo kmalu presežene: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Omejitve prostora za shranjevanje in število sob bodo kmalu presežene.", "StorageAndUserHeader": "Omejitve prostora za shranjevanje in število skrbnikov/naprednih uporabnikov bodo kmalu presežene.", "StorageQuotaHeader": "Dovoljen prostor za shranjevanje bo kmalu presežen: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Nepotrebne datoteke lahko odstranite ali spremenite kvoto v <1>Nastavitvah upravljanja shrambe.", diff --git a/packages/client/public/locales/sr-Cyrl-RS/MainBar.json b/packages/client/public/locales/sr-Cyrl-RS/MainBar.json index 07e7c5b69a..0d497e5b78 100644 --- a/packages/client/public/locales/sr-Cyrl-RS/MainBar.json +++ b/packages/client/public/locales/sr-Cyrl-RS/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Затражи активацију још једном", "RoomQuotaDescription": "Можете да архивирате непотребне собе или <1>{{clickHere}} да бисте пронашли прикладнији план цена за ваш {{productName}}.", "RoomQuotaHeader": "Број соба ц́е ускоро бити прекорачен: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Ограничења складишта и соба ће ускоро бити прекорачена.", "StorageAndUserHeader": "Ограничења складишта и администратора/напредних корисника ће ускоро бити прекорачена.", "StorageQuotaHeader": "Количина меморијског простора ц́е ускоро бити прекорачена: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Можете уклонити непотребне датотеке или променити квоту у <1>Storage management settings.", diff --git a/packages/client/public/locales/sr-Latn-RS/MainBar.json b/packages/client/public/locales/sr-Latn-RS/MainBar.json index 3b924ad9d2..5a273bccae 100644 --- a/packages/client/public/locales/sr-Latn-RS/MainBar.json +++ b/packages/client/public/locales/sr-Latn-RS/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Zatraži aktivaciju još jednom", "RoomQuotaDescription": "Možete da arhivirate nepotrebne sobe ili <1>{{clickHere}} da biste pronašli prikladniji plan cena za vaš {{productName}}.", "RoomQuotaHeader": "Broj soba će uskoro biti prekoračen: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Ograničenja skladišta i soba će uskoro biti prekoračena.", "StorageAndUserHeader": "Ograničenja skladišta i administratora/naprednih korisnika će uskoro biti prekoračena.", "StorageQuotaHeader": "Količina memorijskog prostora će uskoro biti prekoračena: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Možete ukloniti nepotrebne datoteke ili promeniti kvotu u <1>Storage management settings.", diff --git a/packages/client/public/locales/tr/MainBar.json b/packages/client/public/locales/tr/MainBar.json index d6ae1158fb..855f55c789 100644 --- a/packages/client/public/locales/tr/MainBar.json +++ b/packages/client/public/locales/tr/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Tekrar aktivasyon iste", "RoomQuotaDescription": "Gereksiz odaları arşivleyebilirsiniz veya <1>{{clickHere}} ile {{productName}}'iniz için daha uygun bir fiyatlandırma planı bulabilirsiniz.", "RoomQuotaHeader": "Odalar aşılmak üzere: {{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Depolama ve oda limitleri aşılmak üzere.", "StorageAndUserHeader": "Depolama ve yöneticiler/uzman kullanıcılar limitleri aşılmak üzere.", "StorageQuotaHeader": "Depolama alanı miktarı aşılmak üzere: {{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Gereksiz dosyaları kaldırabilir veya <1>Depolama yönetimi ayarlarından kotayı değiştirebilirsiniz.", diff --git a/packages/client/public/locales/uk-UA/MainBar.json b/packages/client/public/locales/uk-UA/MainBar.json index f9a9318d57..c96b05da43 100644 --- a/packages/client/public/locales/uk-UA/MainBar.json +++ b/packages/client/public/locales/uk-UA/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Запитати активацію ще раз", "RoomQuotaDescription": "Ви можете архівувати непотрібні кімнати або <1>{{clickHere}}, щоб знайти більш підходящий тарифний план для вашого {{productName}}.", "RoomQuotaHeader": "Кількість кімнат скоро буде перевищено: {{currentValue}}/{{maxValue}}", - "StorageAndRoomHeader": "Обмеження сховища та кількості кімнат скоро буде перевищено.", "StorageAndUserHeader": "Обмеження сховища та обмеження для адміністраторів / досвідчених користувачів скоро буде перевищено.", "StorageQuotaHeader": "Обсяг сховища скоро буде перевищено: {{currentValue}}/{{maxValue}}", "TenantCustomQuotaDescription": "Ви можете видалити непотрібні файли або змінити квоту в <1>Параметрах керування сховищем.", diff --git a/packages/client/public/locales/vi/MainBar.json b/packages/client/public/locales/vi/MainBar.json index eab15b887e..fceb43d99d 100644 --- a/packages/client/public/locales/vi/MainBar.json +++ b/packages/client/public/locales/vi/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "Yêu cầu kích hoạt lại", "RoomQuotaDescription": "Bạn có thể sao lưu các phòng không cần thiết hoặc <1>{{clickHere}} để tìm gói dịch vụ có giá phù hợp hơn cho {{productName}} của mình.", "RoomQuotaHeader": "Phòng sắp vượt quá:{{currentValue}} / {{maxValue}}", - "StorageAndRoomHeader": "Sắp vượt quá giới hạn lưu trữ và phòng.", "StorageAndUserHeader": "Sắp vượt quá giới hạn lưu trữ và quản trị viên/người dùng cấp cao.", "StorageQuotaHeader": "Dung lượng lưu trữ sắp vượt quá:{{currentValue}} / {{maxValue}}", "TenantCustomQuotaDescription": "Bạn có thể xóa các tập tin không cần thiết hoặc thay đổi hạn mức trong cài đặt Quản lý lưu trữ <1>.", diff --git a/packages/client/public/locales/zh-CN/MainBar.json b/packages/client/public/locales/zh-CN/MainBar.json index 46664f1b46..ab4532f7a1 100644 --- a/packages/client/public/locales/zh-CN/MainBar.json +++ b/packages/client/public/locales/zh-CN/MainBar.json @@ -7,7 +7,6 @@ "RequestActivation": "请求再次激活", "RoomQuotaDescription": "您可以存档不必要的房间或<1>{{clickHere}}为您的{{productName}}找到更合适的定价计划。", "RoomQuotaHeader": "房间数量即将超出限制:{{currentValue}}/{{maxValue}}", - "StorageAndRoomHeader": "存储和房间的限制即将被超过。", "StorageAndUserHeader": "存储和管理员/高级用户的数量限制即将被超过。", "StorageQuotaHeader": "存储空间数量即将超出限制:{{currentValue}}/{{maxValue}}", "TenantCustomQuotaDescription": "您可以在<1>存储空间管理设置中删除不必要的文件,或更改配额。", diff --git a/packages/client/src/components/MainBar/QuotasBar.js b/packages/client/src/components/MainBar/QuotasBar.js index b88056246d..8becf76fde 100644 --- a/packages/client/src/components/MainBar/QuotasBar.js +++ b/packages/client/src/components/MainBar/QuotasBar.js @@ -70,30 +70,7 @@ const QuotasBar = ({ ); }; - const getUserQuotaDescription = () => { - if (!isAdmin) return t("UserTariffAlmostReached"); - return ( - - ), - }} - /> - ); - }; const getUserTariffAlmostLimit = () => { if (!isAdmin) return t("UserTariffAlmostReached", { From bc3728aabfec0e00668d49c61d18f7cbc200493f Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Thu, 15 Aug 2024 12:46:55 +0300 Subject: [PATCH 059/140] Client: Store: ProfileActionsStore: Fixed isTeamTrainingAlertAvailable usage --- packages/client/src/store/ProfileActionsStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/store/ProfileActionsStore.js b/packages/client/src/store/ProfileActionsStore.js index ef6ed373b4..6c620bed1d 100644 --- a/packages/client/src/store/ProfileActionsStore.js +++ b/packages/client/src/store/ProfileActionsStore.js @@ -347,7 +347,7 @@ class ProfileActionsStore { let bookTraining = null; - if (!isMobile && this.isTeamTrainingAlertAvailable) { + if (!isMobile && this.authStore.isTeamTrainingAlertAvailable) { bookTraining = { key: "user-menu-book-training", icon: BookTrainingReactSvgUrl, From 6678fbd711f8cb125380809651592378246ea10a Mon Sep 17 00:00:00 2001 From: Vlada Gazizova <94864088+gazizova-vlada@users.noreply.github.com> Date: Thu, 15 Aug 2024 12:56:28 +0300 Subject: [PATCH 060/140] Fixed Bug 69669:Settings:Branding. A custom logo will be stretched when inviting a user to the portal. --- .../src/pages/Confirm/sub-components/StyledCreateUser.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/client/src/pages/Confirm/sub-components/StyledCreateUser.js b/packages/client/src/pages/Confirm/sub-components/StyledCreateUser.js index a8d6aa98bf..461ebb1614 100644 --- a/packages/client/src/pages/Confirm/sub-components/StyledCreateUser.js +++ b/packages/client/src/pages/Confirm/sub-components/StyledCreateUser.js @@ -65,15 +65,13 @@ export const GreetingContainer = styled.div` .portal-logo { width: 100%; + max-width: 386px; + height: 44px; + margin: 0 auto; padding-bottom: 16px; - height: 26.56px; display: flex; align-items: center; justify-content: center; - - .injected-svg { - height: 26.56px; - } } `; From b45c92b209f3a999e5b990fbc5ac98acba2b6dd0 Mon Sep 17 00:00:00 2001 From: Vlada Gazizova <94864088+gazizova-vlada@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:32:28 +0300 Subject: [PATCH 061/140] Fixed Bug 69668:Settings:Branding. Part of the custom logo is hidden behind a QR code when activating 2FA for the first time --- .../src/pages/Confirm/sub-components/tfaActivation.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/client/src/pages/Confirm/sub-components/tfaActivation.js b/packages/client/src/pages/Confirm/sub-components/tfaActivation.js index 46ebbd7aee..6ae97dc143 100644 --- a/packages/client/src/pages/Confirm/sub-components/tfaActivation.js +++ b/packages/client/src/pages/Confirm/sub-components/tfaActivation.js @@ -97,6 +97,12 @@ const StyledForm = styled(Box)` .set-app-description { width: 100%; max-width: 500px; + + .portal-logo { + margin: 0 auto; + max-width: 386px; + height: 44px; + } } .set-app-title { From 358f0b38f2213696751104ba5e7a0f799a4ed916 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Thu, 15 Aug 2024 13:42:17 +0300 Subject: [PATCH 062/140] Client: Added toast appearance and role reset to free when invited to a room. --- packages/client/src/components/MainBar/Bar.js | 6 ----- .../sub-components/ExternalLinks.js | 7 +++-- .../InvitePanel/sub-components/InviteInput.js | 27 ++++++++++++++++--- .../panels/InvitePanel/sub-components/Item.js | 18 ++++++++++--- .../panels/InvitePanel/utils/index.js | 22 +++++++++++++++ 5 files changed, 65 insertions(+), 15 deletions(-) diff --git a/packages/client/src/components/MainBar/Bar.js b/packages/client/src/components/MainBar/Bar.js index 16cd65fadd..a73be566b9 100644 --- a/packages/client/src/components/MainBar/Bar.js +++ b/packages/client/src/components/MainBar/Bar.js @@ -331,12 +331,6 @@ const Bar = (props) => { // currentValue: null, // }; // } - console.log( - "isUserTariffAlmostLimit", - isUserTariffAlmostLimit, - isStorageTariffAlmostLimit, - barVisible.storageAndUserTariff, - ); if ( isRoomTariffAlmostLimit && diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/ExternalLinks.js b/packages/client/src/components/panels/InvitePanel/sub-components/ExternalLinks.js index 90f59cdaa3..57cbecf4a8 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/ExternalLinks.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/ExternalLinks.js @@ -53,8 +53,7 @@ import { StyledDescription, } from "../StyledInvitePanel"; -import { getPaidQuotaLimitError } from "SRC_DIR/helpers/filesUtils"; - +import { getFreeUsersRoleArray, getFreeUsersTypeArray } from "../utils"; const ExternalLinks = ({ t, @@ -208,6 +207,9 @@ const ExternalLinks = ({ [closeActionLinks], ); + const availableAccess = + roomId === -1 ? getFreeUsersTypeArray() : getFreeUsersRoleArray(); + return ( @@ -278,6 +280,7 @@ const ExternalLinks = ({ isMobileView={isMobileView} isSelectionDisabled={isPaidUserLimit} selectionErrorText={} + availableAccess={availableAccess} /> )} diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js b/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js index 07e3bd7b64..81ea6bc48a 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js @@ -50,7 +50,7 @@ import { isBetaLanguage } from "@docspace/shared/utils"; import { checkIfAccessPaid } from "SRC_DIR/helpers"; import AddUsersPanel from "../../AddUsersPanel"; -import { getAccessOptions, getTopFreeRole } from "../utils"; +import { getAccessOptions, getTopFreeRole, isPaidRoleUser } from "../utils"; import AccessSelector from "../../../AccessSelector"; import { @@ -151,12 +151,24 @@ const InviteInput = ({ }); } - isPaidUserAccess(selectedAccess) && setInvitePaidUsersCount(); + roomId === -1 && + isPaidUserAccess(selectedAccess) && + setInvitePaidUsersCount(); + + let userAccess = selectedAccess; + + if (isPaidUserLimit && roomId !== -1 && isPaidRoleUser(userAccess)) { + const freeRole = getTopFreeRole(t, roomType)?.access; + if (freeRole) { + userAccess = freeRole; + toastr.error(); + } + } return { email: addresses[0].email, id: uid(), - access: selectedAccess, + access: userAccess, displayName: addresses[0].email, errors: addresses[0].parseErrors, isEmailInvite: true, @@ -333,6 +345,15 @@ const InviteInput = ({ roleName: topFreeRole.label, }); } + + if (isPaidUserLimit && isPaidRoleUser(u.access)) { + const freeRole = getTopFreeRole(t, roomType)?.access; + + if (freeRole) { + u.access = freeRole; + toastr.error(); + } + } }); const items = [...users, ...inviteItems]; diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/Item.js b/packages/client/src/components/panels/InvitePanel/sub-components/Item.js index 24c432ed73..2092ec3f7d 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/Item.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/Item.js @@ -36,7 +36,13 @@ import { Text } from "@docspace/shared/components/text"; import { parseAddresses } from "@docspace/shared/utils"; import { getUserTypeLabel } from "@docspace/shared/utils/common"; -import { getAccessOptions } from "../utils"; +import { + getAccessOptions, + getFreeUsersRoleArray, + getFreeUsersTypeArray, + getTopFreeRole, + isPaidRoleUser, +} from "../utils"; import { StyledEditInput, StyledEditButton, @@ -50,7 +56,7 @@ import { filterGroupRoleOptions, filterUserRoleOptions } from "SRC_DIR/helpers"; import AccessSelector from "../../../AccessSelector"; import PaidQuotaLimitError from "SRC_DIR/components/PaidQuotaLimitError"; -import { EmployeeType } from "@docspace/shared/enums"; +import { EmployeeType, ShareAccessRights } from "@docspace/shared/enums"; const Item = ({ t, @@ -81,6 +87,7 @@ const Item = ({ isGroup, name: groupName, warning, + isVisitor, } = item; const name = isGroup @@ -200,6 +207,9 @@ const Item = ({ const textProps = !!avatar || isGroup ? {} : { onClick: onEdit }; + const availableAccess = + roomId === -1 ? getFreeUsersTypeArray() : getFreeUsersRoleArray(); + const displayBody = ( <> @@ -261,10 +271,10 @@ const Item = ({ setIsOpenItemAccess={setIsOpenItemAccess} isMobileView={isMobileView} noBorder - {...(roomId === -1 && { + {...((roomId === -1 || !avatar || isVisitor) && { isSelectionDisabled: isPaidUserLimit, selectionErrorText: , - availableAccess: [EmployeeType.Guest], + availableAccess, })} /> diff --git a/packages/client/src/components/panels/InvitePanel/utils/index.js b/packages/client/src/components/panels/InvitePanel/utils/index.js index 951954fe6b..d101dedd0a 100644 --- a/packages/client/src/components/panels/InvitePanel/utils/index.js +++ b/packages/client/src/components/panels/InvitePanel/utils/index.js @@ -258,3 +258,25 @@ export const getTopFreeRole = (t, roomType) => { ); return freeAccesses[0]; }; + +export const isPaidRoleUser = (selectedAccess) => { + return ( + selectedAccess === ShareAccessRights.FullAccess || + selectedAccess === ShareAccessRights.Collaborator || + selectedAccess === ShareAccessRights.RoomManager + ); +}; + +export const getFreeUsersTypeArray = () => { + return [EmployeeType.Guest]; +}; + +export const getFreeUsersRoleArray = () => { + return [ + ShareAccessRights.Comment, + ShareAccessRights.Editing, + ShareAccessRights.FormFilling, + ShareAccessRights.ReadOnly, + ShareAccessRights.Review, + ]; +}; From 0b16e4bfdd62b3f59f1f2aa051a41d041f928752 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Thu, 15 Aug 2024 13:45:52 +0300 Subject: [PATCH 063/140] Client: Renaming. --- .../panels/InvitePanel/sub-components/InviteInput.js | 6 +++--- .../components/panels/InvitePanel/sub-components/Item.js | 2 -- .../client/src/components/panels/InvitePanel/utils/index.js | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js b/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js index 81ea6bc48a..1b16f3fa67 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/InviteInput.js @@ -50,7 +50,7 @@ import { isBetaLanguage } from "@docspace/shared/utils"; import { checkIfAccessPaid } from "SRC_DIR/helpers"; import AddUsersPanel from "../../AddUsersPanel"; -import { getAccessOptions, getTopFreeRole, isPaidRoleUser } from "../utils"; +import { getAccessOptions, getTopFreeRole, isPaidUserRole } from "../utils"; import AccessSelector from "../../../AccessSelector"; import { @@ -157,7 +157,7 @@ const InviteInput = ({ let userAccess = selectedAccess; - if (isPaidUserLimit && roomId !== -1 && isPaidRoleUser(userAccess)) { + if (isPaidUserLimit && roomId !== -1 && isPaidUserRole(userAccess)) { const freeRole = getTopFreeRole(t, roomType)?.access; if (freeRole) { userAccess = freeRole; @@ -346,7 +346,7 @@ const InviteInput = ({ }); } - if (isPaidUserLimit && isPaidRoleUser(u.access)) { + if (isPaidUserLimit && isPaidUserRole(u.access)) { const freeRole = getTopFreeRole(t, roomType)?.access; if (freeRole) { diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/Item.js b/packages/client/src/components/panels/InvitePanel/sub-components/Item.js index 2092ec3f7d..55fada0f7d 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/Item.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/Item.js @@ -40,8 +40,6 @@ import { getAccessOptions, getFreeUsersRoleArray, getFreeUsersTypeArray, - getTopFreeRole, - isPaidRoleUser, } from "../utils"; import { StyledEditInput, diff --git a/packages/client/src/components/panels/InvitePanel/utils/index.js b/packages/client/src/components/panels/InvitePanel/utils/index.js index d101dedd0a..550f65c2d0 100644 --- a/packages/client/src/components/panels/InvitePanel/utils/index.js +++ b/packages/client/src/components/panels/InvitePanel/utils/index.js @@ -259,7 +259,7 @@ export const getTopFreeRole = (t, roomType) => { return freeAccesses[0]; }; -export const isPaidRoleUser = (selectedAccess) => { +export const isPaidUserRole = (selectedAccess) => { return ( selectedAccess === ShareAccessRights.FullAccess || selectedAccess === ShareAccessRights.Collaborator || From 58d7d5b94e5f74e4eb9429ab162dd10bb0f44e5d Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Thu, 15 Aug 2024 13:52:17 +0300 Subject: [PATCH 064/140] Client: Refactoring. --- .../components/panels/InvitePanel/index.js | 62 ++++++++++--------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/packages/client/src/components/panels/InvitePanel/index.js b/packages/client/src/components/panels/InvitePanel/index.js index da952601bc..65bd3b4148 100644 --- a/packages/client/src/components/panels/InvitePanel/index.js +++ b/packages/client/src/components/panels/InvitePanel/index.js @@ -268,6 +268,39 @@ const InvitePanel = ({ defaultAccess: 1, }); }; + + const getError = () => { + const paymentLink = ( + + ), + }} + /> + ); + + return ( + <> + + {t("Common:PaidUsersExceedsLimit", { + count: maxCountManagersByQuota + invitePaidUsersCount, + limit: maxCountManagersByQuota, + })} + +   + {!isRoomAdmin && paymentLink} + + ); + }; const onClickSend = async (e) => { const invitations = inviteItems.map((item) => { let newItem = {}; @@ -315,34 +348,7 @@ const InvitePanel = ({ let error = err; if (err?.response?.status === 402) { - error = ( - <> - - {t("Common:PaidUsersExceedsLimit", { - count: maxCountManagersByQuota + invitePaidUsersCount, - limit: maxCountManagersByQuota, - })} - -   - {!isRoomAdmin && ( - - ), - }} - /> - )} - - ); + error = getError(); } toastr.error(error); From a19211f9a64b955a37aef41089e9bac02b2fcd4d Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Thu, 15 Aug 2024 13:53:00 +0300 Subject: [PATCH 065/140] Client: Refactoring. --- .../src/components/panels/InvitePanel/sub-components/Item.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/client/src/components/panels/InvitePanel/sub-components/Item.js b/packages/client/src/components/panels/InvitePanel/sub-components/Item.js index 55fada0f7d..85410f802d 100644 --- a/packages/client/src/components/panels/InvitePanel/sub-components/Item.js +++ b/packages/client/src/components/panels/InvitePanel/sub-components/Item.js @@ -54,7 +54,6 @@ import { filterGroupRoleOptions, filterUserRoleOptions } from "SRC_DIR/helpers"; import AccessSelector from "../../../AccessSelector"; import PaidQuotaLimitError from "SRC_DIR/components/PaidQuotaLimitError"; -import { EmployeeType, ShareAccessRights } from "@docspace/shared/enums"; const Item = ({ t, From 01ff3610d0e15bf294cfd922d116b8fc3f4e103a Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Thu, 15 Aug 2024 14:19:50 +0300 Subject: [PATCH 066/140] Fix Bug 61899 - Files.Uploads. Added saving of uploaded folder after renaming --- packages/client/src/HOCs/withFileActions.js | 13 ++--- .../src/components/Article/Body/Items.js | 12 ++--- .../components/Article/MainButton/index.js | 16 ++++-- .../client/src/pages/Home/Hooks/useFiles.js | 13 ++--- .../src/pages/Home/Section/Header/index.js | 12 ++++- .../client/src/store/FilesActionsStore.js | 49 +++++++++++++------ packages/client/src/store/HotkeyStore.js | 14 ++---- packages/client/src/store/UploadDataStore.js | 5 +- 8 files changed, 71 insertions(+), 63 deletions(-) diff --git a/packages/client/src/HOCs/withFileActions.js b/packages/client/src/HOCs/withFileActions.js index a6aea017c0..730e08923a 100644 --- a/packages/client/src/HOCs/withFileActions.js +++ b/packages/client/src/HOCs/withFileActions.js @@ -67,16 +67,9 @@ export default function withFileActions(WrappedFileItem) { dragging && setDragging(false); - const emptyFolders = files.filter((f) => f.isEmptyDirectory); - - if (emptyFolders.length > 0) { - uploadEmptyFolders(emptyFolders, uploadToFolder).then(() => { - const onlyFiles = files.filter((f) => !f.isEmptyDirectory); - if (onlyFiles.length > 0) startUpload(onlyFiles, uploadToFolder, t); - }); - } else { - startUpload(files, uploadToFolder, t); - } + uploadEmptyFolders(files, uploadToFolder).then((f) => { + if (f.length > 0) startUpload(f, null, t); + }); }; onDrop = (items) => { diff --git a/packages/client/src/components/Article/Body/Items.js b/packages/client/src/components/Article/Body/Items.js index f4b212e4fa..0de7f2ed67 100644 --- a/packages/client/src/components/Article/Body/Items.js +++ b/packages/client/src/components/Article/Body/Items.js @@ -86,16 +86,10 @@ const Item = ({ const onDropZoneUpload = React.useCallback( (files, uploadToFolder) => { dragging && setDragging(false); - const emptyFolders = files.filter((f) => f.isEmptyDirectory); - if (emptyFolders.length > 0) { - uploadEmptyFolders(emptyFolders, uploadToFolder).then(() => { - const onlyFiles = files.filter((f) => !f.isEmptyDirectory); - if (onlyFiles.length > 0) startUpload(onlyFiles, uploadToFolder, t); - }); - } else { - startUpload(files, uploadToFolder, t); - } + uploadEmptyFolders(files, uploadToFolder).then((f) => { + if (f.length > 0) startUpload(f, null, t); + }); }, [t, dragging, setDragging, startUpload, uploadEmptyFolders], ); diff --git a/packages/client/src/components/Article/MainButton/index.js b/packages/client/src/components/Article/MainButton/index.js index 6f1f4e0afb..10a03ddb20 100644 --- a/packages/client/src/components/Article/MainButton/index.js +++ b/packages/client/src/components/Article/MainButton/index.js @@ -70,6 +70,7 @@ import { resendInvitesAgain } from "@docspace/shared/api/people"; import { getCorrectFourValuesStyle } from "@docspace/shared/utils"; import { ArticleButtonLoader } from "@docspace/shared/skeletons/article"; import { isMobile, isTablet } from "react-device-detect"; +import getFilesFromEvent from "@docspace/shared/components/drag-and-drop/get-files-from-event"; const StyledButton = styled(Button)` font-weight: 700; @@ -180,6 +181,7 @@ const ArticleMainButtonContent = (props) => { parentRoomType, isFolder, + uploadEmptyFolders, } = props; const navigate = useNavigate(); @@ -239,8 +241,12 @@ const ArticleMainButtonContent = (props) => { ); const onFileChange = React.useCallback( - (e) => { - startUpload(e.target.files, null, t); + async (e) => { + const files = await getFilesFromEvent(e); + + uploadEmptyFolders(files).then((f) => { + if (f.length > 0) startUpload(f, null, t); + }); }, [startUpload, t], ); @@ -249,7 +255,7 @@ const ArticleMainButtonContent = (props) => { if (isPrivacy) { encryptionUploadDialog((encryptedFile, encrypted) => { encryptedFile.encrypted = encrypted; - startUpload([encryptedFile], null, t); + startUpload([encryptedFile], null, t); // TODO: uploadEmptyFolders }); } else { inputFilesElement.current.click(); @@ -901,6 +907,7 @@ export default inject( versionHistoryStore, userStore, currentTariffStatusStore, + filesActionsStore, }) => { const { showArticleLoader } = clientLoadingStore; const { mainButtonMobileVisible } = filesStore; @@ -945,6 +952,8 @@ export default inject( const { frameConfig, isFrame } = settingsStore; + const { uploadEmptyFolders } = filesActionsStore; + return { isGracePeriod, setInviteUsersWarningDialogVisible, @@ -997,6 +1006,7 @@ export default inject( isFolder, selectFileFormRoomDialogVisible, setSelectFileFormRoomDialogVisible, + uploadEmptyFolders, }; }, )( diff --git a/packages/client/src/pages/Home/Hooks/useFiles.js b/packages/client/src/pages/Home/Hooks/useFiles.js index 2f7ac09b6e..ab2a7560c7 100644 --- a/packages/client/src/pages/Home/Hooks/useFiles.js +++ b/packages/client/src/pages/Home/Hooks/useFiles.js @@ -118,16 +118,9 @@ const useFiles = ({ if (disableDrag) return; - const emptyFolders = files.filter((f) => f.isEmptyDirectory); - - if (emptyFolders.length > 0) { - uploadEmptyFolders(emptyFolders, uploadToFolder).then(() => { - const onlyFiles = files.filter((f) => !f.isEmptyDirectory); - if (onlyFiles.length > 0) startUpload(onlyFiles, uploadToFolder, t); - }); - } else { - startUpload(files, uploadToFolder, t); - } + uploadEmptyFolders(files, uploadToFolder).then((f) => { + if (f.length > 0) startUpload(f, null, t); + }); }; React.useEffect(() => { diff --git a/packages/client/src/pages/Home/Section/Header/index.js b/packages/client/src/pages/Home/Section/Header/index.js index 02426716ab..82e596b32d 100644 --- a/packages/client/src/pages/Home/Section/Header/index.js +++ b/packages/client/src/pages/Home/Section/Header/index.js @@ -50,6 +50,7 @@ import { getCategoryUrl, } from "SRC_DIR/helpers/utils"; import TariffBar from "SRC_DIR/components/TariffBar"; +import getFilesFromEvent from "@docspace/shared/components/drag-and-drop/get-files-from-event"; const StyledContainer = styled.div` width: 100%; @@ -225,6 +226,7 @@ const SectionHeaderContent = (props) => { getHeaderOptions, setBufferSelection, setGroupsBufferSelection, + uploadEmptyFolders, } = props; const location = useLocation(); @@ -239,8 +241,12 @@ const SectionHeaderContent = (props) => { const isSettingsPage = location.pathname.includes("/settings"); const onFileChange = React.useCallback( - (e) => { - startUpload(e.target.files, null, t); + async (e) => { + const files = await getFilesFromEvent(e); + + uploadEmptyFolders(files).then((f) => { + if (f.length > 0) startUpload(f, null, t); + }); }, [startUpload, t], ); @@ -639,6 +645,7 @@ export default inject( moveToRoomsPage, onClickBack, moveToPublicRoom, + uploadEmptyFolders, } = filesActionsStore; const { setIsVisible, isVisible } = infoPanelStore; @@ -802,6 +809,7 @@ export default inject( getHeaderOptions, setBufferSelection, setGroupsBufferSelection, + uploadEmptyFolders, }; }, )( diff --git a/packages/client/src/store/FilesActionsStore.js b/packages/client/src/store/FilesActionsStore.js index 1349a9ec62..9727fe35ae 100644 --- a/packages/client/src/store/FilesActionsStore.js +++ b/packages/client/src/store/FilesActionsStore.js @@ -229,17 +229,21 @@ class FilesActionStore { let level = { result }; try { folders.forEach((folder) => { - folder.path - .split("/") - .filter((name) => name !== "") - .reduce((r, name, i, a) => { - if (!r[name]) { - r[name] = { result: [] }; - r.result.push({ name, children: r[name].result }); - } + const folderPath = folder.path.split("/").filter((name) => name !== ""); - return r[name]; - }, level); + folderPath.reduce((r, name, i, a) => { + if (!r[name]) { + r[name] = { result: [] }; + r.result.push({ + name, + children: r[name].result, + isFile: folderPath.length - 1 === i && !folder.isEmptyDirectory, + file: folder, + }); + } + + return r[name]; + }, level); }); } catch (e) { console.error("convertToTree", e); @@ -247,28 +251,37 @@ class FilesActionStore { return result; }; - createFolderTree = async (treeList, parentFolderId) => { + createFolderTree = async (treeList, parentFolderId, filesList) => { if (!treeList || !treeList.length) return; for (let i = 0; i < treeList.length; i++) { const treeNode = treeList[i]; + const isFile = treeList[i].isFile; // console.log( // `createFolderTree parent id = ${parentFolderId} name '${treeNode.name}': `, // treeNode.children // ); + if (isFile) { + treeList[i].file.parentFolderId = parentFolderId; + filesList.push(treeList[i].file); + continue; + } + const folder = await createFolder(parentFolderId, treeNode.name); const parentId = folder.id; if (treeNode.children.length == 0) continue; - await this.createFolderTree(treeNode.children, parentId); + await this.createFolderTree(treeNode.children, parentId, filesList); } + + return treeList; }; - uploadEmptyFolders = async (emptyFolders, folderId) => { - //console.log("uploadEmptyFolders", emptyFolders, folderId); + uploadEmptyFolders = async (files, folderId) => { + //console.log("uploadEmptyFolders", files, folderId); const { secondaryProgressDataStore } = this.uploadDataStore; const { setSecondaryProgressBarData, clearSecondaryProgressData } = @@ -287,12 +300,16 @@ class FilesActionStore { operationId, }); - const tree = this.convertToTree(emptyFolders); - await this.createFolderTree(tree, toFolderId); + const tree = this.convertToTree(files); + + const filesList = []; + await this.createFolderTree(tree, toFolderId, filesList); this.updateCurrentFolder(null, [folderId], null, operationId); setTimeout(() => clearSecondaryProgressData(operationId), TIMEOUT); + + return filesList; }; updateFilesAfterDelete = (operationId) => { diff --git a/packages/client/src/store/HotkeyStore.js b/packages/client/src/store/HotkeyStore.js index 46ed343cdb..1d5dc2fc74 100644 --- a/packages/client/src/store/HotkeyStore.js +++ b/packages/client/src/store/HotkeyStore.js @@ -685,7 +685,6 @@ class HotkeyStore { uploadClipboardFiles = async (t, event) => { const { uploadEmptyFolders } = this.filesActionsStore; const { startUpload } = this.uploadDataStore; - const currentFolderId = this.selectedFolderStore.id; if (this.filesStore.hotkeysClipboard.length) { return this.moveFilesFromClipboard(t); @@ -693,16 +692,9 @@ class HotkeyStore { const files = await getFilesFromEvent(event); - const emptyFolders = files.filter((f) => f.isEmptyDirectory); - - if (emptyFolders.length > 0) { - uploadEmptyFolders(emptyFolders, currentFolderId).then(() => { - const onlyFiles = files.filter((f) => !f.isEmptyDirectory); - if (onlyFiles.length > 0) startUpload(onlyFiles, currentFolderId, t); - }); - } else { - startUpload(files, currentFolderId, t); - } + uploadEmptyFolders(files, uploadToFolder).then((f) => { + if (f.length > 0) startUpload(f, null, t); + }); }; get countTilesInRow() { diff --git a/packages/client/src/store/UploadDataStore.js b/packages/client/src/store/UploadDataStore.js index 34f3cdb11b..711e0e6aa7 100644 --- a/packages/client/src/store/UploadDataStore.js +++ b/packages/client/src/store/UploadDataStore.js @@ -773,7 +773,8 @@ class UploadDataStore { file: file, uniqueId: uniqueid("download_row-key_"), fileId: null, - toFolderId, + // toFolderId, + toFolderId: file.parentFolderId, action: "upload", error: file.size ? null : t("Files:EmptyFile"), fileInfo: null, @@ -1372,7 +1373,7 @@ class UploadDataStore { toFolderId, fileName, fileSize, - relativePath, + "", // relativePath, file.encrypted, file.lastModifiedDate, createNewIfExist, From 86f116e62fad3bca1fa14895144b8fb99130f582 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Thu, 15 Aug 2024 14:44:33 +0300 Subject: [PATCH 067/140] Fix Bug 69670 No name centering --- .../src/pages/Confirm/sub-components/StyledCreateUser.js | 5 ++++- .../client/src/pages/Confirm/sub-components/createUser.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/client/src/pages/Confirm/sub-components/StyledCreateUser.js b/packages/client/src/pages/Confirm/sub-components/StyledCreateUser.js index 461ebb1614..8ff8d3adf4 100644 --- a/packages/client/src/pages/Confirm/sub-components/StyledCreateUser.js +++ b/packages/client/src/pages/Confirm/sub-components/StyledCreateUser.js @@ -54,7 +54,10 @@ export const GreetingContainer = styled.div` } .tooltip { - p { + .invitation-text { + display: flex; + flex-direction: column; + align-items: center; text-align: center; } diff --git a/packages/client/src/pages/Confirm/sub-components/createUser.js b/packages/client/src/pages/Confirm/sub-components/createUser.js index 99eb5e95f6..fcd1292fea 100644 --- a/packages/client/src/pages/Confirm/sub-components/createUser.js +++ b/packages/client/src/pages/Confirm/sub-components/createUser.js @@ -485,7 +485,7 @@ const CreateUserForm = (props) => { {linkData.type === "LinkInvite" && (
- + {roomName ? ( Date: Thu, 15 Aug 2024 14:54:54 +0300 Subject: [PATCH 068/140] Shared: Utils: Fixed force redirect inside frame on 401 response --- packages/shared/utils/axiosClient.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/shared/utils/axiosClient.ts b/packages/shared/utils/axiosClient.ts index c035f9e298..cec4503331 100644 --- a/packages/shared/utils/axiosClient.ts +++ b/packages/shared/utils/axiosClient.ts @@ -220,10 +220,12 @@ class AxiosClient { } const loginURL = combineUrl(proxyURL, "/login"); + if (!this.isSSR) { switch (error.response?.status) { case 401: { - if (options.skipUnauthorized) return Promise.resolve(); + if (options.skipUnauthorized || window?.ClientConfig?.isFrame) + return Promise.resolve(); if (options.skipLogout) return Promise.reject(error); const opt: AxiosRequestConfig = { @@ -244,14 +246,13 @@ class AxiosClient { break; case 403: { const pathname = window.location.pathname; - const isFrame = window?.ClientConfig?.isFrame; const isArchived = pathname.indexOf("/rooms/archived") !== -1; const isRooms = pathname.indexOf("/rooms/shared") !== -1 || isArchived; - if (isRooms && !skipRedirect && !isFrame) { + if (isRooms && !skipRedirect && !window?.ClientConfig?.isFrame) { setTimeout(() => { window.DocSpace.navigate(isArchived ? "/archived" : "/"); }, 1000); From 70b0942dfb82517e50d133a786b16187322dc119 Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Thu, 15 Aug 2024 16:13:18 +0400 Subject: [PATCH 069/140] Bug 69519 - Accounts. Sorting by Last name field does not work --- .../client/src/pages/Home/Section/Filter/index.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/client/src/pages/Home/Section/Filter/index.js b/packages/client/src/pages/Home/Section/Filter/index.js index ca0e12ffb4..035cf37d16 100644 --- a/packages/client/src/pages/Home/Section/Filter/index.js +++ b/packages/client/src/pages/Home/Section/Filter/index.js @@ -1963,14 +1963,7 @@ const SectionFilterContent = ({ const firstName = { id: "sort-by_first-name", key: "firstname", - label: t("Common:FirstName"), - default: true, - }; - - const lastName = { - id: "sort-by_last-name", - key: "lastname", - label: t("Common:LastName"), + label: t("Common:Name"), default: true, }; @@ -2012,7 +2005,7 @@ const SectionFilterContent = ({ hideableColumns.Storage = storage; } - options.push(firstName, lastName, type, department, email); + options.push(firstName, type, department, email); if (showStorageInfo) options.push(storage); return options; From d2fec0391db7a93c891a3c8e07e50ac81d8c347c Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Thu, 15 Aug 2024 15:37:15 +0300 Subject: [PATCH 070/140] Web: Files: renamed uploadEmptyFolders to createFoldersTree --- packages/client/src/HOCs/withFileActions.js | 8 ++++---- .../client/src/components/Article/Body/Items.js | 16 ++++++++-------- .../src/components/Article/MainButton/index.js | 10 +++++----- packages/client/src/pages/Home/Hooks/useFiles.js | 4 ++-- .../src/pages/Home/Section/Header/index.js | 8 ++++---- packages/client/src/pages/Home/index.js | 8 ++++---- packages/client/src/store/FilesActionsStore.js | 4 ++-- packages/client/src/store/HotkeyStore.js | 4 ++-- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/packages/client/src/HOCs/withFileActions.js b/packages/client/src/HOCs/withFileActions.js index 730e08923a..105767bbaa 100644 --- a/packages/client/src/HOCs/withFileActions.js +++ b/packages/client/src/HOCs/withFileActions.js @@ -62,12 +62,12 @@ export default function withFileActions(WrappedFileItem) { }; onDropZoneUpload = (files, uploadToFolder) => { - const { t, dragging, setDragging, startUpload, uploadEmptyFolders } = + const { t, dragging, setDragging, startUpload, createFoldersTree } = this.props; dragging && setDragging(false); - uploadEmptyFolders(files, uploadToFolder).then((f) => { + createFoldersTree(files, uploadToFolder).then((f) => { if (f.length > 0) startUpload(f, null, t); }); }; @@ -364,7 +364,7 @@ export default function withFileActions(WrappedFileItem) { onSelectItem, //setNewBadgeCount, openFileAction, - uploadEmptyFolders, + createFoldersTree, } = filesActionsStore; const { setSharingPanelVisible } = dialogsStore; const { @@ -468,7 +468,7 @@ export default function withFileActions(WrappedFileItem) { dragging, setDragging, startUpload, - uploadEmptyFolders, + createFoldersTree, draggable, setTooltipPosition, setStartDrag, diff --git a/packages/client/src/components/Article/Body/Items.js b/packages/client/src/components/Article/Body/Items.js index 0de7f2ed67..e06439b783 100644 --- a/packages/client/src/components/Article/Body/Items.js +++ b/packages/client/src/components/Article/Body/Items.js @@ -68,7 +68,7 @@ const Item = ({ onBadgeClick, showDragItems, startUpload, - uploadEmptyFolders, + createFoldersTree, setDragging, showBadge, labelBadge, @@ -87,11 +87,11 @@ const Item = ({ (files, uploadToFolder) => { dragging && setDragging(false); - uploadEmptyFolders(files, uploadToFolder).then((f) => { + createFoldersTree(files, uploadToFolder).then((f) => { if (f.length > 0) startUpload(f, null, t); }); }, - [t, dragging, setDragging, startUpload, uploadEmptyFolders], + [t, dragging, setDragging, startUpload, createFoldersTree], ); const onDrop = React.useCallback( @@ -187,7 +187,7 @@ const Items = ({ dragging, setDragging, startUpload, - uploadEmptyFolders, + createFoldersTree, isVisitor, isCollaborator, isAdmin, @@ -320,7 +320,7 @@ const Items = ({ t={t} setDragging={setDragging} startUpload={startUpload} - uploadEmptyFolders={uploadEmptyFolders} + createFoldersTree={createFoldersTree} item={item} setBufferSelection={setBufferSelection} dragging={dragging} @@ -382,7 +382,7 @@ const Items = ({ showText, setDragging, startUpload, - uploadEmptyFolders, + createFoldersTree, trashIsEmpty, isAdmin, isVisitor, @@ -443,7 +443,7 @@ export default inject( const { id, access: folderAccess } = selectedFolderStore; const { moveDragItems, - uploadEmptyFolders, + createFoldersTree, deleteAction, emptyTrashInProgress, } = filesActionsStore; @@ -472,7 +472,7 @@ export default inject( setBufferSelection, deleteAction, startUpload, - uploadEmptyFolders, + createFoldersTree, setEmptyTrashDialogVisible, trashIsEmpty, diff --git a/packages/client/src/components/Article/MainButton/index.js b/packages/client/src/components/Article/MainButton/index.js index 10a03ddb20..a92377d711 100644 --- a/packages/client/src/components/Article/MainButton/index.js +++ b/packages/client/src/components/Article/MainButton/index.js @@ -181,7 +181,7 @@ const ArticleMainButtonContent = (props) => { parentRoomType, isFolder, - uploadEmptyFolders, + createFoldersTree, } = props; const navigate = useNavigate(); @@ -244,7 +244,7 @@ const ArticleMainButtonContent = (props) => { async (e) => { const files = await getFilesFromEvent(e); - uploadEmptyFolders(files).then((f) => { + createFoldersTree(files).then((f) => { if (f.length > 0) startUpload(f, null, t); }); }, @@ -255,7 +255,7 @@ const ArticleMainButtonContent = (props) => { if (isPrivacy) { encryptionUploadDialog((encryptedFile, encrypted) => { encryptedFile.encrypted = encrypted; - startUpload([encryptedFile], null, t); // TODO: uploadEmptyFolders + startUpload([encryptedFile], null, t); // TODO: createFoldersTree }); } else { inputFilesElement.current.click(); @@ -952,7 +952,7 @@ export default inject( const { frameConfig, isFrame } = settingsStore; - const { uploadEmptyFolders } = filesActionsStore; + const { createFoldersTree } = filesActionsStore; return { isGracePeriod, @@ -1006,7 +1006,7 @@ export default inject( isFolder, selectFileFormRoomDialogVisible, setSelectFileFormRoomDialogVisible, - uploadEmptyFolders, + createFoldersTree, }; }, )( diff --git a/packages/client/src/pages/Home/Hooks/useFiles.js b/packages/client/src/pages/Home/Hooks/useFiles.js index ab2a7560c7..f4e4a4baae 100644 --- a/packages/client/src/pages/Home/Hooks/useFiles.js +++ b/packages/client/src/pages/Home/Hooks/useFiles.js @@ -52,7 +52,7 @@ const useFiles = ({ dragging, setDragging, disableDrag, - uploadEmptyFolders, + createFoldersTree, startUpload, fetchFiles, @@ -118,7 +118,7 @@ const useFiles = ({ if (disableDrag) return; - uploadEmptyFolders(files, uploadToFolder).then((f) => { + createFoldersTree(files, uploadToFolder).then((f) => { if (f.length > 0) startUpload(f, null, t); }); }; diff --git a/packages/client/src/pages/Home/Section/Header/index.js b/packages/client/src/pages/Home/Section/Header/index.js index 82e596b32d..9dcf561add 100644 --- a/packages/client/src/pages/Home/Section/Header/index.js +++ b/packages/client/src/pages/Home/Section/Header/index.js @@ -226,7 +226,7 @@ const SectionHeaderContent = (props) => { getHeaderOptions, setBufferSelection, setGroupsBufferSelection, - uploadEmptyFolders, + createFoldersTree, } = props; const location = useLocation(); @@ -244,7 +244,7 @@ const SectionHeaderContent = (props) => { async (e) => { const files = await getFilesFromEvent(e); - uploadEmptyFolders(files).then((f) => { + createFoldersTree(files).then((f) => { if (f.length > 0) startUpload(f, null, t); }); }, @@ -645,7 +645,7 @@ export default inject( moveToRoomsPage, onClickBack, moveToPublicRoom, - uploadEmptyFolders, + createFoldersTree, } = filesActionsStore; const { setIsVisible, isVisible } = infoPanelStore; @@ -809,7 +809,7 @@ export default inject( getHeaderOptions, setBufferSelection, setGroupsBufferSelection, - uploadEmptyFolders, + createFoldersTree, }; }, )( diff --git a/packages/client/src/pages/Home/index.js b/packages/client/src/pages/Home/index.js index 197ad6b00a..d9015a5320 100644 --- a/packages/client/src/pages/Home/index.js +++ b/packages/client/src/pages/Home/index.js @@ -82,7 +82,7 @@ const PureHome = (props) => { startUpload, setDragging, dragging, - uploadEmptyFolders, + createFoldersTree, disableDrag, uploaded, converted, @@ -182,7 +182,7 @@ const PureHome = (props) => { dragging, setDragging, disableDrag, - uploadEmptyFolders, + createFoldersTree, startUpload, fetchFiles, fetchRooms, @@ -543,7 +543,7 @@ export default inject( const { setUploadPanelVisible, startUpload, uploaded, converted } = uploadDataStore; - const { uploadEmptyFolders, onClickBack } = filesActionsStore; + const { createFoldersTree, onClickBack } = filesActionsStore; const selectionLength = isProgressFinished ? selection.length : null; const selectionTitle = isProgressFinished @@ -635,7 +635,7 @@ export default inject( setUploadPanelVisible, startUpload, - uploadEmptyFolders, + createFoldersTree, setToPreviewFile, setIsPreview, diff --git a/packages/client/src/store/FilesActionsStore.js b/packages/client/src/store/FilesActionsStore.js index 9727fe35ae..2626d5a08b 100644 --- a/packages/client/src/store/FilesActionsStore.js +++ b/packages/client/src/store/FilesActionsStore.js @@ -280,8 +280,8 @@ class FilesActionStore { return treeList; }; - uploadEmptyFolders = async (files, folderId) => { - //console.log("uploadEmptyFolders", files, folderId); + createFoldersTree = async (files, folderId) => { + //console.log("createFoldersTree", files, folderId); const { secondaryProgressDataStore } = this.uploadDataStore; const { setSecondaryProgressBarData, clearSecondaryProgressData } = diff --git a/packages/client/src/store/HotkeyStore.js b/packages/client/src/store/HotkeyStore.js index 1d5dc2fc74..559ed6d98d 100644 --- a/packages/client/src/store/HotkeyStore.js +++ b/packages/client/src/store/HotkeyStore.js @@ -683,7 +683,7 @@ class HotkeyStore { }; uploadClipboardFiles = async (t, event) => { - const { uploadEmptyFolders } = this.filesActionsStore; + const { createFoldersTree } = this.filesActionsStore; const { startUpload } = this.uploadDataStore; if (this.filesStore.hotkeysClipboard.length) { @@ -692,7 +692,7 @@ class HotkeyStore { const files = await getFilesFromEvent(event); - uploadEmptyFolders(files, uploadToFolder).then((f) => { + createFoldersTree(files, uploadToFolder).then((f) => { if (f.length > 0) startUpload(f, null, t); }); }; From ec0dbf9518a68cfab1f0fe155e060161f55a7c05 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Thu, 15 Aug 2024 15:45:24 +0300 Subject: [PATCH 071/140] Client: Added dialogues if the limits for adding users and rooms have been reached. --- .../client/public/locales/en/Payments.json | 4 + packages/client/src/HOCs/withHotkeys.js | 11 +-- .../components/Article/MainButton/index.js | 10 +-- .../src/components/EmptyContainer/index.js | 6 +- .../dialogs/InviteUsersWarningDialog/index.js | 87 +++++++++++-------- .../sub-components/RoomsContent.tsx | 56 ++++++++++++ .../sub-components/UsersContent.tsx | 82 +++++++++++++++++ .../client/src/store/ContextOptionsStore.js | 8 +- .../client/src/store/FilesActionsStore.js | 5 +- packages/shared/store/CurrentQuotaStore.ts | 14 +++ 10 files changed, 231 insertions(+), 52 deletions(-) create mode 100644 packages/client/src/components/dialogs/InviteUsersWarningDialog/sub-components/RoomsContent.tsx create mode 100644 packages/client/src/components/dialogs/InviteUsersWarningDialog/sub-components/UsersContent.tsx diff --git a/packages/client/public/locales/en/Payments.json b/packages/client/public/locales/en/Payments.json index 1f32a18430..8fa37e00cf 100644 --- a/packages/client/public/locales/en/Payments.json +++ b/packages/client/public/locales/en/Payments.json @@ -9,6 +9,8 @@ "BusinessSuggestion": "Customize your {{planName}} plan", "BusinessTitle": "You are using {{planName}} plan", "BusinessUpdated": "{{planName}} plan updated", + "CannotCreateNewRoom": "Cannot create new room.", + "CannotCreatePaidUsers": "Cannot add new paid users. ", "ChooseNewPayer": "Choose a new Payer", "ChooseNewPlan": "Would you like to choose a new pricing plan?", "ContactUs": "For sales questions, contact us at", @@ -22,6 +24,8 @@ "InvalidEmailWithoutActiveSubscription": "We recommend choosing a new Payer who gets access to subscription settings in {{productName}}.", "InvalidEmailWithoutActiveSubscriptionByAdmin": "We recommend contacting the {{productName}} owner to choose a new Payer.", "ManagerTypesDescription": "Admin account types and their privileges", + "NewRoomWillExceedLimit": "Creating new room will exceed the maximum number of rooms allowed by your current pricing plan.", + "NewUsersWillExceedMembersLimit": "Adding new users will exceed the maximum number of portal paid members allowed by your current pricing plan.", "Pay": "Pay", "Payer": "Payer", "PayerDescription": "This user has access to payment details and is the only user who can adjust the quota and make payments. The {{productName}} owner, as well as the paying manager themselves, can reassign the paying manager role using the Stripe customer portal.", diff --git a/packages/client/src/HOCs/withHotkeys.js b/packages/client/src/HOCs/withHotkeys.js index 76c7b0c3aa..3a46ec1d5e 100644 --- a/packages/client/src/HOCs/withHotkeys.js +++ b/packages/client/src/HOCs/withHotkeys.js @@ -83,7 +83,7 @@ const withHotkeys = (Component) => { isVisitor, deleteRooms, archiveRooms, - isGracePeriod, + isWarningRoomsDialog, setInviteUsersWarningDialogVisible, security, @@ -158,7 +158,7 @@ const withHotkeys = (Component) => { const onCreateRoom = () => { if (!isVisitor && isRoomsFolder && security?.Create) { - if (isGracePeriod) { + if (isWarningRoomsDialog) { setInviteUsersWarningDialogVisible(true); return; } @@ -436,7 +436,7 @@ const withHotkeys = (Component) => { treeFoldersStore, selectedFolderStore, userStore, - currentTariffStatusStore, + currentQuotaStore, }) => { const { setSelected, @@ -487,7 +487,6 @@ const withHotkeys = (Component) => { const { visible: mediaViewerIsVisible } = mediaViewerDataStore; const { setHotkeyPanelVisible } = settingsStore; - const { isGracePeriod } = currentTariffStatusStore; const isVisitor = userStore.user?.isVisitor; @@ -499,6 +498,8 @@ const withHotkeys = (Component) => { isRoomsFolder, } = treeFoldersStore; + const { isWarningRoomsDialog } = currentQuotaStore; + const security = selectedFolderStore.security; const isFormRoom = selectedFolderStore.roomType === RoomsType.FormRoom; const isParentFolderFormRoom = @@ -553,7 +554,7 @@ const withHotkeys = (Component) => { deleteRooms, archiveRooms, - isGracePeriod, + isWarningRoomsDialog, setInviteUsersWarningDialogVisible, security, diff --git a/packages/client/src/components/Article/MainButton/index.js b/packages/client/src/components/Article/MainButton/index.js index a933c7f74a..bcff7fdadf 100644 --- a/packages/client/src/components/Article/MainButton/index.js +++ b/packages/client/src/components/Article/MainButton/index.js @@ -171,7 +171,6 @@ const ArticleMainButtonContent = (props) => { copyPanelVisible, security, - isGracePeriod, setInviteUsersWarningDialogVisible, currentDeviceType, @@ -181,6 +180,7 @@ const ArticleMainButtonContent = (props) => { parentRoomType, isFolder, showWarningDialog, + isWarningRoomsDialog, } = props; const navigate = useNavigate(); @@ -219,7 +219,7 @@ const ArticleMainButtonContent = (props) => { ); const onCreateRoom = React.useCallback(() => { - if (isGracePeriod) { + if (isWarningRoomsDialog) { setInviteUsersWarningDialogVisible(true); return; } @@ -940,8 +940,8 @@ export default inject( const isFolder = selectedFolderStore.isFolder; const { isAdmin, isOwner, isRoomAdmin } = userStore.user; - const { isGracePeriod } = currentTariffStatusStore; - const { showWarningDialog } = currentQuotaStore; + + const { showWarningDialog, isWarningRoomsDialog } = currentQuotaStore; const { setOformFromFolderId, oformsFilter } = oformsStore; const { mainButtonItemsList } = pluginStore; @@ -949,7 +949,6 @@ export default inject( const { frameConfig, isFrame } = settingsStore; return { - isGracePeriod, setInviteUsersWarningDialogVisible, showText: settingsStore.showText, isMobileArticle: settingsStore.isMobileArticle, @@ -1002,6 +1001,7 @@ export default inject( setSelectFileFormRoomDialogVisible, showWarningDialog, + isWarningRoomsDialog, }; }, )( diff --git a/packages/client/src/components/EmptyContainer/index.js b/packages/client/src/components/EmptyContainer/index.js index 956a768482..d914470c1d 100644 --- a/packages/client/src/components/EmptyContainer/index.js +++ b/packages/client/src/components/EmptyContainer/index.js @@ -79,7 +79,7 @@ const EmptyContainer = ({ }; const onCreateRoom = (e) => { - if (isGracePeriod) { + if (isWarningRoomsDialog) { setInviteUsersWarningDialogVisible(true); return; } @@ -126,7 +126,7 @@ export default inject( settingsStore, filesStore, dialogsStore, - + currentQuotaStore, selectedFolderStore, clientLoadingStore, currentTariffStatusStore, @@ -144,6 +144,7 @@ export default inject( isFiltered === null && isErrorRoomNotAvailable; const isRoot = selectedFolderStore.pathParts?.length === 1; + const { isWarningRoomsDialog } = currentQuotaStore; return { theme: settingsStore.theme, @@ -157,6 +158,7 @@ export default inject( type: selectedFolderStore.type, isRoot, isPublicRoom, + isWarningRoomsDialog, }; }, )(observer(EmptyContainer)); diff --git a/packages/client/src/components/dialogs/InviteUsersWarningDialog/index.js b/packages/client/src/components/dialogs/InviteUsersWarningDialog/index.js index 5cf13d0b72..a50dab386b 100644 --- a/packages/client/src/components/dialogs/InviteUsersWarningDialog/index.js +++ b/packages/client/src/components/dialogs/InviteUsersWarningDialog/index.js @@ -27,14 +27,16 @@ import React, { useState, useEffect } from "react"; import { inject, observer } from "mobx-react"; import { withTranslation, Trans } from "react-i18next"; -import { useNavigate } from "react-router-dom"; +import { useNavigate, useLocation } from "react-router-dom"; import moment from "moment-timezone"; import { ModalDialog } from "@docspace/shared/components/modal-dialog"; import { Button } from "@docspace/shared/components/button"; import { Text } from "@docspace/shared/components/text"; - import { getDaysRemaining } from "@docspace/shared/utils/common"; +import RoomsContent from "./sub-components/RoomsContent"; +import UsersContent from "./sub-components/UsersContent"; + const InviteUsersWarningDialog = (props) => { const { t, @@ -48,6 +50,8 @@ const InviteUsersWarningDialog = (props) => { isGracePeriod, currentTariffPlanTitle, isPaymentPageAvailable, + isRoomsTariffLimit, + isUserTariffLimit, } = props; const navigate = useNavigate(); @@ -84,6 +88,31 @@ const InviteUsersWarningDialog = (props) => { navigate(paymentPageUrl); }; + const location = useLocation(); + const isAccounts = location.pathname.includes("accounts/people"); + + const contentForGracePeriod = ( + <> + + {t("BusinessPlanPaymentOverdue", { + planName: currentTariffPlanTitle, + })} + +
+ + + Grace period activated + + from {{ fromDate }} to {{ byDate }} + + (days remaining: {{ delayDaysCount }}) + + +
+ {t("GracePeriodActivatedDescription")} + + ); + return ( { > {t("Common:Warning")} - {isGracePeriod ? ( - <> - - {t("BusinessPlanPaymentOverdue", { - planName: currentTariffPlanTitle, - })} - -
- - - Grace period activated - - from {{ fromDate }} to {{ byDate }} - - (days remaining: {{ delayDaysCount }}) - - -
- {t("GracePeriodActivatedDescription")} - - ) : ( - <> - - {t("PaymentOverdue")} - -
- {t("UpgradePlanInfo")} -
- {t("ChooseNewPlan")} - - )} + { + isGracePeriod ? ( + contentForGracePeriod + ) : isAccounts ? ( + + ) : ( + + ) + // <> + // + // {t("PaymentOverdue")} + // + //
+ // {t("UpgradePlanInfo")} + //
+ // {t("ChooseNewPlan")} + // + }
)} - {contextBlock} + ); }, diff --git a/packages/shared/components/section/sub-components/SectionContextMenu.tsx b/packages/shared/components/section/sub-components/SectionContextMenu.tsx new file mode 100644 index 0000000000..7dafb4b03a --- /dev/null +++ b/packages/shared/components/section/sub-components/SectionContextMenu.tsx @@ -0,0 +1,80 @@ +import React from "react"; +import { ContextMenu } from "@docspace/shared/components/context-menu"; +import isEqual from "lodash/isEqual"; +import { SectionContextMenuProps } from "../Section.types"; + +const areEqual = ( + prevProps: SectionContextMenuProps, + nextProps: SectionContextMenuProps, +) => { + if (!isEqual(prevProps, nextProps)) return true; + return false; +}; + +const SectionContextMenu = React.memo( + ({ getContextModel }: SectionContextMenuProps) => { + const [isOpen, setIsOpen] = React.useState(false); + + const cmRef = React.useRef void; + hide: (e: React.MouseEvent | MouseEvent) => void; + toggle: (e: React.MouseEvent | MouseEvent) => boolean; + getVisible: () => boolean; + }>(null); + + const onHide = () => { + setIsOpen(false); + }; + + const onContextMenu = React.useCallback( + (e: MouseEvent | React.MouseEvent) => { + const bodyElem = document.getElementsByClassName( + "section-body", + )[0] as HTMLDivElement; + + const target = e.target as Node; + + if ( + !getContextModel || + !getContextModel() || + !bodyElem || + !bodyElem.contains(target) + ) + return; + + e.stopPropagation(); + e.preventDefault(); + + // if (cmRef.current) cmRef.current.toggle(e); + if (cmRef.current) { + if (!isOpen) cmRef?.current?.show(e); + else cmRef?.current?.hide(e); + setIsOpen(!isOpen); + } + }, + [getContextModel, isOpen], + ); + + React.useEffect(() => { + document.addEventListener("contextmenu", onContextMenu); + + return () => { + document.removeEventListener("contextmenu", onContextMenu); + }; + }, [onContextMenu]); + + return ( + + ); + }, + areEqual, +); +SectionContextMenu.displayName = "SectionContextMenu"; + +export default SectionContextMenu; From 7df6e815ef81a79922a0cd51066e176f60abcf92 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Thu, 15 Aug 2024 18:23:03 +0300 Subject: [PATCH 083/140] Client: Added modal dialog after creating a room if the limit is almost exceeded. --- .../client/public/locales/en/Payments.json | 6 ++-- .../components/Article/MainButton/index.js | 2 +- .../src/components/FilesPanels/index.js | 32 +++++++++++++++++-- .../sub-components/RoomsContent.tsx | 28 ++++++++++++++-- .../client/src/store/CreateEditRoomStore.js | 6 ++-- packages/shared/store/CurrentQuotaStore.ts | 5 +++ 6 files changed, 70 insertions(+), 9 deletions(-) diff --git a/packages/client/public/locales/en/Payments.json b/packages/client/public/locales/en/Payments.json index bf3cd21452..fd3de455dd 100644 --- a/packages/client/public/locales/en/Payments.json +++ b/packages/client/public/locales/en/Payments.json @@ -9,7 +9,7 @@ "BusinessSuggestion": "Customize your {{planName}} plan", "BusinessTitle": "You are using {{planName}} plan", "BusinessUpdated": "{{planName}} plan updated", - "CannotCreateNewRoom": "Cannot create new room.", + "CannotCreateNewRoom": "Room cannot be created", "CannotCreatePaidUsers": "Cannot add new paid users. ", "ChooseNewPayer": "Choose a new Payer", "ChooseNewPlan": "Would you like to choose a new pricing plan?", @@ -24,14 +24,16 @@ "InvalidEmailWithoutActiveSubscription": "We recommend choosing a new Payer who gets access to subscription settings in {{productName}}.", "InvalidEmailWithoutActiveSubscriptionByAdmin": "We recommend contacting the {{productName}} owner to choose a new Payer.", "ManagerTypesDescription": "Admin account types and their privileges", - "NewRoomWillExceedLimit": "Creating new room will exceed the maximum number of rooms allowed by your current pricing plan.", + "NewRoomWillExceedLimit": "Creating this room is not possible since the limit is reached for the number of rooms included in your current plan.", "NewUsersWillExceedMembersLimit": "Adding new users will exceed the maximum number of portal paid members allowed by your current pricing plan.", + "NumberOfRoomsAccordingToTariff": "Number of rooms according to your tariff plan: {{currentValue}}/{{maxValue}}", "Pay": "Pay", "Payer": "Payer", "PayerDescription": "This user has access to payment details and is the only user who can adjust the quota and make payments. The {{productName}} owner, as well as the paying manager themselves, can reassign the paying manager role using the Stripe customer portal.", "PriceCalculation": "Calculate your price", "RenewSubscription": "Renew subscription to {{planName}} plan", "RoomManagerDescription": "Room administration and archiving, user invitation and management. Several admins can be assigned to the room.", + "RoomsQuotaAlmostExhausted": "The quota of rooms is almost exhausted.", "StartupSuggestion": "Do more with {{planName}} plan", "StartupTitle": "You are using free {{planName}} plan", "StripeCustomerPortal": "go to the Stripe customer portal", diff --git a/packages/client/src/components/Article/MainButton/index.js b/packages/client/src/components/Article/MainButton/index.js index bcff7fdadf..31eb7da164 100644 --- a/packages/client/src/components/Article/MainButton/index.js +++ b/packages/client/src/components/Article/MainButton/index.js @@ -226,7 +226,7 @@ const ArticleMainButtonContent = (props) => { const event = new Event(Events.ROOM_CREATE); window.dispatchEvent(event); - }, []); + }, [isWarningRoomsDialog]); const onShowSelectFileDialog = React.useCallback(() => { setSelectFileDialogVisible(true); diff --git a/packages/client/src/components/FilesPanels/index.js b/packages/client/src/components/FilesPanels/index.js index 776209ee9e..b488789bfb 100644 --- a/packages/client/src/components/FilesPanels/index.js +++ b/packages/client/src/components/FilesPanels/index.js @@ -81,6 +81,7 @@ import { PDFFormEditingDialog } from "../dialogs/PDFFormEditingDialog"; import { SharePDFFormDialog } from "../dialogs/SharePDFFormDialog"; import { FillPDFDialog } from "../dialogs/FillPDFDialog"; import { ShareCollectSelector } from "../ShareCollectSelector"; +import { currentQuotaStore } from "@docspace/shared/store"; const Panels = (props) => { const { @@ -137,6 +138,11 @@ const Panels = (props) => { selectFileFormRoomOpenRoot, fillPDFDialogData, shareCollectSelector, + + isRoomCreatedByCurrentUser, + setIsRoomCreatedByCurrentUser, + isRoomTariffAlmostLimit, + setInviteUsersWarningDialogVisible, } = props; const [sharePDFForm, setSharePDFForm] = useState({ @@ -192,6 +198,16 @@ const Panels = (props) => { }; }, [handleSharePDFForm]); + useEffect(() => { + if (isRoomCreatedByCurrentUser) { + isRoomTariffAlmostLimit && setInviteUsersWarningDialogVisible(true); + setIsRoomCreatedByCurrentUser(false); + } + return () => { + setIsRoomCreatedByCurrentUser(false); + }; + }, [isRoomTariffAlmostLimit, isRoomCreatedByCurrentUser]); + return [ settingsPluginDialogVisible && ( { const { @@ -380,6 +396,8 @@ export default inject( selectFileFormRoomOpenRoot, fillPDFDialogData, shareCollectSelector, + + setInviteUsersWarningDialogVisible, } = dialogsStore; const { preparationPortalDialogVisible } = backup; @@ -388,7 +406,12 @@ export default inject( const { uploadPanelVisible } = uploadDataStore; const { isVisible: versionHistoryPanelVisible } = versionHistoryStore; const { hotkeyPanelVisible } = settingsStore; - const { confirmDialogIsLoading } = createEditRoomStore; + const { + confirmDialogIsLoading, + isRoomCreatedByCurrentUser, + setIsRoomCreatedByCurrentUser, + } = createEditRoomStore; + const { isRoomTariffAlmostLimit } = currentQuotaStore; const { settingsPluginDialogVisible, @@ -450,6 +473,11 @@ export default inject( selectFileFormRoomOpenRoot, fillPDFDialogData, shareCollectSelector, + + isRoomCreatedByCurrentUser, + setIsRoomCreatedByCurrentUser, + isRoomTariffAlmostLimit, + setInviteUsersWarningDialogVisible, }; }, )(observer(Panels)); diff --git a/packages/client/src/components/dialogs/InviteUsersWarningDialog/sub-components/RoomsContent.tsx b/packages/client/src/components/dialogs/InviteUsersWarningDialog/sub-components/RoomsContent.tsx index 1c91cc570b..6a84f1198c 100644 --- a/packages/client/src/components/dialogs/InviteUsersWarningDialog/sub-components/RoomsContent.tsx +++ b/packages/client/src/components/dialogs/InviteUsersWarningDialog/sub-components/RoomsContent.tsx @@ -31,9 +31,15 @@ import { Text } from "@docspace/shared/components/text"; export interface RoomsContentProps { isRoomsTariffLimit: boolean; + maxCountRoomsByQuota: number; + usedRoomsCount: number; } -const RoomsContent = ({ isRoomsTariffLimit }: RoomsContentProps) => { +const RoomsContent = ({ + isRoomsTariffLimit, + maxCountRoomsByQuota, + usedRoomsCount, +}: RoomsContentProps) => { const { t } = useTranslation(["Payments", "Common"]); if (isRoomsTariffLimit) return ( @@ -45,12 +51,30 @@ const RoomsContent = ({ isRoomsTariffLimit }: RoomsContentProps) => { {t("ChooseNewPlan")} ); + + return ( + <> + {t("RoomsQuotaAlmostExhausted")} +
+ + {t("NumberOfRoomsAccordingToTariff", { + currentValue: usedRoomsCount, + maxValue: maxCountRoomsByQuota, + })} + +
+ {t("ChooseNewPlan")} + + ); }; export default inject(({ currentQuotaStore }) => { - const { isRoomsTariffLimit } = currentQuotaStore; + const { isRoomsTariffLimit, maxCountRoomsByQuota, usedRoomsCount } = + currentQuotaStore; return { isRoomsTariffLimit, + maxCountRoomsByQuota, + usedRoomsCount, }; })(observer(RoomsContent)); diff --git a/packages/client/src/store/CreateEditRoomStore.js b/packages/client/src/store/CreateEditRoomStore.js index 49b0bd9bb5..2b54c72298 100644 --- a/packages/client/src/store/CreateEditRoomStore.js +++ b/packages/client/src/store/CreateEditRoomStore.js @@ -87,8 +87,8 @@ class CreateEditRoomStore { this.onClose = onClose; }; - setRoomIsCreated = (onClose) => { - this.onClose = onClose; + setIsRoomCreatedByCurrentUser = (value) => { + this.isRoomCreatedByCurrentUser = value; }; onCreateRoom = async (withConfirm = false, t) => { @@ -152,6 +152,8 @@ class CreateEditRoomStore { ? await createRoomInThirdpary(storageFolderId, createRoomData) : await createRoom(createRoomData); + this.setIsRoomCreatedByCurrentUser(true); + room.isLogoLoading = true; const actions = []; diff --git a/packages/shared/store/CurrentQuotaStore.ts b/packages/shared/store/CurrentQuotaStore.ts index 4fe4b72895..02d84608d8 100644 --- a/packages/shared/store/CurrentQuotaStore.ts +++ b/packages/shared/store/CurrentQuotaStore.ts @@ -335,6 +335,11 @@ class CurrentQuotasStore { }; get isWarningRoomsDialog() { + console.log( + "isRoomsTariffLimit", + this.currentTariffStatusStore?.isGracePeriod, + this.isRoomsTariffLimit, + ); return ( this.currentTariffStatusStore?.isGracePeriod || this.isRoomsTariffLimit ); From 9886bda17a699c2a0fc2fc33df2119dbc2f466a1 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Thu, 15 Aug 2024 18:32:41 +0300 Subject: [PATCH 084/140] Web: Files: fixed loader for createFolderTree function --- .../client/src/store/FilesActionsStore.js | 45 ++++++++----------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/packages/client/src/store/FilesActionsStore.js b/packages/client/src/store/FilesActionsStore.js index 346cc3e20a..0cb008057d 100644 --- a/packages/client/src/store/FilesActionsStore.js +++ b/packages/client/src/store/FilesActionsStore.js @@ -251,12 +251,7 @@ class FilesActionStore { return result; }; - createFolderTree = async ( - treeList, - parentFolderId, - filesList, - operationId, - ) => { + createFolderTree = async (treeList, parentFolderId, filesList) => { if (!treeList || !treeList.length) return; for (let i = 0; i < treeList.length; i++) { @@ -274,28 +269,12 @@ class FilesActionStore { continue; } - this.uploadDataStore.secondaryProgressDataStore.setSecondaryProgressBarData( - { - icon: "file", - visible: true, - percent: 0, - label: "", - alert: false, - operationId, - }, - ); - const folder = await createFolder(parentFolderId, treeNode.name); const parentId = folder.id; if (treeNode.children.length == 0) continue; - await this.createFolderTree( - treeNode.children, - parentId, - filesList, - operationId, - ); + await this.createFolderTree(treeNode.children, parentId, filesList); } return treeList; @@ -304,21 +283,33 @@ class FilesActionStore { createFoldersTree = async (files, folderId) => { //console.log("createFoldersTree", files, folderId); - const { secondaryProgressDataStore } = this.uploadDataStore; - const { clearSecondaryProgressData } = secondaryProgressDataStore; + const { primaryProgressDataStore } = this.uploadDataStore; + + const { setPrimaryProgressBarData, clearPrimaryProgressData } = + primaryProgressDataStore; const operationId = uniqueid("operation_"); const toFolderId = folderId ? folderId : this.selectedFolderStore.id; + setPrimaryProgressBarData({ + icon: "upload", + visible: true, + percent: 0, + label: "", + alert: false, + }); + const tree = this.convertToTree(files); const filesList = []; - await this.createFolderTree(tree, toFolderId, filesList, operationId); + await this.createFolderTree(tree, toFolderId, filesList); this.updateCurrentFolder(null, [folderId], null, operationId); - setTimeout(() => clearSecondaryProgressData(operationId), TIMEOUT); + if (!filesList.length) { + setTimeout(() => clearPrimaryProgressData(), TIMEOUT); + } return filesList; }; From 04afef6a8a208fa1eecca22004ce2ba7c8be929d Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Thu, 15 Aug 2024 18:37:48 +0300 Subject: [PATCH 085/140] Client: Added division of logic according to user rights. --- .../dialogs/InviteUsersWarningDialog/index.js | 19 ++++++++------- .../sub-components/RoomsContent.tsx | 23 +++++++++++++++---- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/packages/client/src/components/dialogs/InviteUsersWarningDialog/index.js b/packages/client/src/components/dialogs/InviteUsersWarningDialog/index.js index afd03ceb41..0834493ddc 100644 --- a/packages/client/src/components/dialogs/InviteUsersWarningDialog/index.js +++ b/packages/client/src/components/dialogs/InviteUsersWarningDialog/index.js @@ -141,17 +141,16 @@ const InviteUsersWarningDialog = (props) => { size="normal" primary onClick={isPaymentPageAvailable ? onUpgradePlan : onClose} - scale={isPaymentPageAvailable} + scale + /> + +