From def67fc52b95826745b2c28dc540c556eeef956d Mon Sep 17 00:00:00 2001 From: Ricardo Marques Date: Tue, 19 Nov 2019 13:20:01 +0000 Subject: [PATCH] mgr/dashboard: unable to set bool values to false when default is true Fixes: https://tracker.ceph.com/issues/41776 Signed-off-by: Ricardo Marques (cherry picked from commit 3e2922148aed9da3576824b30e2b689f813437ae) Conflicts: src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.html Conflicts caused by "Master" using Bootstrap 4, but "Nautilus" using Bootstap 3. --- .../controllers/cluster_configuration.py | 2 +- .../configuration-form.component.html | 23 ++++++++++++------- .../configuration-form.component.ts | 2 +- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/pybind/mgr/dashboard/controllers/cluster_configuration.py b/src/pybind/mgr/dashboard/controllers/cluster_configuration.py index dc3d1ab9040..8401b09eef3 100644 --- a/src/pybind/mgr/dashboard/controllers/cluster_configuration.py +++ b/src/pybind/mgr/dashboard/controllers/cluster_configuration.py @@ -63,7 +63,7 @@ class ClusterConfiguration(RESTController): for section in availSections: for entry in value: - if not entry['value']: + if entry['value'] is None: break if entry['section'] == section: diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.html index a32fb35151e..30acbc054eb 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.html @@ -103,14 +103,21 @@ *ngFor="let section of availSections">
-
-
- - -
+ +
+
{ const sectionValue = this.configForm.getValue(section); - if (sectionValue) { + if (sectionValue !== null && sectionValue !== '') { values.push({ section: section, value: sectionValue }); } }); -- 2.47.3