Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterSmallenbroek committed Jan 21, 2025
1 parent 4fea7d7 commit 617328c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<app-query-table-column-management
[columns]="columns()"
[(visibleColumns)]="visibleColumns"
(resetColumnVisibility)="resetColumnVisibility(true)"
(resetColumnVisibility)="updateColumnVisibility(true)"
[selectedColumnsStateKey]="selectedColumnsStateKey()"
/>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,14 +501,14 @@ export class QueryTableComponent<TData extends { id: PropertyKey }, TContext> {
): QueryTableColumn<TData>[] {
return storedColumns
.map((column) => this.columns().find((c) => c.field === column.field))
.filter(Boolean) as QueryTableColumn<TData>[];
.filter((column) => column !== undefined);
}

private getDefaultColumns(): QueryTableColumn<TData>[] {
return this.columns().filter((column) => !column.defaultHidden);
}

resetColumnVisibility(revertToDefault = false): void {
updateColumnVisibility(revertToDefault = false): void {
const stateKey = this.selectedColumnsStateKey();
if (!stateKey) {
this.visibleColumns.set(this.getDefaultColumns());
Expand All @@ -534,7 +534,7 @@ export class QueryTableComponent<TData extends { id: PropertyKey }, TContext> {
(!this.enableColumnManagement() || this.visibleColumns().length === 0) &&
this.columns().length > 0
) {
this.resetColumnVisibility();
this.updateColumnVisibility();
}
});
}

0 comments on commit 617328c

Please sign in to comment.