mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2503] conditional visibility for content actions (#3325)
* conditional visibility for content actions * fix typo * workaround for "target: all"
This commit is contained in:
committed by
Eugenio Romano
parent
7154eb1e84
commit
d67f160fdc
@@ -434,9 +434,15 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
}
|
||||
|
||||
if (target) {
|
||||
let actionsByTarget = this.actions.filter(entry => {
|
||||
return entry.target.toLowerCase() === target;
|
||||
}).map(action => new ContentActionModel(action));
|
||||
let actionsByTarget = this.actions
|
||||
.filter(entry => {
|
||||
const isVisible = (typeof entry.visible === 'function')
|
||||
? entry.visible(node)
|
||||
: entry.visible;
|
||||
|
||||
return isVisible && entry.target.toLowerCase() === target;
|
||||
})
|
||||
.map(action => new ContentActionModel(action));
|
||||
|
||||
actionsByTarget.forEach((action) => {
|
||||
this.disableActionsWithNoPermissions(node, action);
|
||||
|
Reference in New Issue
Block a user