From: Daniel Persson Date: Sun, 6 Mar 2022 13:02:13 +0000 (+0100) Subject: mgr/dashboard: switch the columns on and off correctly. X-Git-Tag: v15.2.17~32^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=864e363c43988a0a4bfc9e08aabe38de381310d8;p=ceph.git mgr/dashboard: switch the columns on and off correctly. Fixing the table model so it we can switch the columns on and off correctly. A bug in the function tranfering the user configured columns made them not tranfer over to the local displayed column list. Fixes: http://tracker.ceph.com/issues/51119 Signed-off-by: Daniel Persson (cherry picked from commit 7ea0eb723676b3670c9dad90a3cdd1650a5b710a) Conflicts: src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts - Renamed localColumn to column --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts index 002a53a8e1c..56f441050e9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts @@ -312,8 +312,12 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O if (!this.userConfig.columns) { this.updateUserColumns(); } else { - this.columns.forEach((c, i) => { - c.isHidden = this.userConfig.columns[i].isHidden; + this.userConfig.columns.forEach((col) => { + for (let i = 0; i < this.columns.length; i++) { + if (this.columns[i].prop === col.prop) { + this.columns[i].isHidden = col.isHidden; + } + } }); } }