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: v17.2.1~70^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=277d85ecacd5c5fd5049170ff4b4ff904eef5b69;p=ceph.git mgr/dashboard: datatable in Cluster Host page hides wrong column on selection Signed-off-by: Sarthak0702 (cherry picked from commit 3fe39de706dcefe0a83bac1c2c1bca24a678c176) --- 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 dfdcd8edef40..71e7d92350f6 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 @@ -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; } } 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(); });