mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
menu filter disabled items (#1009)
This commit is contained in:
committed by
Denys Vuika
parent
fedb6edf84
commit
675d57c7e3
@@ -682,6 +682,18 @@ describe('AppExtensionService', () => {
|
|||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should filter out disabled items', () => {
|
||||||
|
const navigation = service.getApplicationNavigation([
|
||||||
|
{ items: [{ route: 'route1' }, { route: 'route2', disabled: true }] },
|
||||||
|
{ items: [{ children: [{ route: 'route3', disabled: true }] }] }
|
||||||
|
]);
|
||||||
|
|
||||||
|
expect(navigation).toEqual([
|
||||||
|
{ items: [{ route: 'route1', url: '/route1' }] },
|
||||||
|
{ items: [{ children: [] }] }
|
||||||
|
]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getSharedLinkViewerToolbarActions', () => {
|
describe('getSharedLinkViewerToolbarActions', () => {
|
||||||
|
@@ -239,11 +239,13 @@ export class AppExtensionService implements AppRuleContext {
|
|||||||
return {
|
return {
|
||||||
...group,
|
...group,
|
||||||
items: (group.items || [])
|
items: (group.items || [])
|
||||||
|
.filter(entry => !entry.disabled)
|
||||||
.filter(item => this.filterByRules(item))
|
.filter(item => this.filterByRules(item))
|
||||||
.sort(sortByOrder)
|
.sort(sortByOrder)
|
||||||
.map(item => {
|
.map(item => {
|
||||||
if (item.children && item.children.length > 0) {
|
if (item.children && item.children.length > 0) {
|
||||||
item.children = item.children
|
item.children = item.children
|
||||||
|
.filter(entry => !entry.disabled)
|
||||||
.filter(child => this.filterByRules(child))
|
.filter(child => this.filterByRules(child))
|
||||||
.sort(sortByOrder)
|
.sort(sortByOrder)
|
||||||
.map(child => {
|
.map(child => {
|
||||||
|
Reference in New Issue
Block a user