From 3e2922148aed9da3576824b30e2b689f813437ae 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 --- .../controllers/cluster_configuration.py | 2 +- .../configuration-form.component.html | 25 +++++++++++-------- .../configuration-form.component.ts | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/pybind/mgr/dashboard/controllers/cluster_configuration.py b/src/pybind/mgr/dashboard/controllers/cluster_configuration.py index 1aff63f7723..810adf33344 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 avail_sections: 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 94ba92f099a..4ced34d15e9 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 @@ -98,16 +98,21 @@
-
-
- - -
+ +
+
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.ts index 0c05f1fc410..d17888d4ae2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.ts @@ -135,7 +135,7 @@ export class ConfigurationFormComponent implements OnInit { this.availSections.forEach((section) => { const sectionValue = this.configForm.getValue(section); - if (sectionValue) { + if (sectionValue !== null && sectionValue !== '') { values.push({ section: section, value: sectionValue }); } }); -- 2.39.5