Merge branch 'hotfix/v2.6.1' into bugfix/save-table-sorting
This commit is contained in:
commit
ab2f184dad
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docspace",
|
||||
"version": "2.6.0",
|
||||
"version": "2.6.1",
|
||||
"private": true,
|
||||
"workspaces": {
|
||||
"packages": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@docspace/client",
|
||||
"version": "2.6.0",
|
||||
"version": "2.6.1",
|
||||
"private": true,
|
||||
"homepage": "",
|
||||
"scripts": {
|
||||
|
@ -34,7 +34,7 @@ import React, {
|
||||
import { observer, inject } from "mobx-react";
|
||||
import { withTranslation } from "react-i18next";
|
||||
|
||||
import { DeviceType } from "@docspace/shared/enums";
|
||||
import { DeviceType, EmployeeType } from "@docspace/shared/enums";
|
||||
import { LOADER_TIMEOUT } from "@docspace/shared/constants";
|
||||
|
||||
import { Backdrop } from "@docspace/shared/components/backdrop";
|
||||
@ -72,11 +72,6 @@ const InvitePanel = ({
|
||||
visible,
|
||||
setRoomSecurity,
|
||||
getRoomSecurityInfo,
|
||||
getPortalInviteLinks,
|
||||
userLink,
|
||||
guestLink,
|
||||
adminLink,
|
||||
collaboratorLink,
|
||||
defaultAccess,
|
||||
inviteUsers,
|
||||
setInfoPanelIsMobileHidden,
|
||||
@ -88,9 +83,7 @@ const InvitePanel = ({
|
||||
currentDeviceType,
|
||||
}) => {
|
||||
const [invitePanelIsLoding, setInvitePanelIsLoading] = useState(
|
||||
() =>
|
||||
((!userLink || !guestLink || !collaboratorLink) && !adminLink) ||
|
||||
roomId !== -1,
|
||||
roomId !== -1,
|
||||
);
|
||||
const [selectedRoom, setSelectedRoom] = useState(null);
|
||||
const [hasErrors, setHasErrors] = useState(false);
|
||||
@ -117,6 +110,33 @@ const InvitePanel = ({
|
||||
setExternalLinksVisible(visible);
|
||||
};
|
||||
|
||||
const accessModel = [
|
||||
{
|
||||
id: "user",
|
||||
title: "User",
|
||||
shareLink: "",
|
||||
access: EmployeeType.User,
|
||||
},
|
||||
{
|
||||
id: "guest",
|
||||
title: "Guest",
|
||||
shareLink: "",
|
||||
access: EmployeeType.Guest,
|
||||
},
|
||||
{
|
||||
id: "admin",
|
||||
title: "Admin",
|
||||
shareLink: "",
|
||||
access: EmployeeType.Admin,
|
||||
},
|
||||
{
|
||||
id: "collaborator",
|
||||
title: "Collaborator",
|
||||
shareLink: "",
|
||||
access: EmployeeType.Collaborator,
|
||||
},
|
||||
];
|
||||
|
||||
const selectRoom = () => {
|
||||
const room = folders.find((folder) => folder.id === roomId);
|
||||
|
||||
@ -167,40 +187,7 @@ const InvitePanel = ({
|
||||
|
||||
useEffect(() => {
|
||||
if (roomId === -1) {
|
||||
if ((!userLink || !guestLink || !collaboratorLink) && !adminLink) {
|
||||
setInvitePanelIsLoading(true);
|
||||
getPortalInviteLinks().finally(() => {
|
||||
disableInvitePanelLoader();
|
||||
});
|
||||
}
|
||||
|
||||
setShareLinks([
|
||||
{
|
||||
id: "user",
|
||||
title: "User",
|
||||
shareLink: userLink,
|
||||
access: 1,
|
||||
},
|
||||
{
|
||||
id: "guest",
|
||||
title: "Guest",
|
||||
shareLink: guestLink,
|
||||
access: 2,
|
||||
},
|
||||
{
|
||||
id: "admin",
|
||||
title: "Admin",
|
||||
shareLink: adminLink,
|
||||
access: 3,
|
||||
},
|
||||
{
|
||||
id: "collaborator",
|
||||
title: "Collaborator",
|
||||
shareLink: collaboratorLink,
|
||||
access: 4,
|
||||
},
|
||||
]);
|
||||
|
||||
setShareLinks(accessModel);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -208,7 +195,7 @@ const InvitePanel = ({
|
||||
Promise.all([selectRoom(), getInfo()]).finally(() => {
|
||||
disableInvitePanelLoader(false);
|
||||
});
|
||||
}, [roomId, userLink, guestLink, adminLink, collaboratorLink]);
|
||||
}, [roomId]);
|
||||
|
||||
useEffect(() => {
|
||||
const hasErrors = inviteItems.some((item) => !!item.errors?.length);
|
||||
@ -487,14 +474,6 @@ export default inject(
|
||||
isRoomMembersPanelOpen,
|
||||
} = infoPanelStore;
|
||||
|
||||
const {
|
||||
getPortalInviteLinks,
|
||||
userLink,
|
||||
guestLink,
|
||||
adminLink,
|
||||
collaboratorLink,
|
||||
} = peopleStore.inviteLinksStore;
|
||||
|
||||
const {
|
||||
inviteItems,
|
||||
invitePanelOptions,
|
||||
@ -520,11 +499,6 @@ export default inject(
|
||||
visible: invitePanelOptions.visible,
|
||||
defaultAccess: invitePanelOptions.defaultAccess,
|
||||
getFolderInfo,
|
||||
getPortalInviteLinks,
|
||||
userLink,
|
||||
guestLink,
|
||||
adminLink,
|
||||
collaboratorLink,
|
||||
inviteUsers,
|
||||
setInfoPanelIsMobileHidden,
|
||||
updateInfoPanelMembers,
|
||||
|
@ -64,20 +64,26 @@ const ExternalLinks = ({
|
||||
setActiveLink,
|
||||
activeLink,
|
||||
isMobileView,
|
||||
getPortalInviteLink,
|
||||
}) => {
|
||||
const [actionLinksVisible, setActionLinksVisible] = useState(false);
|
||||
|
||||
const inputsRef = useRef();
|
||||
|
||||
const toggleLinks = () => {
|
||||
const toggleLinks = async (e) => {
|
||||
if (roomId === -1) {
|
||||
const link = shareLinks.find((l) => l.access === +defaultAccess);
|
||||
if (e?.target?.checked) {
|
||||
const link = shareLinks.find((l) => l.access === defaultAccess);
|
||||
|
||||
setActiveLink(link);
|
||||
copyLink(link.shareLink);
|
||||
link.shareLink = await getPortalInviteLink(defaultAccess);
|
||||
|
||||
setActiveLink(link);
|
||||
copyLink(link.shareLink);
|
||||
}
|
||||
} else {
|
||||
!externalLinksVisible ? editLink() : disableLink();
|
||||
}
|
||||
|
||||
onChangeExternalLinksVisible(!externalLinksVisible);
|
||||
};
|
||||
|
||||
@ -106,11 +112,13 @@ const ExternalLinks = ({
|
||||
setActiveLink(activeLink);
|
||||
};
|
||||
|
||||
const onSelectAccess = (access) => {
|
||||
const onSelectAccess = async (access) => {
|
||||
let link = null;
|
||||
if (roomId === -1) {
|
||||
link = shareLinks.find((l) => l.access === access.access);
|
||||
|
||||
link.shareLink = await getPortalInviteLink(access.access);
|
||||
|
||||
setActiveLink(link);
|
||||
} else {
|
||||
setInvitationLinks(roomId, "Invite", +access.access, shareLinks[0].id);
|
||||
@ -254,17 +262,21 @@ const ExternalLinks = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default inject(({ userStore, dialogsStore, filesStore }) => {
|
||||
const { isOwner } = userStore.user;
|
||||
const { invitePanelOptions } = dialogsStore;
|
||||
const { setInvitationLinks } = filesStore;
|
||||
const { roomId, hideSelector, defaultAccess } = invitePanelOptions;
|
||||
export default inject(
|
||||
({ userStore, dialogsStore, filesStore, peopleStore }) => {
|
||||
const { isOwner } = userStore.user;
|
||||
const { invitePanelOptions } = dialogsStore;
|
||||
const { setInvitationLinks } = filesStore;
|
||||
const { roomId, hideSelector, defaultAccess } = invitePanelOptions;
|
||||
const { getPortalInviteLink } = peopleStore.inviteLinksStore;
|
||||
|
||||
return {
|
||||
setInvitationLinks,
|
||||
roomId,
|
||||
hideSelector,
|
||||
defaultAccess,
|
||||
isOwner,
|
||||
};
|
||||
})(observer(ExternalLinks));
|
||||
return {
|
||||
setInvitationLinks,
|
||||
roomId,
|
||||
hideSelector,
|
||||
defaultAccess,
|
||||
isOwner,
|
||||
getPortalInviteLink,
|
||||
};
|
||||
},
|
||||
)(observer(ExternalLinks));
|
||||
|
@ -24,7 +24,7 @@
|
||||
// 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 ClearActiveReactSvgUrl from "PUBLIC_DIR/images/clear.active.react.svg?url";
|
||||
import ClearReactSvgUrl from "PUBLIC_DIR/images/clear.react.svg?url";
|
||||
import ButtonCancelReactSvgUrl from "PUBLIC_DIR/images/button.cancel.react.svg?url";
|
||||
|
||||
import React from "react";
|
||||
@ -136,8 +136,8 @@ class UploadPanelComponent extends React.Component {
|
||||
<div>
|
||||
{uploaded && converted ? (
|
||||
<IconButton
|
||||
size="20"
|
||||
iconName={ClearActiveReactSvgUrl}
|
||||
size={17}
|
||||
iconName={ClearReactSvgUrl}
|
||||
isClickable
|
||||
onClick={this.clearUploadPanel}
|
||||
/>
|
||||
|
@ -54,6 +54,8 @@ class FilesTableHeader extends React.Component {
|
||||
showStorageInfo,
|
||||
isArchiveFolder,
|
||||
tableStorageName,
|
||||
roomsFilter,
|
||||
filter,
|
||||
} = this.props;
|
||||
|
||||
const defaultColumns = [];
|
||||
@ -365,6 +367,9 @@ class FilesTableHeader extends React.Component {
|
||||
|
||||
const tableColumns = columns.map((c) => c.enable && c.key);
|
||||
|
||||
const sortBy = isRooms ? roomsFilter.sortBy : filter.sortBy;
|
||||
const sortOrder = isRooms ? roomsFilter.sortOrder : filter.sortOrder;
|
||||
|
||||
this.setTableColumns(tableColumns);
|
||||
if (fromUpdate) {
|
||||
this.setState({
|
||||
@ -372,6 +377,8 @@ class FilesTableHeader extends React.Component {
|
||||
resetColumnsSize,
|
||||
columnStorageName,
|
||||
columnInfoPanelStorageName,
|
||||
sortBy,
|
||||
sortOrder,
|
||||
});
|
||||
} else {
|
||||
this.state = {
|
||||
@ -379,6 +386,8 @@ class FilesTableHeader extends React.Component {
|
||||
resetColumnsSize,
|
||||
columnStorageName,
|
||||
columnInfoPanelStorageName,
|
||||
sortBy,
|
||||
sortOrder,
|
||||
};
|
||||
}
|
||||
};
|
||||
@ -425,8 +434,13 @@ class FilesTableHeader extends React.Component {
|
||||
isRecentTab,
|
||||
isArchiveFolder,
|
||||
showStorageInfo,
|
||||
roomsFilter,
|
||||
filter,
|
||||
} = this.props;
|
||||
|
||||
const sortBy = isRooms ? roomsFilter.sortBy : filter.sortBy;
|
||||
const sortOrder = isRooms ? roomsFilter.sortOrder : filter.sortOrder;
|
||||
|
||||
if (
|
||||
isArchiveFolder !== prevProps.isArchiveFolder ||
|
||||
isRooms !== prevProps.isRooms ||
|
||||
@ -434,12 +448,15 @@ class FilesTableHeader extends React.Component {
|
||||
columnStorageName !== prevProps.columnStorageName ||
|
||||
columnInfoPanelStorageName !== prevProps.columnInfoPanelStorageName ||
|
||||
isRecentTab !== prevProps.isRecentTab ||
|
||||
showStorageInfo !== prevProps.showStorageInfo
|
||||
showStorageInfo !== prevProps.showStorageInfo ||
|
||||
sortBy !== this.state.sortBy ||
|
||||
sortOrder !== this.state.sortOrder
|
||||
) {
|
||||
return this.getTableColumns(true);
|
||||
}
|
||||
|
||||
const { columns } = this.state;
|
||||
|
||||
if (this.props.withContent !== prevProps.withContent) {
|
||||
const columnIndex = columns.findIndex((c) => c.key === "Share");
|
||||
if (columnIndex === -1) return;
|
||||
@ -528,9 +545,6 @@ class FilesTableHeader extends React.Component {
|
||||
t,
|
||||
containerRef,
|
||||
isHeaderChecked,
|
||||
filter,
|
||||
roomsFilter,
|
||||
isRooms,
|
||||
firstElemChecked,
|
||||
sortingVisible,
|
||||
infoPanelVisible,
|
||||
@ -547,11 +561,10 @@ class FilesTableHeader extends React.Component {
|
||||
resetColumnsSize,
|
||||
columnStorageName,
|
||||
columnInfoPanelStorageName,
|
||||
sortBy,
|
||||
sortOrder,
|
||||
} = this.state;
|
||||
|
||||
const sortBy = isRooms ? roomsFilter.sortBy : filter.sortBy;
|
||||
const sortOrder = isRooms ? roomsFilter.sortOrder : filter.sortOrder;
|
||||
|
||||
return (
|
||||
<TableHeader
|
||||
isLengthenHeader={firstElemChecked || isHeaderChecked}
|
||||
|
@ -2012,42 +2012,8 @@ const SectionFilterContent = ({
|
||||
hideableColumns.Storage = storage;
|
||||
}
|
||||
|
||||
options.push(firstName, lastName);
|
||||
|
||||
if (accountsViewAs === "table") {
|
||||
const tableColumns = isInsideGroup
|
||||
? TABLE_INSIDE_GROUP_COLUMNS
|
||||
: TABLE_PEOPLE_COLUMNS;
|
||||
|
||||
const columnsSizeInfoPanel = isInsideGroup
|
||||
? COLUMNS_INSIDE_GROUP_SIZE_INFO_PANEL
|
||||
: COLUMNS_PEOPLE_SIZE_INFO_PANEL;
|
||||
|
||||
const availableSort = localStorage
|
||||
?.getItem(`${tableColumns}=${userId}`)
|
||||
?.split(",");
|
||||
|
||||
const infoPanelColumnsSize = localStorage
|
||||
?.getItem(`${columnsSizeInfoPanel}=${userId}`)
|
||||
?.split(" ");
|
||||
|
||||
availableSort?.forEach((columnTitle) => {
|
||||
if (!hideableColumns[columnTitle]) return;
|
||||
|
||||
if (availableSort?.includes(columnTitle)) {
|
||||
const idx = availableSort.findIndex((x) => x === columnTitle);
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
!hide && options.push(hideableColumns[columnTitle]);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
options.push(type, department, email);
|
||||
if (showStorageInfo) options.push(storage);
|
||||
}
|
||||
options.push(firstName, lastName, type, department, email);
|
||||
if (showStorageInfo) options.push(storage);
|
||||
|
||||
return options;
|
||||
}
|
||||
@ -2069,29 +2035,7 @@ const SectionFilterContent = ({
|
||||
default: true,
|
||||
};
|
||||
|
||||
groupsOptions.push(title);
|
||||
|
||||
if (accountsViewAs === "table") {
|
||||
const availableSort = localStorage
|
||||
?.getItem(`${TABLE_GROUPS_COLUMNS}=${userId}`)
|
||||
?.split(",");
|
||||
|
||||
const infoPanelColumnsSize = localStorage
|
||||
?.getItem(`${COLUMNS_GROUPS_SIZE_INFO_PANEL}=${userId}`)
|
||||
?.split(" ");
|
||||
|
||||
if (availableSort?.includes("Head of Group")) {
|
||||
const idx = availableSort.findIndex((x) => x === "Head of Group");
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
!hide && groupsOptions.push(manager);
|
||||
}
|
||||
} else {
|
||||
groupsOptions.push(manager);
|
||||
}
|
||||
groupsOptions.push(title, manager);
|
||||
|
||||
return groupsOptions;
|
||||
}
|
||||
@ -2181,220 +2125,25 @@ const SectionFilterContent = ({
|
||||
|
||||
commonOptions.push(name);
|
||||
|
||||
if (viewAs === "table") {
|
||||
if (isRooms) {
|
||||
const availableSort = localStorage
|
||||
?.getItem(`${TABLE_ROOMS_COLUMNS}=${userId}`)
|
||||
?.split(",");
|
||||
|
||||
const infoPanelColumnsSize = localStorage
|
||||
?.getItem(`${COLUMNS_ROOMS_SIZE_INFO_PANEL}=${userId}`)
|
||||
?.split(" ");
|
||||
|
||||
const hideOption = infoPanelVisible && infoPanelColumnsSize;
|
||||
|
||||
if (availableSort?.includes("Type")) {
|
||||
const idx = availableSort.findIndex((x) => x === "Type");
|
||||
const hide = hideOption && infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
!hide && commonOptions.push(roomType);
|
||||
}
|
||||
|
||||
if (availableSort?.includes("Tags")) {
|
||||
const idx = availableSort.findIndex((x) => x === "Tags");
|
||||
const hide = hideOption && infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
!hide && commonOptions.push(tags);
|
||||
}
|
||||
|
||||
if (availableSort?.includes("Owner")) {
|
||||
const idx = availableSort.findIndex((x) => x === "Owner");
|
||||
const hide = hideOption && infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
!hide && commonOptions.push(owner);
|
||||
}
|
||||
|
||||
if (availableSort?.includes("Activity")) {
|
||||
const idx = availableSort.findIndex((x) => x === "Activity");
|
||||
const hide = hideOption && infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
!hide && commonOptions.push(modifiedDate);
|
||||
}
|
||||
|
||||
if (showStorageInfo && availableSort?.includes("Storage")) {
|
||||
const idx = availableSort.findIndex(
|
||||
(x) => x === SortByFieldName.UsedSpace,
|
||||
);
|
||||
const hide = hideOption && infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
!hide && commonOptions.push(sortByStorage);
|
||||
}
|
||||
} else if (isTrash) {
|
||||
const availableSort = localStorage
|
||||
?.getItem(`${TABLE_TRASH_COLUMNS}=${userId}`)
|
||||
?.split(",");
|
||||
|
||||
const infoPanelColumnsSize = localStorage
|
||||
?.getItem(`${COLUMNS_TRASH_SIZE_INFO_PANEL}=${userId}`)
|
||||
?.split(" ");
|
||||
|
||||
if (availableSort?.includes("Room")) {
|
||||
const idx = availableSort.findIndex((x) => x === "Room");
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
// !hide && commonOptions.push(room);
|
||||
}
|
||||
if (availableSort?.includes("AuthorTrash")) {
|
||||
const idx = availableSort.findIndex((x) => x === "AuthorTrash");
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
// !hide && commonOptions.push(authorOption);
|
||||
}
|
||||
if (availableSort?.includes("CreatedTrash")) {
|
||||
const idx = availableSort.findIndex((x) => x === "CreatedTrash");
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
// !hide && commonOptions.push(creationDate);
|
||||
}
|
||||
if (availableSort?.includes("Erasure")) {
|
||||
const idx = availableSort.findIndex((x) => x === "Erasure");
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
!hide && commonOptions.push(erasure);
|
||||
}
|
||||
if (availableSort?.includes("SizeTrash")) {
|
||||
const idx = availableSort.findIndex((x) => x === "SizeTrash");
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
!hide && commonOptions.push(size);
|
||||
}
|
||||
if (availableSort?.includes("TypeTrash")) {
|
||||
const idx = availableSort.findIndex((x) => x === "TypeTrash");
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
// !hide && commonOptions.push(type);
|
||||
}
|
||||
} else if (isRecentTab) {
|
||||
const availableSort = localStorage
|
||||
?.getItem(`${TABLE_RECENT_COLUMNS}=${userId}`)
|
||||
?.split(",");
|
||||
|
||||
const infoPanelColumnsSize = localStorage
|
||||
?.getItem(`${COLUMNS_RECENT_SIZE_INFO_PANEL}=${userId}`)
|
||||
?.split(" ");
|
||||
|
||||
if (availableSort?.includes("LastOpened")) {
|
||||
const idx = availableSort.findIndex((x) => x === "LastOpened");
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
!hide && commonOptions.push(lastOpenedDate);
|
||||
}
|
||||
|
||||
if (availableSort?.includes("Size")) {
|
||||
const idx = availableSort.findIndex((x) => x === "Size");
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
!hide && commonOptions.push(size);
|
||||
}
|
||||
} else {
|
||||
const availableSort = localStorage
|
||||
?.getItem(`${TABLE_COLUMNS}=${userId}`)
|
||||
?.split(",");
|
||||
|
||||
const infoPanelColumnsSize = localStorage
|
||||
?.getItem(`${COLUMNS_SIZE_INFO_PANEL}=${userId}`)
|
||||
?.split(" ");
|
||||
|
||||
if (availableSort?.includes("Author")) {
|
||||
const idx = availableSort.findIndex((x) => x === "Author");
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
// !hide && commonOptions.push(authorOption);
|
||||
}
|
||||
if (availableSort?.includes("Created")) {
|
||||
const idx = availableSort.findIndex((x) => x === "Created");
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
// !hide && commonOptions.push(creationDate);
|
||||
}
|
||||
if (availableSort?.includes("Modified")) {
|
||||
const idx = availableSort.findIndex((x) => x === "Modified");
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
!hide && commonOptions.push(modifiedDate);
|
||||
}
|
||||
if (availableSort?.includes("Size")) {
|
||||
const idx = availableSort.findIndex((x) => x === "Size");
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
!hide && commonOptions.push(size);
|
||||
}
|
||||
if (availableSort?.includes("Type")) {
|
||||
const idx = availableSort.findIndex((x) => x === "Type");
|
||||
const hide =
|
||||
infoPanelVisible &&
|
||||
infoPanelColumnsSize &&
|
||||
infoPanelColumnsSize[idx] === "0px";
|
||||
|
||||
// !hide && commonOptions.push(type);
|
||||
}
|
||||
}
|
||||
if (isRooms) {
|
||||
commonOptions.push(roomType);
|
||||
commonOptions.push(tags);
|
||||
commonOptions.push(owner);
|
||||
commonOptions.push(modifiedDate);
|
||||
showStorageInfo && commonOptions.push(sortByStorage);
|
||||
} else if (isTrash) {
|
||||
// commonOptions.push(authorOption);
|
||||
// commonOptions.push(creationDate);
|
||||
commonOptions.push(erasure);
|
||||
commonOptions.push(size);
|
||||
// commonOptions.push(type);
|
||||
} else {
|
||||
if (isRooms) {
|
||||
commonOptions.push(roomType);
|
||||
commonOptions.push(tags);
|
||||
commonOptions.push(owner);
|
||||
commonOptions.push(modifiedDate);
|
||||
showStorageInfo && commonOptions.push(sortByStorage);
|
||||
} else if (isTrash) {
|
||||
// commonOptions.push(authorOption);
|
||||
// commonOptions.push(creationDate);
|
||||
commonOptions.push(erasure);
|
||||
commonOptions.push(size);
|
||||
// commonOptions.push(type);
|
||||
} else {
|
||||
// commonOptions.push(authorOption);
|
||||
// commonOptions.push(creationDate);
|
||||
commonOptions.push(modifiedDate);
|
||||
commonOptions.push(size);
|
||||
// commonOptions.push(type);
|
||||
}
|
||||
// commonOptions.push(authorOption);
|
||||
// commonOptions.push(creationDate);
|
||||
commonOptions.push(modifiedDate);
|
||||
commonOptions.push(size);
|
||||
// commonOptions.push(type);
|
||||
isRecentTab && commonOptions.push(lastOpenedDate);
|
||||
}
|
||||
|
||||
return commonOptions;
|
||||
|
@ -259,6 +259,8 @@ const SectionHeaderContent = (props) => {
|
||||
};
|
||||
|
||||
const onContextOptionsClick = () => {
|
||||
if (isInsideGroup) return;
|
||||
|
||||
setBufferSelection(selectedFolder);
|
||||
};
|
||||
|
||||
|
@ -27,9 +27,12 @@
|
||||
import { makeAutoObservable, runInAction } from "mobx";
|
||||
import {
|
||||
getInvitationLinks,
|
||||
getInvitationLink,
|
||||
getShortenedLink,
|
||||
} from "@docspace/shared/api/portal";
|
||||
|
||||
import { EmployeeType } from "@docspace/shared/enums";
|
||||
|
||||
class InviteLinksStore {
|
||||
peopleStore = null;
|
||||
userLink = null;
|
||||
@ -59,9 +62,7 @@ class InviteLinksStore {
|
||||
};
|
||||
|
||||
getPortalInviteLinks = async () => {
|
||||
const isViewerAdmin = !this.peopleStore.authStore.isVisitor;
|
||||
|
||||
if (!isViewerAdmin) return Promise.resolve();
|
||||
if (this.peopleStore.authStore.isVisitor) return Promise.resolve();
|
||||
|
||||
const links = await getInvitationLinks();
|
||||
|
||||
@ -73,6 +74,31 @@ class InviteLinksStore {
|
||||
});
|
||||
};
|
||||
|
||||
getPortalInviteLink = async (type) => {
|
||||
if (this.peopleStore.authStore.isVisitor) return Promise.resolve();
|
||||
|
||||
const link = await getInvitationLink(type);
|
||||
|
||||
runInAction(() => {
|
||||
switch (type) {
|
||||
case EmployeeType.User:
|
||||
this.setUserLink(link);
|
||||
break;
|
||||
case EmployeeType.Guest:
|
||||
this.setGuestLink(link);
|
||||
break;
|
||||
case EmployeeType.Admin:
|
||||
this.setAdminLink(link);
|
||||
break;
|
||||
case EmployeeType.Collaborator:
|
||||
this.setCollaboratorLink(link);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
return link;
|
||||
};
|
||||
|
||||
getShortenedLink = async (link, forUser = false) => {
|
||||
if (forUser) {
|
||||
const userLink = await getShortenedLink(link);
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@docspace/doceditor",
|
||||
"version": "2.6.0",
|
||||
"version": "2.6.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "node ./scripts/buildTranslations.js && next build",
|
||||
|
@ -393,28 +393,28 @@ export const checkIsAuthenticated = async () => {
|
||||
return isAuth.response as boolean;
|
||||
};
|
||||
|
||||
export async function checkFillFromDraft(
|
||||
templateFileId: number,
|
||||
share?: string,
|
||||
) {
|
||||
const [checkFillFormDraft] = createRequest(
|
||||
[`/files/masterform/${templateFileId}/checkfillformdraft`],
|
||||
[
|
||||
share ? ["Request-Token", share] : ["", ""],
|
||||
["Content-Type", "application/json;charset=utf-8"],
|
||||
],
|
||||
"POST",
|
||||
JSON.stringify({ fileId: templateFileId }),
|
||||
);
|
||||
// export async function checkFillFromDraft(
|
||||
// templateFileId: number,
|
||||
// share?: string,
|
||||
// ) {
|
||||
// const [checkFillFormDraft] = createRequest(
|
||||
// [`/files/masterform/${templateFileId}/checkfillformdraft`],
|
||||
// [
|
||||
// share ? ["Request-Token", share] : ["", ""],
|
||||
// ["Content-Type", "application/json;charset=utf-8"],
|
||||
// ],
|
||||
// "POST",
|
||||
// JSON.stringify({ fileId: templateFileId }),
|
||||
// );
|
||||
|
||||
const response = await fetch(checkFillFormDraft);
|
||||
// const response = await fetch(checkFillFormDraft);
|
||||
|
||||
if (!response.ok) return null;
|
||||
// if (!response.ok) return null;
|
||||
|
||||
const { response: formUrl } = await response.json();
|
||||
// const { response: formUrl } = await response.json();
|
||||
|
||||
return formUrl as string;
|
||||
}
|
||||
// return formUrl as string;
|
||||
// }
|
||||
|
||||
export async function openEdit(
|
||||
fileId: number | string,
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@docspace/login",
|
||||
"version": "2.6.0",
|
||||
"version": "2.6.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "node ./scripts/buildTranslations.js && next build",
|
||||
|
@ -65,6 +65,8 @@ import { LoginDispatchContext, LoginValueContext } from "../Login";
|
||||
import LDAPContainer from "./sub-components/LDAPContainer";
|
||||
import { RecaptchaType } from "@docspace/shared/enums";
|
||||
|
||||
let showToastr = true;
|
||||
|
||||
const LoginForm = ({
|
||||
hashSettings,
|
||||
cookieSettingsEnabled,
|
||||
@ -195,8 +197,7 @@ const LoginForm = ({
|
||||
!toastr.isActive(toastId.current || "confirm-email-toast")
|
||||
)
|
||||
toastId.current = toastr.success(text);
|
||||
if (authError && ready) toastr.error(t("Common:ProviderLoginError"));
|
||||
}, [message, confirmedEmail, t, ready, authError, authCallback]);
|
||||
}, [message, confirmedEmail, t, ready, authCallback]);
|
||||
|
||||
const onChangeLogin = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
//console.log("onChangeLogin", e.target.value);
|
||||
@ -380,6 +381,11 @@ const LoginForm = ({
|
||||
|
||||
const passwordErrorMessage = errorMessage();
|
||||
|
||||
if (authError && ready) {
|
||||
if (showToastr) toastr.error(t("Common:ProviderLoginError"));
|
||||
showToastr = false;
|
||||
}
|
||||
|
||||
return (
|
||||
<form className="auth-form-container">
|
||||
<EmailContainer
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@docspace/management",
|
||||
"version": "2.6.0",
|
||||
"version": "2.6.1",
|
||||
"private": true,
|
||||
"homepage": "/management",
|
||||
"scripts": {
|
||||
|
@ -1180,15 +1180,15 @@ export async function getPresignedUri(fileId: number | string) {
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function checkFillFormDraft(fileId: number | string) {
|
||||
const res = (await request({
|
||||
method: "post",
|
||||
url: `files/masterform/${fileId}/checkfillformdraft`,
|
||||
data: { fileId },
|
||||
})) as string;
|
||||
// export async function checkFillFormDraft(fileId: number | string) {
|
||||
// const res = (await request({
|
||||
// method: "post",
|
||||
// url: `files/masterform/${fileId}/checkfillformdraft`,
|
||||
// data: { fileId },
|
||||
// })) as string;
|
||||
|
||||
return res;
|
||||
}
|
||||
// return res;
|
||||
// }
|
||||
|
||||
export async function fileCopyAs(
|
||||
fileId: number,
|
||||
|
@ -35,7 +35,7 @@ import {
|
||||
TTenantExtra,
|
||||
} from "./types";
|
||||
|
||||
export function getShortenedLink(link) {
|
||||
export function getShortenedLink(link: string) {
|
||||
return request({
|
||||
method: "put",
|
||||
url: "/portal/getshortenlink",
|
||||
@ -43,13 +43,13 @@ export function getShortenedLink(link) {
|
||||
});
|
||||
}
|
||||
|
||||
export function getInvitationLink(type) {
|
||||
return request({
|
||||
export async function getInvitationLink(type: EmployeeType) {
|
||||
const res = await request({
|
||||
method: "get",
|
||||
url: `/portal/users/invite/${type}`,
|
||||
}).then((link) => {
|
||||
return Promise.resolve(link);
|
||||
});
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
export function getInvitationLinks() {
|
||||
|
@ -77,6 +77,8 @@ class TableHeaderComponent extends React.Component<
|
||||
infoPanelVisible,
|
||||
columnStorageName,
|
||||
columnInfoPanelStorageName,
|
||||
sortBy,
|
||||
sorted,
|
||||
} = this.props;
|
||||
|
||||
if (columnStorageName === prevProps.columnStorageName) {
|
||||
@ -84,6 +86,14 @@ class TableHeaderComponent extends React.Component<
|
||||
? localStorage.getItem(columnInfoPanelStorageName)
|
||||
: localStorage.getItem(columnStorageName);
|
||||
|
||||
if (sortBy !== prevProps.sortBy || sorted !== prevProps.sorted) {
|
||||
const columnIndex = columns.findIndex((c) => c?.sortBy === sortBy);
|
||||
|
||||
if (columnIndex > -1 && !columns[columnIndex].enable) {
|
||||
columns[columnIndex].onChange?.(columns[columnIndex].key);
|
||||
}
|
||||
}
|
||||
|
||||
// columns.length + 1 - its settings column
|
||||
if (storageSize && storageSize.split(" ").length !== columns.length + 1) {
|
||||
return this.resetColumns();
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@docspace/shared",
|
||||
"version": "2.6.0",
|
||||
"version": "2.6.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "echo 'skip it'",
|
||||
|
@ -34,7 +34,7 @@
|
||||
IE: 11,
|
||||
Edge: 109,
|
||||
Opera: 90,
|
||||
Safari: 16,
|
||||
Safari: 15,
|
||||
SafariMobile: 16,
|
||||
AscDesktopEditor: 6,
|
||||
SamsungBrowser: 4,
|
||||
@ -50,7 +50,7 @@
|
||||
let temp = [];
|
||||
let match =
|
||||
agent.match(
|
||||
/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i,
|
||||
/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i
|
||||
) || [];
|
||||
|
||||
if (/trident/i.test(match[1])) {
|
||||
@ -60,7 +60,7 @@
|
||||
|
||||
if (match[1] === "Chrome") {
|
||||
temp = agent.match(
|
||||
/\b(OPR|Edge|AscDesktopEditor|SamsungBrowser|UCBrowser)\/(\d+.\d)/,
|
||||
/\b(OPR|Edge|AscDesktopEditor|SamsungBrowser|UCBrowser)\/(\d+.\d)/
|
||||
);
|
||||
|
||||
const userOS =
|
||||
|
Loading…
Reference in New Issue
Block a user