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', () => {
|
||||
|
@@ -239,11 +239,13 @@ export class AppExtensionService implements AppRuleContext {
|
||||
return {
|
||||
...group,
|
||||
items: (group.items || [])
|
||||
.filter(entry => !entry.disabled)
|
||||
.filter(item => this.filterByRules(item))
|
||||
.sort(sortByOrder)
|
||||
.map(item => {
|
||||
if (item.children && item.children.length > 0) {
|
||||
item.children = item.children
|
||||
.filter(entry => !entry.disabled)
|
||||
.filter(child => this.filterByRules(child))
|
||||
.sort(sortByOrder)
|
||||
.map(child => {
|
||||
|
Reference in New Issue
Block a user