Web: Removed menu item inside the room.
This commit is contained in:
parent
d66777b221
commit
7cd4c7f737
@ -26,6 +26,7 @@ class ContextOptionsStore {
|
||||
versionHistoryStore;
|
||||
settingsStore;
|
||||
filesSettingsStore;
|
||||
selectedFolderStore;
|
||||
|
||||
constructor(
|
||||
authStore,
|
||||
@ -36,7 +37,8 @@ class ContextOptionsStore {
|
||||
treeFoldersStore,
|
||||
uploadDataStore,
|
||||
versionHistoryStore,
|
||||
settingsStore
|
||||
settingsStore,
|
||||
selectedFolderStore
|
||||
) {
|
||||
makeAutoObservable(this);
|
||||
this.authStore = authStore;
|
||||
@ -48,6 +50,7 @@ class ContextOptionsStore {
|
||||
this.uploadDataStore = uploadDataStore;
|
||||
this.versionHistoryStore = versionHistoryStore;
|
||||
this.settingsStore = settingsStore;
|
||||
this.selectedFolderStore = selectedFolderStore;
|
||||
}
|
||||
|
||||
onOpenFolder = (item) => {
|
||||
@ -456,12 +459,13 @@ class ContextOptionsStore {
|
||||
|
||||
getFilesContextOptions = (item, t) => {
|
||||
const { contextOptions } = item;
|
||||
|
||||
const { id, rootFolderId } = this.selectedFolderStore;
|
||||
const { enablePlugins } = this.authStore.settingsStore;
|
||||
|
||||
const isRootThirdPartyFolder =
|
||||
item.providerKey && item.id === item.rootFolderId;
|
||||
|
||||
const isRootRoom = item.isRoom && rootFolderId === id;
|
||||
const isShareable = item.canShare;
|
||||
|
||||
const isMedia = this.settingsStore.isMediaOrImage(item.fileExst);
|
||||
@ -591,6 +595,29 @@ class ContextOptionsStore {
|
||||
},
|
||||
];
|
||||
|
||||
const pinOptions = isRootRoom
|
||||
? [
|
||||
{
|
||||
key: "pin-room",
|
||||
label: t("Pin"),
|
||||
icon: "/static/images/pin.react.svg",
|
||||
onClick: (e) => this.onClickPin(e, item.id, t),
|
||||
disabled: false,
|
||||
"data-action": "pin",
|
||||
action: "pin",
|
||||
},
|
||||
{
|
||||
key: "unpin-room",
|
||||
label: t("Unpin"),
|
||||
icon: "/static/images/unpin.react.svg",
|
||||
onClick: (e) => this.onClickPin(e, item.id, t),
|
||||
disabled: false,
|
||||
"data-action": "unpin",
|
||||
action: "unpin",
|
||||
},
|
||||
]
|
||||
: [];
|
||||
|
||||
const optionsModel = [
|
||||
{
|
||||
key: "select",
|
||||
@ -674,24 +701,7 @@ class ContextOptionsStore {
|
||||
onClick: () => this.onShowInfoPanel(item),
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
key: "pin-room",
|
||||
label: t("Pin"),
|
||||
icon: "/static/images/pin.react.svg",
|
||||
onClick: (e) => this.onClickPin(e, item.id, t),
|
||||
disabled: false,
|
||||
"data-action": "pin",
|
||||
action: "pin",
|
||||
},
|
||||
{
|
||||
key: "unpin-room",
|
||||
label: t("Unpin"),
|
||||
icon: "/static/images/unpin.react.svg",
|
||||
onClick: (e) => this.onClickPin(e, item.id, t),
|
||||
disabled: false,
|
||||
"data-action": "unpin",
|
||||
action: "unpin",
|
||||
},
|
||||
...pinOptions,
|
||||
{
|
||||
key: "sharing-settings",
|
||||
label: t("SharingPanel:SharingSettingsTitle"),
|
||||
|
@ -26,7 +26,7 @@ class SelectedFolderStore {
|
||||
isRoom = null;
|
||||
logo = null;
|
||||
tags = null;
|
||||
|
||||
rootFolderId = null;
|
||||
settingsStore = null;
|
||||
|
||||
constructor(settingsStore) {
|
||||
@ -64,6 +64,7 @@ class SelectedFolderStore {
|
||||
this.isRoom = null;
|
||||
this.logo = null;
|
||||
this.tags = null;
|
||||
this.rootFolderId = null;
|
||||
};
|
||||
|
||||
setParentId = (parentId) => {
|
||||
|
@ -115,7 +115,8 @@ const contextOptionsStore = new ContextOptionsStore(
|
||||
treeFoldersStore,
|
||||
uploadDataStore,
|
||||
versionHistoryStore,
|
||||
settingsStore
|
||||
settingsStore,
|
||||
selectedFolderStore
|
||||
);
|
||||
|
||||
const hotkeyStore = new HotkeyStore(
|
||||
|
Loading…
Reference in New Issue
Block a user