mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACS-10421] Add support for legacy config.json based approach for saved-searches (#4863)
* [ACS-9166]: introduces saved searches context service * [ACS-9166]: migrates to context service * [ACS-9166]: fixes tests * [ACS-9166]: removes prev approach artifacts * [ACS-9166]: fixes falsy emissions form pipe * [ACS-9166]: adds reactive strategy option * [ACS-9166]: tests fixes * [ACS-9166]: minor fix
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
import * as app from './app.rules';
|
||||
import { createVersionRule, getFileExtension, isSavedSearchAvailable, isFolderInfoAvailable, isBulkActionsAvailable } from './app.rules';
|
||||
import { createVersionRule, getFileExtension, isPreferencesApiAvailable, 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';
|
||||
@@ -1219,24 +1219,24 @@ describe('Versions compatibility', () => {
|
||||
} as RuleContext;
|
||||
}
|
||||
|
||||
describe('isSavedSearchAvailable', () => {
|
||||
describe('isPreferencesApiAvailable', () => {
|
||||
it('should return true if ACS version is equal to minimal version', () => {
|
||||
expect(isSavedSearchAvailable(makeContext('25.1.0'))).toBe(true);
|
||||
expect(isPreferencesApiAvailable(makeContext('25.1.0'))).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true if ACS version is greater than minimal version', () => {
|
||||
expect(isSavedSearchAvailable(makeContext('25.2.0'))).toBe(true);
|
||||
expect(isSavedSearchAvailable(makeContext('26.0.0'))).toBe(true);
|
||||
expect(isPreferencesApiAvailable(makeContext('25.2.0'))).toBe(true);
|
||||
expect(isPreferencesApiAvailable(makeContext('26.0.0'))).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false if ACS version is less than minimal version', () => {
|
||||
expect(isSavedSearchAvailable(makeContext('24.4.0'))).toBe(false);
|
||||
expect(isSavedSearchAvailable(makeContext('25.0.9'))).toBe(false);
|
||||
expect(isPreferencesApiAvailable(makeContext('24.4.0'))).toBe(false);
|
||||
expect(isPreferencesApiAvailable(makeContext('25.0.9'))).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false if ACS version is missing', () => {
|
||||
expect(isSavedSearchAvailable(makeContext())).toBe(false);
|
||||
expect(isSavedSearchAvailable({ repository: {} } as any)).toBe(false);
|
||||
expect(isPreferencesApiAvailable(makeContext())).toBe(false);
|
||||
expect(isPreferencesApiAvailable({ repository: {} } as any)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -485,9 +485,9 @@ export function canOpenWithOffice(context: AcaRuleContext): boolean {
|
||||
|
||||
/**
|
||||
* Checks if user savedSearches are supported by current ACS version.
|
||||
* JSON ref: `isSavedSearchAvailable`
|
||||
* JSON ref: `isPreferencesApiAvailable`
|
||||
*/
|
||||
export const isSavedSearchAvailable = createVersionRule('25.1.0');
|
||||
export const isPreferencesApiAvailable = createVersionRule('25.1.0');
|
||||
|
||||
/**
|
||||
* Checks if folder info modal is supported by current ACS version.
|
||||
|
||||
Reference in New Issue
Block a user