]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: datatable in Cluster Host page hides wrong column on selection 45790/head
authorSarthak0702 <sarthak.dev.0702@gmail.com>
Wed, 6 Apr 2022 00:53:35 +0000 (06:23 +0530)
committerSarthak0702 <sarthak.dev.0702@gmail.com>
Thu, 7 Apr 2022 18:48:53 +0000 (00:18 +0530)
Signed-off-by: Sarthak0702 <sarthak.dev.0702@gmail.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts

index 36bcf8ec8f0469088c48c4c30a1ddfb4ec8acce1..f7df997c37b0d04a77acd01a4207463b7b6557e2 100644 (file)
@@ -474,7 +474,6 @@ export class HostsComponent extends ListWithDetails implements OnDestroy, OnInit
     } else {
       // mark host facts columns unavailable
       for (let column = 4; column < this.columns.length; column++) {
-        this.columns[column]['prop'] = '';
         this.columns[column]['cellTemplate'] = this.orchTmpl;
       }
     }
index a2a329ab645646a4c7a32a5dfbcab66a1a1bb97a..98ed0bf63a164652309f770e289fc3e22344a2f1 100644 (file)
@@ -513,6 +513,15 @@ describe('TableComponent', () => {
       equalStorageConfig();
     });
 
+    it('should toggle on off columns', () => {
+      for (const column of component.columns) {
+        component.toggleColumn(column);
+        expect(column.isHidden).toBeTruthy();
+        component.toggleColumn(column);
+        expect(column.isHidden).toBeFalsy();
+      }
+    });
+
     afterEach(() => {
       clearLocalStorage();
     });