mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2859] conditional evaluation of disabled state for content actions (#3450)
* react on [disabled] binding changes * [disabled] binding updates for context menu items * evaluating disabled state with a function * unit test * restore original description * remove irrelevant test * fix tests
This commit is contained in:
committed by
Eugenio Romano
parent
08fd49c4e3
commit
cb88a22a76
@@ -23,7 +23,7 @@ export class ContentActionModel {
|
||||
target: string;
|
||||
permission: string;
|
||||
disableWithNoPermission: boolean = false;
|
||||
disabled: boolean = false;
|
||||
disabled: boolean | Function = false;
|
||||
visible: boolean | Function = true;
|
||||
|
||||
constructor(obj?: any) {
|
||||
@@ -35,7 +35,10 @@ export class ContentActionModel {
|
||||
this.target = obj.target;
|
||||
this.permission = obj.permission;
|
||||
this.disableWithNoPermission = obj.disableWithNoPermission;
|
||||
this.disabled = obj.disabled;
|
||||
|
||||
if (obj.hasOwnProperty('disabled')) {
|
||||
this.disabled = obj.disabled;
|
||||
}
|
||||
|
||||
if (obj.hasOwnProperty('visible')) {
|
||||
this.visible = obj.visible;
|
||||
|
Reference in New Issue
Block a user