Web: Files: Store: Fixed files and folders actions for "personal" setting

This commit is contained in:
Ilya Oleshko 2021-06-04 11:28:44 +03:00
parent 0af3acb46b
commit 914b975ada
2 changed files with 36 additions and 12 deletions

View File

@ -459,6 +459,7 @@ class SectionHeaderContent extends React.Component {
canCreate,
isDesktop,
isTabletView,
personal,
} = this.props;
const menuItems = this.getMenuItems();
@ -526,17 +527,19 @@ class SectionHeaderContent extends React.Component {
getData={this.getContextOptionsPlus}
isDisabled={false}
/>
<ContextMenuButton
className="option-button"
directionX="right"
iconName="images/vertical-dots.react.svg"
size={17}
color="#A3A9AE"
hoverColor="#657077"
isFill
getData={this.getContextOptionsFolder}
isDisabled={false}
/>
{!personal && (
<ContextMenuButton
className="option-button"
directionX="right"
iconName="images/vertical-dots.react.svg"
size={17}
color="#A3A9AE"
hoverColor="#657077"
isFill
getData={this.getContextOptionsFolder}
isDisabled={false}
/>
)}
</>
) : (
canCreate && (
@ -634,6 +637,7 @@ export default inject(
isWebEditSelected,
isTabletView: auth.settingsStore.isTabletView,
confirmDelete: settingsStore.confirmDelete,
personal: auth.settingsStore.personal,
setSelected,
setAction,

View File

@ -416,7 +416,7 @@ class FilesStore {
const isShareItem = isShare(item.rootFolderType);
const isCommonFolder = isCommon(item.rootFolderType);
const { isDesktopClient } = this.settingsStore;
const { isDesktopClient, personal } = this.settingsStore;
if (isFile) {
let fileOptions = [
@ -454,6 +454,16 @@ class FilesStore {
"delete",
];
if (personal) {
fileOptions = this.removeOptions(fileOptions, [
"owner-change",
"link-for-portal-users",
"docu-sign",
"mark-read",
"unsubscribe",
]);
}
if (!this.isWebEditSelected) {
fileOptions = this.removeOptions(fileOptions, ["download-as"]);
}
@ -672,6 +682,16 @@ class FilesStore {
"delete",
];
if (personal) {
folderOptions = this.removeOptions(folderOptions, [
"owner-change",
"link-for-portal-users",
"docu-sign",
"mark-read",
"unsubscribe",
]);
}
if (isPrivacyFolder) {
folderOptions = this.removeOptions(folderOptions, ["copy"]);
}