]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: unable to set bool values to false when default is true 31941/head
authorRicardo Marques <rimarques@suse.com>
Tue, 19 Nov 2019 13:20:01 +0000 (13:20 +0000)
committerRicardo Marques <rimarques@suse.com>
Mon, 2 Dec 2019 14:19:37 +0000 (14:19 +0000)
Fixes: https://tracker.ceph.com/issues/41776
Signed-off-by: Ricardo Marques <rimarques@suse.com>
(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.

src/pybind/mgr/dashboard/controllers/cluster_configuration.py
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.ts

index dc3d1ab904056203fa3f456db44d7cf913469cd5..8401b09eef30fbef2c87cb5c72dcf46e2cd53e6c 100644 (file)
@@ -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:
index a32fb35151e1b609775704ff80bd21e7a33328ee..30acbc054ebf0d3ada07f8ab5c6dbc6823e1e832 100644 (file)
                *ngFor="let section of availSections">
             <div class="form-group"
                  *ngIf="type === 'bool'">
-              <div class="col-sm-offset-3 col-sm-9">
-                <div class="checkbox checkbox-primary">
-                  <input [id]="section"
-                         type="checkbox"
-                         [formControlName]="section">
-                  <label [for]="section">{{ section }}
-                  </label>
-                </div>
+              <label class="control-label col-sm-3"
+                     [for]="section">{{ section }}
+              </label>
+              <div class="col-sm-9">
+                <select id="pool"
+                        name="pool"
+                        class="form-control custom-select"
+                        [formControlName]="section">
+                  <option [ngValue]="null"
+                          i18n>-- Default --</option>
+                  <option [ngValue]="true"
+                          i18n>true</option>
+                  <option [ngValue]="false"
+                          i18n>false</option>
+                </select>
               </div>
             </div>
             <div class="form-group"
index 0c05f1fc410ccca49bf76f4a9ab8270f210112a2..d17888d4ae206d47187ae9134e350c595aa87374 100644 (file)
@@ -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 });
       }
     });