Merge branch 'bugfix/context-actions' of https://github.com/ONLYOFFICE/AppServer into bugfix/context-actions

This commit is contained in:
Nikita Gopienko 2021-05-19 18:14:40 +03:00
commit 52750c607d
2 changed files with 27 additions and 11 deletions

View File

@ -297,9 +297,9 @@ export default function withContextOptions(WrappedComponent) {
return {
key: option,
label: t("Preview"),
icon: "EyeIcon",
icon: "/static/images/eye.react.svg",
onClick: this.onClickLinkEdit,
disabled: true,
disabled: false,
};
case "view":
return {

View File

@ -389,13 +389,14 @@ class FilesStore {
isCommon,
isShare,
isFavoritesFolder,
isShareFolder,
} = this.treeFoldersStore;
const { isRootFolder } = this.selectedFolderStore;
const isThirdPartyFolder = item.providerKey && isRootFolder;
const isShareFolder = isShare(item.rootFolderType);
const isShareItem = isShare(item.rootFolderType);
const isCommonFolder = isCommon(item.rootFolderType);
const { isDesktopClient } = this.settingsStore;
@ -616,8 +617,18 @@ class FilesStore {
fileOptions = this.removeOptions(fileOptions, ["open-location"]);
}
if (isShareFolder) {
fileOptions = this.removeOptions(fileOptions, ["move-to", "delete"]);
if (isShareItem) {
if (!isFullAccess) {
fileOptions = this.removeOptions(fileOptions, ["edit"]);
}
if (isShareFolder) {
fileOptions = this.removeOptions(fileOptions, [
"copy",
"move-to",
"delete",
]);
}
} else {
fileOptions = this.removeOptions(fileOptions, ["unsubscribe"]);
}
@ -648,11 +659,13 @@ class FilesStore {
folderOptions = this.removeOptions(folderOptions, ["copy"]);
}
if (isShareFolder) {
folderOptions = this.removeOptions(folderOptions, [
"move-to",
"delete",
]);
if (isShareItem) {
if (isShareFolder) {
folderOptions = this.removeOptions(folderOptions, [
"move-to",
"delete",
]);
}
} else {
folderOptions = this.removeOptions(folderOptions, ["unsubscribe"]);
}
@ -692,9 +705,12 @@ class FilesStore {
"move-to",
"delete",
"change-thirdparty-info",
"separator2",
]);
if (!isShareItem) {
folderOptions = this.removeOptions(folderOptions, ["separator2"]);
}
if (isVisitor) {
folderOptions = this.removeOptions(folderOptions, ["rename"]);
}