Skip to content

Commit 8227f31

Browse files
authored
[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
1 parent 74448ac commit 8227f31

File tree

6 files changed

+65
-5
lines changed

6 files changed

+65
-5
lines changed

docs/extending/rules-list.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,6 @@ Rules/Evaluators created for specific features in ADW to be checked if supported
8282

8383
| Version | Key | Description |
8484
|---------|---------------------------------|---------------------------------------------------------------------------|
85-
| 8.1.0 | isSavedSearchAvailable | Checks whether current ACS version supports PUT method in Preferences API |
85+
| 8.1.0 | isSavedSearchAvailable | Checks whether current ACS version supports PUT method in Preferences API |
86+
| 8.1.0 | isFolderInfoAvailable | Checks whether current ACS version supports folder size calculation API |
87+
| 8.1.0 | isBulkActionsAvailable | Checks whether current ACS version supports bulk update feature |

projects/aca-content/assets/app.extensions.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,8 @@
688688
"rules": {
689689
"visible": [
690690
"app.selection.folder",
691-
"!app.navigation.isTrashcan"
691+
"!app.navigation.isTrashcan",
692+
"isFolderInfoAvailable"
692693
]
693694
}
694695
},
@@ -1021,7 +1022,8 @@
10211022
"rules": {
10221023
"visible": [
10231024
"app.selection.folder",
1024-
"!app.navigation.isTrashcan"
1025+
"!app.navigation.isTrashcan",
1026+
"isFolderInfoAvailable"
10251027
]
10261028
}
10271029
},

projects/aca-content/src/lib/aca-content.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ import { SaveSearchSidenavComponent } from './components/search/search-save/side
135135
isMultiSelection: rules.isMultiselection,
136136
canPrintFile: rules.canPrintFile,
137137
isSavedSearchAvailable: rules.isSavedSearchAvailable,
138+
isFolderInfoAvailable: rules.isFolderInfoAvailable,
139+
isBulkActionsAvailable: rules.isBulkActionsAvailable,
138140

139141
'app.selection.canDelete': rules.canDeleteSelection,
140142
'app.selection.canDownload': rules.canDownloadSelection,

projects/aca-content/src/lib/components/search/search-results/search-results.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[agentId]="searchAiInputState.selectedAgentId" />
66
<div class="aca-header-container">
77
<aca-search-input />
8-
<aca-bulk-actions-dropdown *ngIf="bulkActions" [items]="bulkActions" />
8+
<aca-bulk-actions-dropdown *ngIf="bulkActions && ('isBulkActionsAvailable' | isFeatureSupportedInCurrentAcs | async)" [items]="bulkActions" />
99
<div class="aca-search-toolbar-spacer"></div>
1010
<aca-toolbar [items]="actions" />
1111
</div>

projects/aca-shared/rules/src/app.rules.spec.ts

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424

2525
import * as app from './app.rules';
26-
import { createVersionRule, getFileExtension, isSavedSearchAvailable } from './app.rules';
26+
import { createVersionRule, getFileExtension, isSavedSearchAvailable, isFolderInfoAvailable, isBulkActionsAvailable } from './app.rules';
2727
import { TestRuleContext } from './test-rule-context';
2828
import { NodeEntry, RepositoryInfo, StatusInfo } from '@alfresco/js-api';
2929
import { ProfileState, RuleContext } from '@alfresco/adf-extensions';
@@ -1228,6 +1228,48 @@ describe('Versions compatibility', () => {
12281228
});
12291229
});
12301230

1231+
describe('isFolderInfoAvailable', () => {
1232+
it('should return true if ACS version is equal to minimal version', () => {
1233+
expect(isFolderInfoAvailable(makeContext('25.1.0'))).toBe(true);
1234+
});
1235+
1236+
it('should return true if ACS version is greater than minimal version', () => {
1237+
expect(isFolderInfoAvailable(makeContext('25.2.0'))).toBe(true);
1238+
expect(isFolderInfoAvailable(makeContext('26.0.0'))).toBe(true);
1239+
});
1240+
1241+
it('should return false if ACS version is less than minimal version', () => {
1242+
expect(isFolderInfoAvailable(makeContext('22.0.0'))).toBe(false);
1243+
expect(isFolderInfoAvailable(makeContext('23.2.0'))).toBe(false);
1244+
});
1245+
1246+
it('should return false if ACS version is missing', () => {
1247+
expect(isFolderInfoAvailable(makeContext())).toBe(false);
1248+
expect(isFolderInfoAvailable({ repository: {} } as any)).toBe(false);
1249+
});
1250+
});
1251+
1252+
describe('isBulkActionsAvailable', () => {
1253+
it('should return true if ACS version is equal to minimal version', () => {
1254+
expect(isBulkActionsAvailable(makeContext('25.1.0'))).toBe(true);
1255+
});
1256+
1257+
it('should return true if ACS version is greater than minimal version', () => {
1258+
expect(isBulkActionsAvailable(makeContext('25.2.0'))).toBe(true);
1259+
expect(isBulkActionsAvailable(makeContext('26.0.0'))).toBe(true);
1260+
});
1261+
1262+
it('should return false if ACS version is less than minimal version', () => {
1263+
expect(isBulkActionsAvailable(makeContext('22.0.0'))).toBe(false);
1264+
expect(isBulkActionsAvailable(makeContext('23.2.0'))).toBe(false);
1265+
});
1266+
1267+
it('should return false if ACS version is missing', () => {
1268+
expect(isBulkActionsAvailable(makeContext())).toBe(false);
1269+
expect(isBulkActionsAvailable({ repository: {} } as any)).toBe(false);
1270+
});
1271+
});
1272+
12311273
describe('createVersionRule', () => {
12321274
it('should return true if version is equal to minimal version', () => {
12331275
const rule = createVersionRule('25.1.0');

projects/aca-shared/rules/src/app.rules.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,18 @@ export function canOpenWithOffice(context: AcaRuleContext): boolean {
489489
*/
490490
export const isSavedSearchAvailable = createVersionRule('25.1.0');
491491

492+
/**
493+
* Checks if folder info modal is supported by current ACS version.
494+
* JSON ref: `isFolderInfoAvailable`
495+
*/
496+
export const isFolderInfoAvailable = createVersionRule('23.4.0');
497+
498+
/**
499+
* Checks if bulk update feature for legal holds is supported by current ACS version.
500+
* JSON ref: `isBulkActionsAvailable`
501+
*/
502+
export const isBulkActionsAvailable = createVersionRule('23.3.0');
503+
492504
/**
493505
* Partially applies minimal version of a feature against a core compatibility evaluation.
494506
* @param minimalVersion The minimal version to check against.

0 commit comments

Comments
 (0)