mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-01 14:41:32 +00:00
[ADF-4893] Fix visibility condition in datatable action menu (#5088)
* [ADF-4893] Fix visibility condition in datatable action menu * Add filtering for when menu cache is disabled * Fix unit test and improve code * Fix linting * Fix linting * Add missing return type
This commit is contained in:
committed by
Eugenio Romano
parent
1d7ef62095
commit
47ec01555a
@@ -568,12 +568,16 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
||||
const event = new DataCellEvent(row, col, []);
|
||||
this.showRowActionsMenu.emit(event);
|
||||
if (!this.rowMenuCacheEnabled) {
|
||||
return event.value.actions;
|
||||
return this.getVisibleActions(event.value.actions);
|
||||
}
|
||||
this.rowMenuCache[id] = event.value.actions;
|
||||
}
|
||||
|
||||
return this.rowMenuCache[id];
|
||||
return this.getVisibleActions(this.rowMenuCache[id]);
|
||||
}
|
||||
|
||||
getVisibleActions(actions: any[]): any[] {
|
||||
return actions.filter((action) => action.visible || action.visible === undefined);
|
||||
}
|
||||
|
||||
onExecuteRowAction(row: DataRow, action: any) {
|
||||
|
Reference in New Issue
Block a user