Merge branch 'release/v2.6.0' into bugfix/Bug69117
This commit is contained in:
commit
3ab1201b78
@ -52,6 +52,7 @@ import {
|
||||
StyledSelectedOwner,
|
||||
} from "./StyledDialog";
|
||||
import { PRODUCT_NAME } from "@docspace/shared/constants";
|
||||
import { EmployeeActivationStatus } from "@docspace/shared/enums";
|
||||
|
||||
const ChangePortalOwnerDialog = ({
|
||||
t,
|
||||
@ -91,7 +92,7 @@ const ChangePortalOwnerDialog = ({
|
||||
onClose && onClose();
|
||||
toastr.success(
|
||||
t("Settings:ConfirmEmailSended", {
|
||||
ownerName: selectedUser.label,
|
||||
ownerName: displayName,
|
||||
}),
|
||||
);
|
||||
})
|
||||
@ -122,6 +123,14 @@ const ChangePortalOwnerDialog = ({
|
||||
t("DeactivateOrDeletePortal", { productName: PRODUCT_NAME }),
|
||||
];
|
||||
|
||||
const filter = React.useMemo(() => {
|
||||
const newFilter = new Filter();
|
||||
|
||||
newFilter.employeeStatus = EmployeeActivationStatus.Activated;
|
||||
|
||||
return newFilter;
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<ModalDialog
|
||||
displayType={"aside"}
|
||||
@ -149,6 +158,7 @@ const ChangePortalOwnerDialog = ({
|
||||
}}
|
||||
currentUserId={id}
|
||||
disableDisabledUsers
|
||||
filter={filter}
|
||||
/>
|
||||
</ModalDialog.Container>
|
||||
)}
|
||||
|
@ -122,7 +122,7 @@ export const HistoryItemList = ({
|
||||
iconName={FolderLocationReactSvgUrl}
|
||||
size="16"
|
||||
isFill
|
||||
onClick={() => checkAndOpenLocationAction!(item)}
|
||||
onClick={() => checkAndOpenLocationAction!(item, actionType)}
|
||||
title={t("Files:OpenLocation")}
|
||||
/>
|
||||
</StyledHistoryBlockFile>
|
||||
|
@ -59,8 +59,8 @@ const GroupsRow = ({
|
||||
changeGroupContextSelection(item, !rightMouseButtonClick);
|
||||
};
|
||||
|
||||
const onOpenGroup = () => {
|
||||
openGroupAction(item.id, true, item.name);
|
||||
const onOpenGroup = (e) => {
|
||||
openGroupAction(item.id, true, item.name, e);
|
||||
};
|
||||
|
||||
const nameColor =
|
||||
|
@ -62,8 +62,8 @@ const GroupsTableItem = ({
|
||||
changeGroupContextSelection(item, !rightMouseButtonClick);
|
||||
};
|
||||
|
||||
const onOpenGroup = () => {
|
||||
openGroupAction(item.id, true, item.name);
|
||||
const onOpenGroup = (e) => {
|
||||
openGroupAction(item.id, true, item.name, e);
|
||||
};
|
||||
|
||||
const onRowClick = (e) => {
|
||||
|
@ -646,7 +646,6 @@ export default inject(
|
||||
pathParts,
|
||||
navigationPath,
|
||||
security,
|
||||
canCopyPublicLink,
|
||||
rootFolderType,
|
||||
shared,
|
||||
} = selectedFolderStore;
|
||||
@ -663,8 +662,6 @@ export default inject(
|
||||
|
||||
const isRoom = !!roomType;
|
||||
const isPublicRoomType = roomType === RoomsType.PublicRoom;
|
||||
const isCustomRoomType = roomType === RoomsType.CustomRoom;
|
||||
const isFormRoomType = roomType === RoomsType.FormRoom;
|
||||
|
||||
const {
|
||||
onCreateAndCopySharedLink,
|
||||
@ -717,14 +714,9 @@ export default inject(
|
||||
const sharedItem = navigationPath.find((r) => r.shared);
|
||||
|
||||
const showNavigationButton =
|
||||
isLoading || !security?.CopyLink
|
||||
isLoading || !security?.CopyLink || isPublicRoom || isArchive
|
||||
? false
|
||||
: (!isPublicRoom &&
|
||||
!isArchive &&
|
||||
canCopyPublicLink &&
|
||||
(isPublicRoomType || isCustomRoomType || isFormRoomType) &&
|
||||
shared) ||
|
||||
(sharedItem && sharedItem.canCopyPublicLink);
|
||||
: security?.Read && (shared || sharedItem);
|
||||
|
||||
return {
|
||||
showText: settingsStore.showText,
|
||||
@ -748,7 +740,6 @@ export default inject(
|
||||
|
||||
setSelected,
|
||||
security,
|
||||
canCopyPublicLink,
|
||||
|
||||
getHeaderMenu,
|
||||
getCheckboxItemLabel,
|
||||
|
@ -396,17 +396,14 @@ class ContextOptionsStore {
|
||||
};
|
||||
|
||||
onCopyLink = async (item, t) => {
|
||||
const { shared, navigationPath, canCopyPublicLink } =
|
||||
this.selectedFolderStore;
|
||||
const { shared, navigationPath } = this.selectedFolderStore;
|
||||
|
||||
const isArchive = item.rootFolderType === FolderType.Archive;
|
||||
|
||||
const { href } = item;
|
||||
const sharedItem = navigationPath.find((r) => r.shared);
|
||||
|
||||
const isShared =
|
||||
(sharedItem && sharedItem.canCopyPublicLink) ||
|
||||
(shared && canCopyPublicLink);
|
||||
const isShared = shared || sharedItem;
|
||||
|
||||
if (isShared && !isArchive) {
|
||||
try {
|
||||
@ -1118,7 +1115,7 @@ class ContextOptionsStore {
|
||||
return [
|
||||
{
|
||||
key: "public-room_share",
|
||||
label: t("Files:CopyLink"),
|
||||
label: t("Files:CopySharedLink"),
|
||||
icon: TabletLinkReactSvgUrl,
|
||||
onClick: () => {
|
||||
copy(window.location.href);
|
||||
@ -1126,6 +1123,11 @@ class ContextOptionsStore {
|
||||
},
|
||||
disabled: this.settingsStore.isFrame,
|
||||
},
|
||||
{
|
||||
key: "separator0",
|
||||
isSeparator: true,
|
||||
disabled: !item.security?.Download,
|
||||
},
|
||||
{
|
||||
key: "public-room_edit",
|
||||
label: t("Common:Download"),
|
||||
@ -1218,8 +1220,7 @@ class ContextOptionsStore {
|
||||
const hasInfoPanel = contextOptions.includes("show-info");
|
||||
|
||||
//const emailSendIsDisabled = true;
|
||||
const showSeparator0 =
|
||||
(hasInfoPanel || !isMedia) && !this.publicRoomStore.isPublicRoom; // || !emailSendIsDisabled;
|
||||
const showSeparator0 = hasInfoPanel || !isMedia; // || !emailSendIsDisabled;
|
||||
|
||||
const { isGroupMenuBlocked } = this.filesActionsStore;
|
||||
|
||||
@ -1553,8 +1554,7 @@ class ContextOptionsStore {
|
||||
icon: InvitationLinkReactSvgUrl,
|
||||
onClick: () => this.onCopyLink(item, t),
|
||||
disabled:
|
||||
(isPublicRoomType && item.canCopyPublicLink && !isArchive) ||
|
||||
this.publicRoomStore.isPublicRoom ||
|
||||
(isPublicRoomType && item.security?.Read && !isArchive) ||
|
||||
!item.security?.CopyLink,
|
||||
},
|
||||
{
|
||||
@ -1565,7 +1565,7 @@ class ContextOptionsStore {
|
||||
disabled:
|
||||
this.publicRoomStore.isPublicRoom ||
|
||||
isArchive ||
|
||||
!item.canCopyPublicLink ||
|
||||
!item.security?.Read ||
|
||||
!isPublicRoomType,
|
||||
onClick: () => this.onCreateAndCopySharedLink(item, t),
|
||||
// onLoad: () => this.onLoadLinks(t, item),
|
||||
@ -1617,7 +1617,7 @@ class ContextOptionsStore {
|
||||
label: t("Common:Info"),
|
||||
icon: InfoOutlineReactSvgUrl,
|
||||
onClick: () => this.onShowInfoPanel(item),
|
||||
disabled: this.publicRoomStore.isPublicRoom,
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
id: "option_block-unblock-version",
|
||||
@ -1627,7 +1627,7 @@ class ContextOptionsStore {
|
||||
onClick: () => this.lockFile(item, t),
|
||||
disabled: false,
|
||||
},
|
||||
!this.publicRoomStore.isPublicRoom && {
|
||||
{
|
||||
key: "separator1",
|
||||
isSeparator: true,
|
||||
},
|
||||
|
@ -1470,7 +1470,7 @@ class FilesActionStore {
|
||||
return titleWithoutExtension;
|
||||
};
|
||||
|
||||
checkAndOpenLocationAction = async (item) => {
|
||||
checkAndOpenLocationAction = async (item, actionType) => {
|
||||
const { categoryType } = this.filesStore;
|
||||
const { myRoomsId, myFolderId, archiveRoomsId, recycleBinFolderId } =
|
||||
this.treeFoldersStore;
|
||||
@ -1501,7 +1501,11 @@ class FilesActionStore {
|
||||
rootFolderType,
|
||||
};
|
||||
|
||||
const url = getCategoryUrl(categoryType, parentId);
|
||||
const isTrash = actionType === "delete";
|
||||
const url = getCategoryUrl(
|
||||
isTrash ? CategoryType.Trash : categoryType,
|
||||
parentId,
|
||||
);
|
||||
|
||||
const newFilter = FilesFilter.getDefault();
|
||||
|
||||
|
@ -1575,18 +1575,14 @@ class FilesStore {
|
||||
(data.current.rootFolderType === Rooms ||
|
||||
data.current.rootFolderType === Archive);
|
||||
|
||||
let shared, canCopyPublicLink;
|
||||
let shared;
|
||||
if (idx === 1) {
|
||||
let room = data.current;
|
||||
|
||||
if (!isCurrentFolder) {
|
||||
room = await api.files.getFolderInfo(folderId);
|
||||
shared = room.shared;
|
||||
canCopyPublicLink =
|
||||
room.access === ShareAccessRights.RoomManager ||
|
||||
room.access === ShareAccessRights.None;
|
||||
|
||||
room.canCopyPublicLink = canCopyPublicLink;
|
||||
this.infoPanelStore.setInfoPanelRoom(room);
|
||||
}
|
||||
|
||||
@ -1604,7 +1600,6 @@ class FilesStore {
|
||||
roomType,
|
||||
isRootRoom,
|
||||
shared,
|
||||
canCopyPublicLink,
|
||||
};
|
||||
}),
|
||||
).then((res) => {
|
||||
@ -2129,6 +2124,20 @@ class FilesStore {
|
||||
fileOptions = this.removeOptions(fileOptions, optionsToRemove);
|
||||
}
|
||||
|
||||
if (this.publicRoomStore.isPublicRoom) {
|
||||
fileOptions = this.removeOptions(fileOptions, [
|
||||
"separator0",
|
||||
"sharing-settings",
|
||||
"send-by-email",
|
||||
"show-info",
|
||||
"separator1",
|
||||
"create-room",
|
||||
"separator2",
|
||||
"remove-from-recent",
|
||||
"copy-general-link",
|
||||
]);
|
||||
}
|
||||
|
||||
if (!canDownload) {
|
||||
fileOptions = this.removeOptions(fileOptions, ["download"]);
|
||||
}
|
||||
@ -2545,6 +2554,15 @@ class FilesStore {
|
||||
folderOptions = this.removeOptions(folderOptions, optionsToRemove);
|
||||
}
|
||||
|
||||
if (this.publicRoomStore.isPublicRoom) {
|
||||
folderOptions = this.removeOptions(folderOptions, [
|
||||
"show-info",
|
||||
"sharing-settings",
|
||||
"separator1",
|
||||
"create-room",
|
||||
]);
|
||||
}
|
||||
|
||||
if (!canDownload) {
|
||||
folderOptions = this.removeOptions(folderOptions, ["download"]);
|
||||
}
|
||||
@ -3367,10 +3385,6 @@ class FilesStore {
|
||||
|
||||
const isForm = fileExst === ".oform";
|
||||
|
||||
const canCopyPublicLink =
|
||||
access === ShareAccessRights.RoomManager ||
|
||||
access === ShareAccessRights.None;
|
||||
|
||||
return {
|
||||
availableExternalRights,
|
||||
access,
|
||||
@ -3440,7 +3454,6 @@ class FilesStore {
|
||||
type,
|
||||
hasDraft,
|
||||
isForm,
|
||||
canCopyPublicLink,
|
||||
requestToken,
|
||||
lastOpened,
|
||||
quotaLimit,
|
||||
|
@ -40,6 +40,7 @@ import { combineUrl } from "@docspace/shared/utils/combineUrl";
|
||||
import AccountsFilter from "@docspace/shared/api/people/filter";
|
||||
import api from "@docspace/shared/api";
|
||||
import { TGroup } from "@docspace/shared/api/groups/types";
|
||||
import { openingNewTab } from "@docspace/shared/utils/openingNewTab";
|
||||
|
||||
class GroupsStore {
|
||||
authStore;
|
||||
@ -593,10 +594,15 @@ class GroupsStore {
|
||||
groupId: string,
|
||||
withBackURL: boolean,
|
||||
tempTitle: string,
|
||||
e: React.MouseEvent<Element, MouseEvent>,
|
||||
) => {
|
||||
const { setIsSectionBodyLoading, setIsSectionFilterLoading } =
|
||||
this.clientLoadingStore;
|
||||
|
||||
const url = `/accounts/groups/${groupId}`;
|
||||
|
||||
if (openingNewTab(url, e)) return;
|
||||
|
||||
this.setSelection([]);
|
||||
this.setBufferSelection(null);
|
||||
this.setCurrentGroup(null);
|
||||
@ -610,7 +616,7 @@ class GroupsStore {
|
||||
this.setInsideGroupBackUrl(url);
|
||||
}
|
||||
|
||||
window.DocSpace.navigate(`/accounts/groups/${groupId}`);
|
||||
window.DocSpace.navigate(url);
|
||||
};
|
||||
|
||||
updateGroup = async (
|
||||
|
@ -297,9 +297,6 @@ class InfoPanelStore {
|
||||
...infoPanelSelection,
|
||||
isRoom: infoPanelSelection.isRoom || !!infoPanelSelection.roomType,
|
||||
icon: this.getInfoPanelItemIcon(infoPanelSelection, 32),
|
||||
canCopyPublicLink:
|
||||
infoPanelSelection.access === ShareAccessRights.RoomManager ||
|
||||
infoPanelSelection.access === ShareAccessRights.None,
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -51,7 +51,6 @@ export type TNavigationPath = {
|
||||
roomType: RoomsType;
|
||||
isRootRoom: boolean;
|
||||
shared: boolean;
|
||||
canCopyPublicLink: boolean;
|
||||
};
|
||||
|
||||
type ExcludeTypes = SettingsStore | Function;
|
||||
@ -181,7 +180,6 @@ class SelectedFolderStore {
|
||||
private: this.private,
|
||||
canShare: this.canShare,
|
||||
isArchive: this.isArchive,
|
||||
canCopyPublicLink: this.canCopyPublicLink,
|
||||
type: this.type,
|
||||
isRootFolder: this.isRootFolder,
|
||||
parentRoomType: this.parentRoomType,
|
||||
@ -192,13 +190,6 @@ class SelectedFolderStore {
|
||||
return this.pathParts && this.pathParts.length <= 1;
|
||||
}
|
||||
|
||||
get canCopyPublicLink() {
|
||||
return (
|
||||
this.access === ShareAccessRights.RoomManager ||
|
||||
this.access === ShareAccessRights.None
|
||||
);
|
||||
}
|
||||
|
||||
toDefault = () => {
|
||||
this.folders = null;
|
||||
this.parentId = 0;
|
||||
|
@ -28,7 +28,6 @@
|
||||
|
||||
import React from "react";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import { isMobile } from "react-device-detect";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { DocumentEditor } from "@onlyoffice/document-editor-react";
|
||||
@ -142,14 +141,9 @@ const Editor = ({
|
||||
if (config) newConfig.editorConfig = { ...config.editorConfig };
|
||||
|
||||
const search = typeof window !== "undefined" ? window.location.search : "";
|
||||
const editorType = new URLSearchParams(search).get("editorType");
|
||||
|
||||
//if (view && newConfig.editorConfig) newConfig.editorConfig.mode = "view";
|
||||
|
||||
if (editorType) newConfig.type = editorType;
|
||||
|
||||
if (isMobile) newConfig.type = "mobile";
|
||||
|
||||
let goBack: TGoBack = {} as TGoBack;
|
||||
|
||||
if (fileInfo) {
|
||||
|
@ -229,7 +229,7 @@ const FilterBlock = ({
|
||||
};
|
||||
});
|
||||
|
||||
if (isSelected) {
|
||||
if (isSelected && key !== "0") {
|
||||
if (isMultiSelect) {
|
||||
const groupIdx = value.findIndex(
|
||||
(item) => "group" in item && item.group === group,
|
||||
@ -293,7 +293,7 @@ const FilterBlock = ({
|
||||
) {
|
||||
item.key.push(key);
|
||||
} else {
|
||||
item.key = key;
|
||||
item.key = isSelected && key === "0" ? "1" : key;
|
||||
if (label) {
|
||||
item.label = label;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user