mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-7817] Add columns selector for processes and tasks tasks (#7612)
* [AAE-7817] Add columns selector for processes and tasks tasks * cr * Update * fix unit tests * preserve order while sorting * add input toggle to show main actions * fix test
This commit is contained in:
@@ -38,8 +38,7 @@ export abstract class DataTableSchema {
|
||||
protected columnsOrder: string[] | undefined;
|
||||
protected columnsOrderedByKey: string = 'id';
|
||||
|
||||
protected hiddenColumns: string[] | undefined;
|
||||
protected hiddenColumnsKey: string = 'id';
|
||||
protected columnsVisibility: { [columnId: string]: boolean } | undefined;
|
||||
|
||||
private layoutPresets = {};
|
||||
|
||||
@@ -133,14 +132,13 @@ export abstract class DataTableSchema {
|
||||
}
|
||||
|
||||
private setHiddenColumns(columns: DataColumn[]): DataColumn[] {
|
||||
if (this.hiddenColumns) {
|
||||
if (this.columnsVisibility) {
|
||||
return columns.map(column => {
|
||||
const columnShouldBeHidden = this.hiddenColumns.includes(column[this.hiddenColumnsKey]);
|
||||
const isColumnVisible = this.columnsVisibility[column.id];
|
||||
|
||||
return {
|
||||
...column,
|
||||
isHidden: columnShouldBeHidden
|
||||
};
|
||||
return isColumnVisible === undefined ?
|
||||
column :
|
||||
{ ...column, isHidden: !isColumnVisible };
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user