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: v15.1.0~812^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e2922148aed9da3576824b30e2b689f813437ae;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 --- diff --git a/src/pybind/mgr/dashboard/controllers/cluster_configuration.py b/src/pybind/mgr/dashboard/controllers/cluster_configuration.py index 1aff63f772354..810adf3334484 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 94ba92f099a54..4ced34d15e9b9 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 0c05f1fc410cc..d17888d4ae206 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 }); } });