From 8227f311c3dd1ac4f692cfbff9a870e43b7a5495 Mon Sep 17 00:00:00 2001 From: rmnvch <90370279+rmnvch@users.noreply.github.com> Date: Wed, 10 Sep 2025 06:27:42 +0200 Subject: [PATCH] [ACS-10036] [ACS-10038] Evaluators for folder information and bulk updates (#4786) * [ACS-10036]: provides evaluator for folder size feature * [ACS-10036]: adds tests for folder info evaluator * [ACS-10038]: provides evaluator for bulk update feature * [ACS-10038]: adds tests for bulk update feature * [ACS-10038]: updates documentation --- docs/extending/rules-list.md | 4 +- .../aca-content/assets/app.extensions.json | 6 ++- .../aca-content/src/lib/aca-content.module.ts | 2 + .../search-results.component.html | 2 +- .../aca-shared/rules/src/app.rules.spec.ts | 44 ++++++++++++++++++- projects/aca-shared/rules/src/app.rules.ts | 12 +++++ 6 files changed, 65 insertions(+), 5 deletions(-) diff --git a/docs/extending/rules-list.md b/docs/extending/rules-list.md index 57b807209..8f7addfa3 100644 --- a/docs/extending/rules-list.md +++ b/docs/extending/rules-list.md @@ -82,4 +82,6 @@ Rules/Evaluators created for specific features in ADW to be checked if supported | Version | Key | Description | |---------|---------------------------------|---------------------------------------------------------------------------| -| 8.1.0 | isSavedSearchAvailable | Checks whether current ACS version supports PUT method in Preferences API | \ No newline at end of file +| 8.1.0 | isSavedSearchAvailable | Checks whether current ACS version supports PUT method in Preferences API | +| 8.1.0 | isFolderInfoAvailable | Checks whether current ACS version supports folder size calculation API | +| 8.1.0 | isBulkActionsAvailable | Checks whether current ACS version supports bulk update feature | \ No newline at end of file diff --git a/projects/aca-content/assets/app.extensions.json b/projects/aca-content/assets/app.extensions.json index 95ca1deac..e8aa3798e 100644 --- a/projects/aca-content/assets/app.extensions.json +++ b/projects/aca-content/assets/app.extensions.json @@ -688,7 +688,8 @@ "rules": { "visible": [ "app.selection.folder", - "!app.navigation.isTrashcan" + "!app.navigation.isTrashcan", + "isFolderInfoAvailable" ] } }, @@ -1021,7 +1022,8 @@ "rules": { "visible": [ "app.selection.folder", - "!app.navigation.isTrashcan" + "!app.navigation.isTrashcan", + "isFolderInfoAvailable" ] } }, diff --git a/projects/aca-content/src/lib/aca-content.module.ts b/projects/aca-content/src/lib/aca-content.module.ts index 8f05fa0e5..bd0863247 100644 --- a/projects/aca-content/src/lib/aca-content.module.ts +++ b/projects/aca-content/src/lib/aca-content.module.ts @@ -135,6 +135,8 @@ import { SaveSearchSidenavComponent } from './components/search/search-save/side isMultiSelection: rules.isMultiselection, canPrintFile: rules.canPrintFile, isSavedSearchAvailable: rules.isSavedSearchAvailable, + isFolderInfoAvailable: rules.isFolderInfoAvailable, + isBulkActionsAvailable: rules.isBulkActionsAvailable, 'app.selection.canDelete': rules.canDeleteSelection, 'app.selection.canDownload': rules.canDownloadSelection, diff --git a/projects/aca-content/src/lib/components/search/search-results/search-results.component.html b/projects/aca-content/src/lib/components/search/search-results/search-results.component.html index c52cb11da..74dca72a8 100644 --- a/projects/aca-content/src/lib/components/search/search-results/search-results.component.html +++ b/projects/aca-content/src/lib/components/search/search-results/search-results.component.html @@ -5,7 +5,7 @@ [agentId]="searchAiInputState.selectedAgentId" />
- +
diff --git a/projects/aca-shared/rules/src/app.rules.spec.ts b/projects/aca-shared/rules/src/app.rules.spec.ts index 28db807cb..be81561d3 100644 --- a/projects/aca-shared/rules/src/app.rules.spec.ts +++ b/projects/aca-shared/rules/src/app.rules.spec.ts @@ -23,7 +23,7 @@ */ import * as app from './app.rules'; -import { createVersionRule, getFileExtension, isSavedSearchAvailable } from './app.rules'; +import { createVersionRule, getFileExtension, isSavedSearchAvailable, isFolderInfoAvailable, isBulkActionsAvailable } from './app.rules'; import { TestRuleContext } from './test-rule-context'; import { NodeEntry, RepositoryInfo, StatusInfo } from '@alfresco/js-api'; import { ProfileState, RuleContext } from '@alfresco/adf-extensions'; @@ -1228,6 +1228,48 @@ describe('Versions compatibility', () => { }); }); + describe('isFolderInfoAvailable', () => { + it('should return true if ACS version is equal to minimal version', () => { + expect(isFolderInfoAvailable(makeContext('25.1.0'))).toBe(true); + }); + + it('should return true if ACS version is greater than minimal version', () => { + expect(isFolderInfoAvailable(makeContext('25.2.0'))).toBe(true); + expect(isFolderInfoAvailable(makeContext('26.0.0'))).toBe(true); + }); + + it('should return false if ACS version is less than minimal version', () => { + expect(isFolderInfoAvailable(makeContext('22.0.0'))).toBe(false); + expect(isFolderInfoAvailable(makeContext('23.2.0'))).toBe(false); + }); + + it('should return false if ACS version is missing', () => { + expect(isFolderInfoAvailable(makeContext())).toBe(false); + expect(isFolderInfoAvailable({ repository: {} } as any)).toBe(false); + }); + }); + + describe('isBulkActionsAvailable', () => { + it('should return true if ACS version is equal to minimal version', () => { + expect(isBulkActionsAvailable(makeContext('25.1.0'))).toBe(true); + }); + + it('should return true if ACS version is greater than minimal version', () => { + expect(isBulkActionsAvailable(makeContext('25.2.0'))).toBe(true); + expect(isBulkActionsAvailable(makeContext('26.0.0'))).toBe(true); + }); + + it('should return false if ACS version is less than minimal version', () => { + expect(isBulkActionsAvailable(makeContext('22.0.0'))).toBe(false); + expect(isBulkActionsAvailable(makeContext('23.2.0'))).toBe(false); + }); + + it('should return false if ACS version is missing', () => { + expect(isBulkActionsAvailable(makeContext())).toBe(false); + expect(isBulkActionsAvailable({ repository: {} } as any)).toBe(false); + }); + }); + describe('createVersionRule', () => { it('should return true if version is equal to minimal version', () => { const rule = createVersionRule('25.1.0'); diff --git a/projects/aca-shared/rules/src/app.rules.ts b/projects/aca-shared/rules/src/app.rules.ts index a6f447a81..3868e73fc 100644 --- a/projects/aca-shared/rules/src/app.rules.ts +++ b/projects/aca-shared/rules/src/app.rules.ts @@ -489,6 +489,18 @@ export function canOpenWithOffice(context: AcaRuleContext): boolean { */ export const isSavedSearchAvailable = createVersionRule('25.1.0'); +/** + * Checks if folder info modal is supported by current ACS version. + * JSON ref: `isFolderInfoAvailable` + */ +export const isFolderInfoAvailable = createVersionRule('23.4.0'); + +/** + * Checks if bulk update feature for legal holds is supported by current ACS version. + * JSON ref: `isBulkActionsAvailable` + */ +export const isBulkActionsAvailable = createVersionRule('23.3.0'); + /** * Partially applies minimal version of a feature against a core compatibility evaluation. * @param minimalVersion The minimal version to check against.