mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[MNT-22574] Conditional AI Search (#2339)
* [MNT-22574] Support rules for search forms * * fix lints * Patch version increment Co-authored-by: dhrn <dharan.g@muraai.com>
This commit is contained in:
@@ -888,6 +888,11 @@ describe('AppExtensionService', () => {
|
||||
|
||||
describe('search', () => {
|
||||
beforeEach(() => {
|
||||
extensions.setEvaluators({
|
||||
visible: () => true,
|
||||
notVisible: () => false
|
||||
});
|
||||
|
||||
applyConfig({
|
||||
$id: 'test',
|
||||
$name: 'test',
|
||||
@@ -916,14 +921,25 @@ describe('AppExtensionService', () => {
|
||||
{
|
||||
id: 'app.search-1',
|
||||
order: 200,
|
||||
name: 'default',
|
||||
name: 'search extension 1',
|
||||
rules: {
|
||||
visible: 'visible'
|
||||
},
|
||||
default: false
|
||||
},
|
||||
{
|
||||
id: 'app.search-2',
|
||||
order: 200,
|
||||
name: 'default',
|
||||
name: 'search extension 2',
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
id: 'app.search-3',
|
||||
order: 300,
|
||||
name: 'search extension 3',
|
||||
rules: {
|
||||
visible: 'notVisible'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -939,6 +955,10 @@ describe('AppExtensionService', () => {
|
||||
it('should not load the disabled search extension', () => {
|
||||
expect(service.search.find(({ id }) => id === 'app.search-2')).toBe(undefined, 'disabled configuration shown in the result');
|
||||
});
|
||||
|
||||
it('should not load the not visible search extension', () => {
|
||||
expect(service.search.find(({ id }) => id === 'app.search-3')).toBe(undefined, 'not visible configuration shown in the result');
|
||||
});
|
||||
});
|
||||
|
||||
describe('rule disable', () => {
|
||||
|
Reference in New Issue
Block a user