From: Volker Theile Date: Mon, 6 Jul 2020 07:59:59 +0000 (+0200) Subject: mgr/dashboard: Edit host label dialog is crashing X-Git-Tag: v16.1.0~1770^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8d019b0408b3c3e43b33b98d5e496a754a38f388;p=ceph.git mgr/dashboard: Edit host label dialog is crashing Fixes: https://tracker.ceph.com/issues/46370 Signed-off-by: Volker Theile --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts index 833396b5b3b8..089024fbbd77 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts @@ -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(); + }); } }); });