]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: remove dead code
authorPatrick Seidensal <pseidensal@suse.com>
Thu, 12 Sep 2019 10:52:48 +0000 (12:52 +0200)
committerPatrick Seidensal <pseidensal@suse.com>
Mon, 23 Sep 2019 12:19:45 +0000 (14:19 +0200)
Signed-off-by: Patrick Seidensal <pseidensal@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts

index ae525d53365543b2922440f7d9a4532bd99d2de0..71424b84e99b168c17f74b14cdb2b7e6564e43e5 100644 (file)
@@ -35,31 +35,27 @@ export class MgrModuleFormComponent implements OnInit {
   ) {}
 
   ngOnInit() {
-    this.route.params.subscribe(
-      (params: { name: string }) => {
-        this.moduleName = decodeURIComponent(params.name);
-        this.loading = true;
-        const observables = [];
-        observables.push(this.mgrModuleService.getOptions(this.moduleName));
-        observables.push(this.mgrModuleService.getConfig(this.moduleName));
-        observableForkJoin(observables).subscribe(
-          (resp: object) => {
-            this.loading = false;
-            this.moduleOptions = resp[0];
-            // Create the form dynamically.
-            this.createForm();
-            // Set the form field values.
-            this.mgrModuleForm.setValue(resp[1]);
-          },
-          (error) => {
-            this.error = error;
-          }
-        );
-      },
-      (error) => {
-        this.error = error;
-      }
-    );
+    this.route.params.subscribe((params: { name: string }) => {
+      this.moduleName = decodeURIComponent(params.name);
+      this.loading = true;
+      const observables = [
+        this.mgrModuleService.getOptions(this.moduleName),
+        this.mgrModuleService.getConfig(this.moduleName)
+      ];
+      observableForkJoin(observables).subscribe(
+        (resp: object) => {
+          this.loading = false;
+          this.moduleOptions = resp[0];
+          // Create the form dynamically.
+          this.createForm();
+          // Set the form field values.
+          this.mgrModuleForm.setValue(resp[1]);
+        },
+        (_error) => {
+          this.error = true;
+        }
+      );
+    });
   }
 
   getValidators(moduleOption): ValidatorFn[] {
index ce120fbf600942dfb977696d973c32d88e63b727..5508baff5fca3885c8c6dd3fd6e019737a9d2b5f 100644 (file)
@@ -1,11 +1,8 @@
-<cd-loading-panel *ngIf="editing && loading && !error"
+<cd-loading-panel *ngIf="editing && loading"
                   i18n>Loading bucket data...</cd-loading-panel>
-<cd-error-panel *ngIf="editing && error"
-                (backAction)="goToListView()"
-                i18n>The bucket data could not be loaded.</cd-error-panel>
 
 <div class="col-sm-12 col-lg-6"
-     *ngIf="!loading && !error">
+     *ngIf="!loading">
   <form name="bucketForm"
         #frm="ngForm"
         [formGroup]="bucketForm"
index 356b63eb5cbc7acb42446bfc3328ebe85583b597..4ac5a1ce2ff15f98b5d9c2bea7d3e2929aaa9479 100644 (file)
@@ -81,31 +81,26 @@ export class RgwBucketFormComponent implements OnInit {
     }
 
     // Process route parameters.
-    this.route.params.subscribe(
-      (params: { bid: string }) => {
-        if (!params.hasOwnProperty('bid')) {
-          return;
-        }
-        const bid = decodeURIComponent(params.bid);
-        this.loading = true;
-
-        this.rgwBucketService.get(bid).subscribe((resp: object) => {
-          this.loading = false;
-          // Get the default values.
-          const defaults = _.clone(this.bucketForm.value);
-          // Extract the values displayed in the form.
-          let value = _.pick(resp, _.keys(this.bucketForm.value));
-          value['placement-target'] = resp['placement_rule'];
-          // Append default values.
-          value = _.merge(defaults, value);
-          // Update the form.
-          this.bucketForm.setValue(value);
-        });
-      },
-      (error) => {
-        this.error = error;
+    this.route.params.subscribe((params: { bid: string }) => {
+      if (!params.hasOwnProperty('bid')) {
+        return;
       }
-    );
+      const bid = decodeURIComponent(params.bid);
+      this.loading = true;
+
+      this.rgwBucketService.get(bid).subscribe((resp: object) => {
+        this.loading = false;
+        // Get the default values.
+        const defaults = _.clone(this.bucketForm.value);
+        // Extract the values displayed in the form.
+        let value = _.pick(resp, _.keys(this.bucketForm.value));
+        value['placement-target'] = resp['placement_rule'];
+        // Append default values.
+        value = _.merge(defaults, value);
+        // Update the form.
+        this.bucketForm.setValue(value);
+      });
+    });
   }
 
   goToListView() {