Skip to content

Commit 1b77bae

Browse files
committed
mgr/dashboard: fix snap schedule list toggle cols
Added isInvisible property to CdColumnTable interface to hide column from 'toggle columns' drop down checkboxes. Fixes: https://tracker.ceph.com/issues/64813 Signed-off-by: Ivo Almeida <[email protected]>
1 parent abd34b6 commit 1b77bae

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-list/cephfs-snapshotschedule-list.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ export class CephfsSnapshotscheduleListComponent
143143

144144
this.columns = [
145145
{ prop: 'pathForSelection', name: $localize`Path`, flexGrow: 3, cellTemplate: this.pathTpl },
146-
{ prop: 'path', isHidden: true },
146+
{ prop: 'path', isHidden: true, isInvisible: true },
147147
{ prop: 'subvol', name: $localize`Subvolume`, cellTemplate: this.subvolTpl },
148148
{ prop: 'scheduleCopy', name: $localize`Repeat interval` },
149-
{ prop: 'schedule', isHidden: true },
149+
{ prop: 'schedule', isHidden: true, isInvisible: true },
150150
{ prop: 'retentionCopy', name: $localize`Retention policy`, cellTemplate: this.retentionTpl },
151-
{ prop: 'retention', isHidden: true },
151+
{ prop: 'retention', isHidden: true, isInvisible: true },
152152
{ prop: 'created_count', name: $localize`Created Count` },
153153
{ prop: 'pruned_count', name: $localize`Deleted Count` },
154154
{ prop: 'start', name: $localize`Start time`, cellTransformation: CellTemplate.timeAgo },

src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,10 @@
103103
</button>
104104
<div ngbDropdownMenu>
105105
<ng-container *ngFor="let column of columns">
106-
<button ngbDropdownItem
107-
*ngIf="column.name !== ''"
108-
(click)="toggleColumn(column); false;">
106+
<ng-container *ngIf="!column?.isInvisible">
107+
<button ngbDropdownItem
108+
*ngIf="column.name !== ''"
109+
(click)="toggleColumn(column); false;">
109110
<div class="custom-control custom-checkbox py-0">
110111
<input class="custom-control-input"
111112
type="checkbox"
@@ -116,6 +117,7 @@
116117
for="{{ column.prop }}{{ tableName }}">{{ column.name }}</label>
117118
</div>
118119
</button>
120+
</ng-container>
119121
</ng-container>
120122
</div>
121123
</div>

src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-table-column.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,9 @@ export interface CdTableColumn extends TableColumn {
3535
* a customize function if that's not desired. Return true to include a row.
3636
*/
3737
filterPredicate?: (row: any, value: any) => boolean;
38+
39+
/**
40+
* Hides a column from the 'toggle columns' drop down checkboxes
41+
*/
42+
isInvisible?: boolean;
3843
}

0 commit comments

Comments
 (0)