Web: Client: Files: Fixed share option for not edited items

This commit is contained in:
Ilya Oleshko 2021-06-10 14:19:26 +03:00
parent 5f16720aba
commit 7501e91ae3
3 changed files with 21 additions and 1 deletions

View File

@ -196,6 +196,8 @@ export default function withFileActions(WrappedFileItem) {
checked,
dragging,
isFolder,
personal,
canWebEdit,
} = this.props;
const { fileExst, access, contentLength, id, shared } = item;
@ -218,7 +220,12 @@ export default function withFileActions(WrappedFileItem) {
: "96px";
const sharedButton =
!canShare || (isPrivacy && !fileExst) || isEdit || id <= 0 || isMobile
!canShare ||
(isPrivacy && !fileExst) ||
(personal && !canWebEdit) ||
isEdit ||
id <= 0 ||
isMobile
? null
: this.getSharedButton(shared);
@ -252,6 +259,7 @@ export default function withFileActions(WrappedFileItem) {
return inject(
(
{
auth,
filesActionsStore,
dialogsStore,
treeFoldersStore,
@ -351,6 +359,7 @@ export default function withFileActions(WrappedFileItem) {
setMediaViewerData,
getFolderInfo,
markAsRead,
personal: auth.settingsStore.personal,
};
}
)(observer(WithFileActions));

View File

@ -324,6 +324,7 @@ class SectionHeaderContent extends React.Component {
isFavoritesFolder,
isRecentFolder,
isShareFolder,
personal,
} = this.props;
let menu = [
@ -443,6 +444,10 @@ class SectionHeaderContent extends React.Component {
menu.splice(4, 1);
}
if ((personal && !isWebEditSelected) || selectionCount > 1) {
menu.splice(1, 1);
}
return menu;
};

View File

@ -462,6 +462,10 @@ class FilesStore {
"mark-read",
"unsubscribe",
]);
if (!this.isWebEditSelected) {
fileOptions = this.removeOptions(fileOptions, ["sharing-settings"]);
}
}
if (!this.isWebEditSelected) {
@ -684,8 +688,10 @@ class FilesStore {
if (personal) {
folderOptions = this.removeOptions(folderOptions, [
"sharing-settings",
"owner-change",
"link-for-portal-users",
"separator1",
"docu-sign",
"mark-read",
"unsubscribe",