]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Edit host label dialog is crashing
authorVolker Theile <vtheile@suse.com>
Mon, 6 Jul 2020 07:59:59 +0000 (09:59 +0200)
committerVolker Theile <vtheile@suse.com>
Mon, 6 Jul 2020 07:59:59 +0000 (09:59 +0200)
Fixes: https://tracker.ceph.com/issues/46370
Signed-off-by: Volker Theile <vtheile@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts

index 833396b5b3b8b1dbf3334b52e66291a6beb785a6..089024fbbd77ee7936a29c6ffc6f431d87d39997 100644 (file)
@@ -155,39 +155,37 @@ export class HostsComponent extends ListWithDetails implements OnInit {
         return { enabled: true, name: label };
       });
       this.modalService.show(FormModalComponent, {
-        initialState: {
-          titleText: this.i18n('Edit Host: {{hostname}}', host),
-          fields: [
-            {
-              type: 'select-badges',
-              name: 'labels',
-              value: host['labels'],
-              label: this.i18n('Labels'),
-              typeConfig: {
-                customBadges: true,
-                options: allLabels,
-                messages: new SelectMessages(
-                  {
-                    empty: this.i18n('There are no labels.'),
-                    filter: this.i18n('Filter or add labels'),
-                    add: this.i18n('Add label')
-                  },
-                  this.i18n
-                )
-              }
+        titleText: this.i18n('Edit Host: {{hostname}}', host),
+        fields: [
+          {
+            type: 'select-badges',
+            name: 'labels',
+            value: host['labels'],
+            label: this.i18n('Labels'),
+            typeConfig: {
+              customBadges: true,
+              options: allLabels,
+              messages: new SelectMessages(
+                {
+                  empty: this.i18n('There are no labels.'),
+                  filter: this.i18n('Filter or add labels'),
+                  add: this.i18n('Add label')
+                },
+                this.i18n
+              )
             }
-          ],
-          submitButtonText: this.i18n('Edit Host'),
-          onSubmit: (values: any) => {
-            this.hostService.update(host['hostname'], values.labels).subscribe(() => {
-              this.notificationService.show(
-                NotificationType.success,
-                this.i18n('Updated Host "{{hostname}}"', host)
-              );
-              // Reload the data table content.
-              this.table.refreshBtn();
-            });
           }
+        ],
+        submitButtonText: this.i18n('Edit Host'),
+        onSubmit: (values: any) => {
+          this.hostService.update(host['hostname'], values.labels).subscribe(() => {
+            this.notificationService.show(
+              NotificationType.success,
+              this.i18n('Updated Host "{{hostname}}"', host)
+            );
+            // Reload the data table content.
+            this.table.refreshBtn();
+          });
         }
       });
     });