mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
filter children by rule (#735)
This commit is contained in:
committed by
Denys Vuika
parent
3bf9cc1fb2
commit
061836d217
@@ -360,7 +360,26 @@ export class AppExtensionService implements RuleContext {
|
||||
}
|
||||
|
||||
getAllowedContextMenuActions(): Array<ContentActionRef> {
|
||||
return this.contextMenuActions.filter(action => this.filterByRules(action));
|
||||
return this.contextMenuActions
|
||||
.filter(action => this.filterByRules(action))
|
||||
.map(action => {
|
||||
if (action.type === ContentActionType.menu) {
|
||||
if (action.type === ContentActionType.menu) {
|
||||
const copy = this.copyAction(action);
|
||||
if (copy.children && copy.children.length > 0) {
|
||||
copy.children = copy.children
|
||||
.filter(childAction => this.filterByRules(childAction))
|
||||
.reduce(reduceSeparators, []);
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
return action;
|
||||
} else {
|
||||
return action;
|
||||
}
|
||||
})
|
||||
.reduce(reduceEmptyMenus, [])
|
||||
.reduce(reduceSeparators, []);
|
||||
}
|
||||
|
||||
copyAction(action: ContentActionRef): ContentActionRef {
|
||||
|
Reference in New Issue
Block a user