]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: datatable in Cluster Host page hides wrong column on selection 45861/head
authorSarthak0702 <sarthak.dev.0702@gmail.com>
Wed, 6 Apr 2022 00:53:35 +0000 (06:23 +0530)
committerSarthak0702 <sarthak.dev.0702@gmail.com>
Mon, 11 Apr 2022 19:36:28 +0000 (01:06 +0530)
Signed-off-by: Sarthak0702 <sarthak.dev.0702@gmail.com>
(cherry picked from commit 3fe39de706dcefe0a83bac1c2c1bca24a678c176)

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 dfdcd8edef403ca26f4fa320bde45c8a74f681e0..71e7d92350f6a7ea2129acbffebc1dc331c74aa2 100644 (file)
@@ -470,7 +470,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();
     });