Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACS-6369] - ACA on multi select file/folder permisstion menu should not be shown #3571

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export const folderFavFile = {

// ---- multiple selection ---

const multipleSelContextMenu = ['Download', 'Favorite', 'Move', 'Copy', 'Delete', 'Permissions'];
const multipleSelToolbarMore = ['Favorite', 'Move', 'Copy', 'Delete', 'Permissions'];
const multipleSelContextMenu = ['Download', 'Favorite', 'Move', 'Copy', 'Delete'];
const multipleSelToolbarMore = ['Favorite', 'Move', 'Copy', 'Delete'];

export const multipleSelFile = {
contextMenu: multipleSelContextMenu,
Expand Down
7 changes: 6 additions & 1 deletion projects/aca-shared/rules/src/app.rules.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -849,12 +849,17 @@ describe('app.evaluators', () => {
expect(app.canManagePermissions(context)).toBe(false);
});

it('should return false if many nodes are selected', () => {
context.selection.count = 2;
expect(app.canManagePermissions(context)).toBe(false);
});

it('should return false if the selected node is a smart folder', () => {
context.selection.first = { entry: { aspectNames: ['smf:customConfigSmartFolder'], isFolder: true } } as NodeEntry;
expect(app.canManagePermissions(context)).toBe(false);
});

it('should return true if user can update the selected node and it is not a trashcan nor smart folder', () => {
it('should return true if user can update the selected node and it is not a trashcan nor smart folder nor multiselect', () => {
expect(app.canManagePermissions(context)).toBe(true);
});
});
Expand Down
2 changes: 1 addition & 1 deletion projects/aca-shared/rules/src/app.rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ export const canEditAspects = (context: RuleContext): boolean =>
* @param context Rule execution context
*/
export const canManagePermissions = (context: RuleContext): boolean =>
[canUpdateSelectedNode(context), navigation.isNotTrashcan(context), !isSmartFolder(context)].every(Boolean);
[canUpdateSelectedNode(context), navigation.isNotTrashcan(context), !isSmartFolder(context), !isMultiselection(context)].every(Boolean);

/**
* Checks if user can toggle **Edit Offline** mode for selected node.
Expand Down
Loading