Merge branch 'release/v2.6.0' into develop

# Conflicts:
#	packages/login/src/components/LoginForm/index.tsx
This commit is contained in:
Alexey Safronov 2024-07-12 11:11:05 +04:00
commit f1e6f79704
17 changed files with 230 additions and 82 deletions

View File

@ -51906,6 +51906,138 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>RoomsPinLimitMessage</name>
<description/>
<comment/>
<default_text/>
<translations>
<translation>
<language>ar-SA</language>
<approved>false</approved>
</translation>
<translation>
<language>az-Latn-AZ</language>
<approved>false</approved>
</translation>
<translation>
<language>bg-BG</language>
<approved>false</approved>
</translation>
<translation>
<language>cs-CZ</language>
<approved>false</approved>
</translation>
<translation>
<language>de-DE</language>
<approved>false</approved>
</translation>
<translation>
<language>el-GR</language>
<approved>false</approved>
</translation>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-ES</language>
<approved>false</approved>
</translation>
<translation>
<language>fi-FI</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-FR</language>
<approved>false</approved>
</translation>
<translation>
<language>hy-AM</language>
<approved>false</approved>
</translation>
<translation>
<language>it-IT</language>
<approved>false</approved>
</translation>
<translation>
<language>ja-JP</language>
<approved>false</approved>
</translation>
<translation>
<language>ko-KR</language>
<approved>false</approved>
</translation>
<translation>
<language>lo-LA</language>
<approved>false</approved>
</translation>
<translation>
<language>lv-LV</language>
<approved>false</approved>
</translation>
<translation>
<language>nl-NL</language>
<approved>false</approved>
</translation>
<translation>
<language>pl-PL</language>
<approved>false</approved>
</translation>
<translation>
<language>pt-BR</language>
<approved>false</approved>
</translation>
<translation>
<language>pt-PT</language>
<approved>false</approved>
</translation>
<translation>
<language>ro-RO</language>
<approved>false</approved>
</translation>
<translation>
<language>ru-RU</language>
<approved>false</approved>
</translation>
<translation>
<language>si-SI</language>
<approved>false</approved>
</translation>
<translation>
<language>sk-SK</language>
<approved>false</approved>
</translation>
<translation>
<language>sl-SI</language>
<approved>false</approved>
</translation>
<translation>
<language>sr-Cyrl-RS</language>
<approved>false</approved>
</translation>
<translation>
<language>sr-Latn-RS</language>
<approved>false</approved>
</translation>
<translation>
<language>tr-TR</language>
<approved>false</approved>
</translation>
<translation>
<language>uk-UA</language>
<approved>false</approved>
</translation>
<translation>
<language>vi-VN</language>
<approved>false</approved>
</translation>
<translation>
<language>zh-CN</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>RoomsPinned</name>
<description/>

View File

@ -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}}",

View File

@ -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);

View File

@ -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]);

View File

@ -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 = [

View File

@ -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) => {
</Section.SectionWarning>
)}
{(((!isEmptyPage || showFilterLoader) && !isErrorRoomNotAvailable) ||
isAccountsPage) &&
{(((!isEmptyPage || showFilterLoader) &&
!isAccountsEmptyFilter &&
!isErrorRoomNotAvailable) ||
(!isAccountsEmptyFilter && isAccountsPage)) &&
!isSettingsPage && (
<Section.SectionFilter>
{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));

View File

@ -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`),
},
];

View File

@ -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,
},
];

View File

@ -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}
/>
</StyledLabel>
<div className="language-combo-box-wrapper">
<div className="language-combo-box-wrapper" ref={comboBoxRef}>
<ComboBox
className="language-combo-box"
directionY={isMobileHorizontalOrientation ? "bottom" : "both"}
@ -368,7 +391,7 @@ const MainProfile = (props) => {
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

View File

@ -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", {

View File

@ -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);

View File

@ -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}`:

View File

@ -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)

View File

@ -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;

View File

@ -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 = () => {

View File

@ -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",
}

View File

@ -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;