]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix snap schedule list toggle cols 56115/head
authorIvo Almeida <ialmeida@redhat.com>
Fri, 8 Mar 2024 11:40:41 +0000 (11:40 +0000)
committerIvo Almeida <ialmeida@redhat.com>
Mon, 11 Mar 2024 11:37:13 +0000 (11:37 +0000)
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 <ialmeida@redhat.com>
(cherry picked from commit 1b77baea8dd0781fa897ec6c1f1e06c57a265ed7)

src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-list/cephfs-snapshotschedule-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-table-column.ts

index ecc2036d5dd3a4743a9f1402738b89b86366ddef..f6f372dcffc4ea8658e3f9e17e9062038d338196 100644 (file)
@@ -143,12 +143,12 @@ export class CephfsSnapshotscheduleListComponent
 
     this.columns = [
       { prop: 'pathForSelection', name: $localize`Path`, flexGrow: 3, cellTemplate: this.pathTpl },
-      { prop: 'path', isHidden: true },
+      { prop: 'path', isHidden: true, isInvisible: true },
       { prop: 'subvol', name: $localize`Subvolume`, cellTemplate: this.subvolTpl },
       { prop: 'scheduleCopy', name: $localize`Repeat interval` },
-      { prop: 'schedule', isHidden: true },
+      { prop: 'schedule', isHidden: true, isInvisible: true },
       { prop: 'retentionCopy', name: $localize`Retention policy`, cellTemplate: this.retentionTpl },
-      { prop: 'retention', isHidden: true },
+      { prop: 'retention', isHidden: true, isInvisible: true },
       { prop: 'created_count', name: $localize`Created Count` },
       { prop: 'pruned_count', name: $localize`Deleted Count` },
       { prop: 'start', name: $localize`Start time`, cellTransformation: CellTemplate.timeAgo },
index 01cc1fbc8d92d01995340e976e2661020ce001f6..f977273b0cf648764de2e3fba252fee65c4b7ec1 100644 (file)
         </button>
         <div ngbDropdownMenu>
           <ng-container *ngFor="let column of columns">
-            <button ngbDropdownItem
-                    *ngIf="column.name !== ''"
-                    (click)="toggleColumn(column); false;">
+            <ng-container *ngIf="!column?.isInvisible">
+              <button ngbDropdownItem
+                      *ngIf="column.name !== ''"
+                      (click)="toggleColumn(column); false;">
               <div class="custom-control custom-checkbox py-0">
                 <input class="custom-control-input"
                        type="checkbox"
                        for="{{ column.prop }}{{ tableName }}">{{ column.name }}</label>
               </div>
             </button>
+            </ng-container>
           </ng-container>
         </div>
       </div>
index 4ed5fdd588fe4ddaadf51b92875699e49f9b8dc8..e81eeb14490b20916acc9ae3e2c70ddfa1511354 100644 (file)
@@ -35,4 +35,9 @@ export interface CdTableColumn extends TableColumn {
    * a customize function if that's not desired. Return true to include a row.
    */
   filterPredicate?: (row: any, value: any) => boolean;
+
+  /**
+   * Hides a column from the 'toggle columns' drop down checkboxes
+   */
+  isInvisible?: boolean;
 }