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