From: Ricardo Marques Date: Tue, 19 Nov 2019 13:20:01 +0000 (+0000) Subject: mgr/dashboard: unable to set bool values to false when default is true X-Git-Tag: v14.2.8~20^2~12^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=def67fc52b95826745b2c28dc540c556eeef956d;p=ceph.git 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. --- diff --git a/src/pybind/mgr/dashboard/controllers/cluster_configuration.py b/src/pybind/mgr/dashboard/controllers/cluster_configuration.py index dc3d1ab90405..8401b09eef30 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 a32fb35151e1..30acbc054ebf 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 }); } });