From 683138ced104ae22911984f25f2c9c2d32f07382 Mon Sep 17 00:00:00 2001 From: DominikIwanek <141320833+DominikIwanek@users.noreply.github.com> Date: Fri, 22 Dec 2023 15:53:23 +0100 Subject: [PATCH] [ACS-6369] - ACA on multi select file/folder permisstion menu should not be shown (#3571) --- .../src/resources/test-data/test-data-files-folders.ts | 4 ++-- projects/aca-shared/rules/src/app.rules.spec.ts | 7 ++++++- projects/aca-shared/rules/src/app.rules.ts | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/projects/aca-playwright-shared/src/resources/test-data/test-data-files-folders.ts b/projects/aca-playwright-shared/src/resources/test-data/test-data-files-folders.ts index 97c76b84ee..bcbe9b0a9d 100644 --- a/projects/aca-playwright-shared/src/resources/test-data/test-data-files-folders.ts +++ b/projects/aca-playwright-shared/src/resources/test-data/test-data-files-folders.ts @@ -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, diff --git a/projects/aca-shared/rules/src/app.rules.spec.ts b/projects/aca-shared/rules/src/app.rules.spec.ts index 4f3a848a60..7aac081b48 100644 --- a/projects/aca-shared/rules/src/app.rules.spec.ts +++ b/projects/aca-shared/rules/src/app.rules.spec.ts @@ -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); }); }); diff --git a/projects/aca-shared/rules/src/app.rules.ts b/projects/aca-shared/rules/src/app.rules.ts index df9e89374d..35789dd627 100644 --- a/projects/aca-shared/rules/src/app.rules.ts +++ b/projects/aca-shared/rules/src/app.rules.ts @@ -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.