diff --git a/i18next/client.babel b/i18next/client.babel index 6fdd8f172f..4e25d4bbad 100644 --- a/i18next/client.babel +++ b/i18next/client.babel @@ -51906,6 +51906,138 @@ + + RoomsPinLimitMessage + + + + + + ar-SA + false + + + az-Latn-AZ + false + + + bg-BG + false + + + cs-CZ + false + + + de-DE + false + + + el-GR + false + + + en-US + false + + + es-ES + false + + + fi-FI + false + + + fr-FR + false + + + hy-AM + false + + + it-IT + false + + + ja-JP + false + + + ko-KR + false + + + lo-LA + false + + + lv-LV + false + + + nl-NL + false + + + pl-PL + false + + + pt-BR + false + + + pt-PT + false + + + ro-RO + false + + + ru-RU + false + + + si-SI + false + + + sk-SK + false + + + sl-SI + false + + + sr-Cyrl-RS + false + + + sr-Latn-RS + false + + + tr-TR + false + + + uk-UA + false + + + vi-VN + false + + + zh-CN + false + + + RoomsPinned diff --git a/packages/client/public/locales/en/Files.json b/packages/client/public/locales/en/Files.json index 9a2b60c036..2c25e4ac85 100644 --- a/packages/client/public/locales/en/Files.json +++ b/packages/client/public/locales/en/Files.json @@ -149,6 +149,7 @@ "RoomOwner": "Room owner", "RoomPinned": "Room pinned", "RoomRemoved": "Room removed", + "RoomsPinLimitMessage": "You can't pin more than 10 rooms to the top. Unpin some that are currently pinned.", "RoomsPinned": "Rooms pinned: {{count}}", "RoomsRemoved": "Rooms removed", "RoomsUnpinned": "Rooms unpinned: {{count}}", diff --git a/packages/client/src/components/GlobalEvents/EditRoomEvent.js b/packages/client/src/components/GlobalEvents/EditRoomEvent.js index 5f2d82ec8c..d12b8a31e6 100644 --- a/packages/client/src/components/GlobalEvents/EditRoomEvent.js +++ b/packages/client/src/components/GlobalEvents/EditRoomEvent.js @@ -179,8 +179,11 @@ const EditRoomEvent = ({ actions.push(addTagsToRoom(room.id, newTags)); room.tags = tags; } - if (removedTags.length) + + if (removedTags.length) { actions.push(removeTagsFromRoom(room.id, removedTags)); + room.tags = tags; + } await Promise.all(actions); diff --git a/packages/client/src/components/Main/index.js b/packages/client/src/components/Main/index.js index 273f33a5af..6ecb6d3449 100644 --- a/packages/client/src/components/Main/index.js +++ b/packages/client/src/components/Main/index.js @@ -57,11 +57,10 @@ const Main = (props) => { React.useEffect(() => { window.addEventListener("resize", onResize); - window.visualViewport.addEventListener("resize", onResize); return () => { window.addEventListener("resize", onResize); - window.visualViewport.removeEventListener("resize", onResize); + clearTimeout(updateSizeRef.current); }; }, [onResize, isFrame]); diff --git a/packages/client/src/pages/Home/Section/Filter/index.js b/packages/client/src/pages/Home/Section/Filter/index.js index f4158fcebb..7ee26912fc 100644 --- a/packages/client/src/pages/Home/Section/Filter/index.js +++ b/packages/client/src/pages/Home/Section/Filter/index.js @@ -1112,12 +1112,9 @@ const SectionFilterContent = ({ label = t("Media"); break; case FilterType.FilesOnly.toString(): - label = t("AllFiles"); + label = t("Translations:Files"); break; - case FilterType.OFormTemplateOnly.toString(): - label = t("FormsTemplates"); - break; - case FilterType.OFormOnly.toString(): + case FilterType.Pdf.toString(): label = t("Forms"); break; } @@ -1640,18 +1637,18 @@ const SectionFilterContent = ({ isLast: !isTrash, }, ...folders, + { + id: "filter_type-all-files", + key: FilterType.FilesOnly.toString(), + group: FilterGroups.filterType, + label: t("Translations:Files").toLowerCase(), + }, { id: "filter_type-documents", key: FilterType.DocumentsOnly.toString(), group: FilterGroups.filterType, label: t("Common:Documents").toLowerCase(), }, - { - id: "filter_type-presentations", - key: FilterType.PresentationsOnly.toString(), - group: FilterGroups.filterType, - label: t("Translations:Presentations").toLowerCase(), - }, { id: "filter_type-spreadsheets", key: FilterType.SpreadsheetsOnly.toString(), @@ -1659,27 +1656,20 @@ const SectionFilterContent = ({ label: t("Translations:Spreadsheets").toLowerCase(), }, { - id: "filter_type-form-templates", - key: FilterType.OFormTemplateOnly.toString(), + id: "filter_type-presentations", + key: FilterType.PresentationsOnly.toString(), group: FilterGroups.filterType, - label: t("FormsTemplates").toLowerCase(), + label: t("Translations:Presentations").toLowerCase(), }, { id: "filter_type-forms", - key: FilterType.OFormOnly.toString(), + key: FilterType.Pdf.toString(), group: FilterGroups.filterType, label: t("Forms").toLowerCase(), }, ...archives, - ...images, ...media, - { - id: "filter_type-all-files", - key: FilterType.FilesOnly.toString(), - group: FilterGroups.filterType, - label: t("AllFiles").toLowerCase(), - }, ]; const subjectOptions = [ diff --git a/packages/client/src/pages/Home/index.js b/packages/client/src/pages/Home/index.js index c8c2a872bf..abdabbd238 100644 --- a/packages/client/src/pages/Home/index.js +++ b/packages/client/src/pages/Home/index.js @@ -159,6 +159,7 @@ const PureHome = (props) => { userId, getFolderModel, scrollToTop, + isEmptyGroups, } = props; //console.log(t("ComingSoon")) @@ -173,6 +174,7 @@ const PureHome = (props) => { const isPeopleAccounts = location.pathname.includes("accounts/people"); const isGroupsAccounts = location.pathname.includes("accounts/groups") && !groupId; + const isAccountsEmptyFilter = isGroupsAccounts && isEmptyGroups; const { onDrop } = useFiles({ t, @@ -387,8 +389,10 @@ const PureHome = (props) => { )} - {(((!isEmptyPage || showFilterLoader) && !isErrorRoomNotAvailable) || - isAccountsPage) && + {(((!isEmptyPage || showFilterLoader) && + !isAccountsEmptyFilter && + !isErrorRoomNotAvailable) || + (!isAccountsEmptyFilter && isAccountsPage)) && !isSettingsPage && ( {isFrame ? ( @@ -560,7 +564,8 @@ export default inject( const { usersStore, groupsStore, viewAs: accountsViewAs } = peopleStore; const { getUsersList: fetchPeople } = usersStore; - const { getGroups: fetchGroups, fetchGroup } = groupsStore; + const { getGroups: fetchGroups, fetchGroup, groups } = groupsStore; + const isEmptyGroups = (groups && groups.length === 0) || !Boolean(groups); if (!firstLoad) { if (isLoading) { @@ -673,6 +678,7 @@ export default inject( setSelectedFolder, getFolderModel, scrollToTop, + isEmptyGroups, }; }, )(observer(Home)); diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/presets/FileSelector.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/presets/FileSelector.js index 1642144533..0dd31e2aa5 100644 --- a/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/presets/FileSelector.js +++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/presets/FileSelector.js @@ -112,11 +112,7 @@ const FileSelector = (props) => { label: t(`Translations:Spreadsheets`), }, { - key: FilterType.OFormTemplateOnly, - label: t(`Files:FormsTemplates`), - }, - { - key: FilterType.OFormOnly, + key: FilterType.Pdf, label: t(`Files:Forms`), }, { @@ -133,7 +129,7 @@ const FileSelector = (props) => { }, { key: FilterType.FilesOnly, - label: t(`Files:AllFiles`), + label: t(`Translations:Files`), }, ]; diff --git a/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/sub-components/FilterBlock.js b/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/sub-components/FilterBlock.js index 7983089236..27b2f930e5 100644 --- a/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/sub-components/FilterBlock.js +++ b/packages/client/src/pages/PortalSettings/categories/developer-tools/JavascriptSDK/sub-components/FilterBlock.js @@ -138,7 +138,7 @@ export const FilterBlock = ({ t, config, setConfig }) => { const filterOptions = [ { key: "filter-type-all", - label: t("Files:AllFiles"), + label: t("Translations:Files"), typeKey: FilterType.FilesOnly, }, { @@ -176,15 +176,10 @@ export const FilterBlock = ({ t, config, setConfig }) => { label: t("Files:Media"), typeKey: FilterType.MediaOnly, }, - { - key: "filter-type-forms-templates", - label: t("Files:FormsTemplates"), - typeKey: FilterType.OFormTemplateOnly, - }, { key: "filter-type-forms", label: t("Files:Forms"), - typeKey: FilterType.OFormOnly, + typeKey: FilterType.Pdf, }, ]; diff --git a/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/index.js b/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/index.js index b2ba119fa1..37ad6f6cd9 100644 --- a/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/index.js +++ b/packages/client/src/pages/Profile/Section/Body/sub-components/main-profile/index.js @@ -27,7 +27,7 @@ import SendClockReactSvgUrl from "PUBLIC_DIR/images/send.clock.react.svg?url"; import PencilOutlineReactSvgUrl from "PUBLIC_DIR/images/pencil.outline.react.svg?url"; import DefaultUserAvatarMax from "PUBLIC_DIR/images/default_user_photo_size_200-200.png"; -import React, { useState, useEffect } from "react"; +import { useState, useEffect, useRef } from "react"; import { ReactSVG } from "react-svg"; import { useTranslation } from "react-i18next"; import { inject, observer } from "mobx-react"; @@ -92,20 +92,43 @@ const MainProfile = (props) => { } = props; const [horizontalOrientation, setHorizontalOrientation] = useState(false); - const [dimension, setDimension] = useState(window.innerHeight); + const [dropDownMaxHeight, setDropDownMaxHeight] = useState(352); const { interfaceDirection } = useTheme(); const dirTooltip = interfaceDirection === "rtl" ? "left" : "right"; const { isOwner, isAdmin, isRoomAdmin, isCollaborator } = profile; - useEffect(() => { - checkWidth(); - window.addEventListener("resize", checkWidth); - return () => window.removeEventListener("resize", checkWidth); - }, []); + const comboBoxRef = useRef(null); - const checkWidth = () => { - setDimension(innerHeight); + const updateDropDownMaxHeight = () => { + const newDimension = window.innerHeight; + + if (comboBoxRef.current) { + const comboBoxRect = comboBoxRef.current.getBoundingClientRect(); + let availableSpaceBottom = newDimension - comboBoxRect.bottom - 20; + + availableSpaceBottom = Math.max(availableSpaceBottom, 100); + + const newDropDownMaxHeight = Math.min(availableSpaceBottom, 352); + setDropDownMaxHeight(newDropDownMaxHeight); + } + }; + + const checkScroll = () => { + updateDropDownMaxHeight(); + }; + + useEffect(() => { + updateDropDownMaxHeight(); + window.addEventListener("resize", updateDropDownMaxHeight); + window.addEventListener("scroll", checkScroll); + return () => { + window.removeEventListener("resize", updateDropDownMaxHeight); + window.removeEventListener("scroll", checkScroll); + }; + }, [cultureNames]); + + useEffect(() => { if (!isMobileOnly) return; if (!isMobile()) { @@ -113,7 +136,7 @@ const MainProfile = (props) => { } else { setHorizontalOrientation(false); } - }; + }, []); const role = getUserRole(profile); @@ -356,7 +379,7 @@ const MainProfile = (props) => { tooltipContent={tooltipLanguage} /> -
+
{ scaledOptions={false} size="content" showDisabledItems={true} - dropDownMaxHeight={dimension < 620 ? 200 : 364} + dropDownMaxHeight={dropDownMaxHeight} manualWidth="280px" isDefaultMode={ isMobileHorizontalOrientation @@ -552,7 +575,7 @@ const MainProfile = (props) => { scaledOptions={false} size="content" showDisabledItems={true} - dropDownMaxHeight={dimension < 620 ? 200 : 364} + dropDownMaxHeight={dropDownMaxHeight} manualWidth="280px" isDefaultMode={ isMobileHorizontalOrientation diff --git a/packages/client/src/pages/Sdk/index.js b/packages/client/src/pages/Sdk/index.js index aace4bd817..438c0213be 100644 --- a/packages/client/src/pages/Sdk/index.js +++ b/packages/client/src/pages/Sdk/index.js @@ -82,10 +82,7 @@ const Sdk = ({ [FilterType.FoldersOnly]: t("Common:SelectTypeFiles", { type: t("Translations:Folders").toLowerCase(), }), - [FilterType.OFormTemplateOnly]: t("Common:SelectTypeFiles", { - type: t("Files:FormsTemplates").toLowerCase(), - }), - [FilterType.OFormOnly]: t("Common:SelectTypeFiles", { + [FilterType.Pdf]: t("Common:SelectTypeFiles", { type: t("Files:Forms").toLowerCase(), }), EditorSupportedTypes: t("Common:SelectTypeFiles", { diff --git a/packages/client/src/store/FilesActionsStore.js b/packages/client/src/store/FilesActionsStore.js index 2a0cef1eb7..22f6990ca4 100644 --- a/packages/client/src/store/FilesActionsStore.js +++ b/packages/client/src/store/FilesActionsStore.js @@ -1108,7 +1108,10 @@ class FilesActionStore { : t("RoomPinned"), ), ) - .catch((error) => console.log(error)); + .catch((error) => { + console.log(error); + toastr.error(t("RoomsPinLimitMessage")); + }); case "unpin": items.forEach((item) => { updateRoomPin(item); diff --git a/packages/client/src/store/FilesStore.js b/packages/client/src/store/FilesStore.js index e390b5ecdb..c8e6da28a2 100644 --- a/packages/client/src/store/FilesStore.js +++ b/packages/client/src/store/FilesStore.js @@ -2072,7 +2072,8 @@ class FilesStore { item.viewAccessibility.ImageView || item.viewAccessibility.MediaView; const canViewFile = item.viewAccessibility.WebView; - const isMasterForm = item.fileExst === ".docxf"; + const isOldForm = + item.fileExst === ".docxf" || item.fileExst === ".oform"; //TODO: Remove after change security options const isPdf = item.fileExst === ".pdf"; let fileOptions = [ @@ -2197,10 +2198,10 @@ class FilesStore { fileOptions = this.removeOptions(fileOptions, ["move"]); } - if (!(isMasterForm && canDuplicate)) + if (!(isOldForm && canDuplicate)) fileOptions = this.removeOptions(fileOptions, ["make-form"]); - if (!canSubmitToFormGallery || isMasterForm) { + if (!canSubmitToFormGallery || isOldForm) { fileOptions = this.removeOptions(fileOptions, [ "submit-to-gallery", "separator-SubmitToGallery", @@ -3541,7 +3542,7 @@ class FilesStore { case FilterType.ArchiveOnly: return t("Archives"); case FilterType.FilesOnly: - return t("AllFiles"); + return t("Translations:Files"); case `room-${RoomsType.FillingFormsRoom}`: return t("Common:FillingFormRooms"); case `room-${RoomsType.CustomRoom}`: diff --git a/packages/client/src/store/UploadDataStore.js b/packages/client/src/store/UploadDataStore.js index 4afea04396..a9330d3e41 100644 --- a/packages/client/src/store/UploadDataStore.js +++ b/packages/client/src/store/UploadDataStore.js @@ -1647,6 +1647,7 @@ class UploadDataStore { .then(() => this.moveToCopyTo(destFolderId, pbData, true, fileIds, folderIds), ) + .catch((error) => toastr.error(error)) .finally(async () => { //to update the status of trashIsEmpty filesStore if (this.treeFoldersStore.isRecycleBinFolder) diff --git a/packages/login/src/components/Login/Login.styled.ts b/packages/login/src/components/Login/Login.styled.ts index 45256b64ef..8675c2ea90 100644 --- a/packages/login/src/components/Login/Login.styled.ts +++ b/packages/login/src/components/Login/Login.styled.ts @@ -33,7 +33,7 @@ import { mobile, tablet } from "@docspace/shared/utils/device"; export const LoginFormWrapper = styled.div<{ bgPattern: string }>` width: 100%; - height: 100vh; + height: 100dvh; box-sizing: border-box; diff --git a/packages/login/src/components/LoginForm/index.tsx b/packages/login/src/components/LoginForm/index.tsx index d094913aeb..7a4578a463 100644 --- a/packages/login/src/components/LoginForm/index.tsx +++ b/packages/login/src/components/LoginForm/index.tsx @@ -306,8 +306,14 @@ const LoginForm = ({ return; } - checkConfirmLink(confirmData); - + try { + if (confirmData) await checkConfirmLink(confirmData); + } catch (e) { + console.error(e); + } + return res; + }) + .then((res: string | object) => { const isConfirm = typeof res === "string" && res.includes("confirm"); const redirectPath = referenceUrl || sessionStorage.getItem("referenceUrl"); @@ -364,6 +370,7 @@ const LoginForm = ({ router, clientId, referenceUrl, + loginData, ]); const onBlurEmail = () => { diff --git a/packages/shared/enums/index.ts b/packages/shared/enums/index.ts index 1b6d6cfb90..2090aaaceb 100644 --- a/packages/shared/enums/index.ts +++ b/packages/shared/enums/index.ts @@ -142,8 +142,14 @@ export const enum FilterType { ArchiveOnly = 10, ByExtension = 11, MediaOnly = 12, - OFormTemplateOnly = 18, - OFormOnly = 19, + FillingFormsRooms = 13, + EditingRooms = 14, + ReviewRooms = 15, + ReadOnlyRooms = 16, + CustomRooms = 17, + PublicRooms = 20, + FormRooms = 21, + Pdf = 22, } /** @@ -556,7 +562,6 @@ export const enum FilesSelectorExtendedFilterTypes { Media = "Media", Archives = "Archives", AllFiles = "AllFiles", - FormTemplates = "FormTemplates", Forms = "Forms", } diff --git a/packages/shared/selectors/Files/hooks/useFilesHelper.ts b/packages/shared/selectors/Files/hooks/useFilesHelper.ts index c0d9ca1a94..d11606db84 100644 --- a/packages/shared/selectors/Files/hooks/useFilesHelper.ts +++ b/packages/shared/selectors/Files/hooks/useFilesHelper.ts @@ -158,16 +158,12 @@ const useFilesHelper = ({ filter.extension = "gz,tar"; break; - case FilesSelectorFilterTypes.DOCXF: - filter.filterType = FilterType.OFormTemplateOnly; - break; - case FilesSelectorFilterTypes.XLSX: filter.filterType = FilterType.SpreadsheetsOnly; break; case FilesSelectorFilterTypes.PDF: - filter.extension = FilesSelectorFilterTypes.PDF; + filter.filterType = FilterType.Pdf; break; case FilterType.DocumentsOnly: @@ -198,19 +194,12 @@ const useFilesHelper = ({ filter.filterType = FilterType.FoldersOnly; break; - case FilterType.OFormTemplateOnly: - filter.filterType = FilterType.OFormTemplateOnly; - break; - - case FilterType.OFormOnly: - filter.filterType = FilterType.OFormOnly; - break; - case FilterType.FilesOnly: filter.filterType = FilterType.FilesOnly; break; case FilesSelectorFilterTypes.ALL: + filter.applyFilterOption = ApplyFilterOption.All; filter.filterType = FilterType.None; break;