mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-10 14:11:17 +00:00
[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:
@@ -83,3 +83,5 @@ Rules/Evaluators created for specific features in ADW to be checked if supported
|
|||||||
| Version | Key | Description |
|
| 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 |
|
@@ -688,7 +688,8 @@
|
|||||||
"rules": {
|
"rules": {
|
||||||
"visible": [
|
"visible": [
|
||||||
"app.selection.folder",
|
"app.selection.folder",
|
||||||
"!app.navigation.isTrashcan"
|
"!app.navigation.isTrashcan",
|
||||||
|
"isFolderInfoAvailable"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1021,7 +1022,8 @@
|
|||||||
"rules": {
|
"rules": {
|
||||||
"visible": [
|
"visible": [
|
||||||
"app.selection.folder",
|
"app.selection.folder",
|
||||||
"!app.navigation.isTrashcan"
|
"!app.navigation.isTrashcan",
|
||||||
|
"isFolderInfoAvailable"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -135,6 +135,8 @@ import { SaveSearchSidenavComponent } from './components/search/search-save/side
|
|||||||
isMultiSelection: rules.isMultiselection,
|
isMultiSelection: rules.isMultiselection,
|
||||||
canPrintFile: rules.canPrintFile,
|
canPrintFile: rules.canPrintFile,
|
||||||
isSavedSearchAvailable: rules.isSavedSearchAvailable,
|
isSavedSearchAvailable: rules.isSavedSearchAvailable,
|
||||||
|
isFolderInfoAvailable: rules.isFolderInfoAvailable,
|
||||||
|
isBulkActionsAvailable: rules.isBulkActionsAvailable,
|
||||||
|
|
||||||
'app.selection.canDelete': rules.canDeleteSelection,
|
'app.selection.canDelete': rules.canDeleteSelection,
|
||||||
'app.selection.canDownload': rules.canDownloadSelection,
|
'app.selection.canDownload': rules.canDownloadSelection,
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
[agentId]="searchAiInputState.selectedAgentId" />
|
[agentId]="searchAiInputState.selectedAgentId" />
|
||||||
<div class="aca-header-container">
|
<div class="aca-header-container">
|
||||||
<aca-search-input />
|
<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>
|
<div class="aca-search-toolbar-spacer"></div>
|
||||||
<aca-toolbar [items]="actions" />
|
<aca-toolbar [items]="actions" />
|
||||||
</div>
|
</div>
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import * as app from './app.rules';
|
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 { TestRuleContext } from './test-rule-context';
|
||||||
import { NodeEntry, RepositoryInfo, StatusInfo } from '@alfresco/js-api';
|
import { NodeEntry, RepositoryInfo, StatusInfo } from '@alfresco/js-api';
|
||||||
import { ProfileState, RuleContext } from '@alfresco/adf-extensions';
|
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', () => {
|
describe('createVersionRule', () => {
|
||||||
it('should return true if version is equal to minimal version', () => {
|
it('should return true if version is equal to minimal version', () => {
|
||||||
const rule = createVersionRule('25.1.0');
|
const rule = createVersionRule('25.1.0');
|
||||||
|
@@ -489,6 +489,18 @@ export function canOpenWithOffice(context: AcaRuleContext): boolean {
|
|||||||
*/
|
*/
|
||||||
export const isSavedSearchAvailable = createVersionRule('25.1.0');
|
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.
|
* Partially applies minimal version of a feature against a core compatibility evaluation.
|
||||||
* @param minimalVersion The minimal version to check against.
|
* @param minimalVersion The minimal version to check against.
|
||||||
|
Reference in New Issue
Block a user