[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
This commit is contained in:
rmnvch
2025-09-10 06:27:42 +02:00
committed by GitHub
parent 74448ac12e
commit 8227f311c3
6 changed files with 65 additions and 5 deletions

View File

@@ -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 |
| 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 |

View File

@@ -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"
]
}
},

View File

@@ -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,

View File

@@ -5,7 +5,7 @@
[agentId]="searchAiInputState.selectedAgentId" />
<div class="aca-header-container">
<aca-search-input />
<aca-bulk-actions-dropdown *ngIf="bulkActions" [items]="bulkActions" />
<aca-bulk-actions-dropdown *ngIf="bulkActions && ('isBulkActionsAvailable' | isFeatureSupportedInCurrentAcs | async)" [items]="bulkActions" />
<div class="aca-search-toolbar-spacer"></div>
<aca-toolbar [items]="actions" />
</div>

View File

@@ -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');

View File

@@ -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.