From: Sarthak0702 Date: Wed, 6 Apr 2022 00:53:35 +0000 (+0530) Subject: mgr/dashboard: datatable in Cluster Host page hides wrong column on selection X-Git-Tag: v18.0.0~1093^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F45790%2Fhead;p=ceph.git mgr/dashboard: datatable in Cluster Host page hides wrong column on selection Signed-off-by: Sarthak0702 --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts index 36bcf8ec8f04..f7df997c37b0 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts @@ -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; } } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts index a2a329ab6456..98ed0bf63a16 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts @@ -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(); });