]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: unable to set bool values to false when default is true 31738/head
authorRicardo Marques <rimarques@suse.com>
Tue, 19 Nov 2019 13:20:01 +0000 (13:20 +0000)
committerRicardo Marques <rimarques@suse.com>
Tue, 19 Nov 2019 16:18:53 +0000 (16:18 +0000)
Fixes: https://tracker.ceph.com/issues/41776
Signed-off-by: Ricardo Marques <rimarques@suse.com>
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 1aff63f772354d6476546425f7ea6aab2f330801..810adf333448434e3ed7e2fec08daa7846ce49b8 100644 (file)
@@ -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:
index 94ba92f099a54fa717a41a8a3f7bcf9f286e2758..4ced34d15e9b90af623c6d0066fa4573d0986fa5 100644 (file)
           <ng-container *ngFor="let section of availSections">
             <div class="form-group row"
                  *ngIf="type === 'bool'">
-              <div class="offset-sm-3 col-sm-9">
-                <div class="custom-control custom-checkbox">
-                  <input type="checkbox"
-                         class="custom-control-input"
-                         [id]="section"
-                         [formControlName]="section">
-                  <label class="custom-control-label"
-                         [for]="section">{{ section }}
-                  </label>
-                </div>
+              <label class="col-form-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>
 
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 });
       }
     });