Browse Source
Update widgets-bundle-widgets.component.ts
pull/9467/head
Igor Kulikov
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
3 deletions
-
ui-ngx/src/app/modules/home/pages/widget/widgets-bundle-widgets.component.ts
|
|
|
@ -205,14 +205,16 @@ export class WidgetsBundleWidgetsComponent extends PageComponent implements OnIn |
|
|
|
const isExistWidget = this.widgets.some(widget => widget.id.id === widgetType.id.id); |
|
|
|
if (isExistWidget) { |
|
|
|
this.widgets = this.widgets.map(widget => widget.id.id !== widgetType.id.id ? widget : widgetType); |
|
|
|
} else { |
|
|
|
this.widgets.push(widgetType); |
|
|
|
} |
|
|
|
if (this.editMode) { |
|
|
|
this.widgets.push(widgetType); |
|
|
|
this.isDirty = true; |
|
|
|
this.cd.markForCheck(); |
|
|
|
} else if (!isExistWidget) { |
|
|
|
this.widgetsService.addWidgetFqnToWidgetBundle(this.widgetsBundle.id.id, widgetType.fqn).subscribe(() => {}); |
|
|
|
this.widgetsService.addWidgetFqnToWidgetBundle(this.widgetsBundle.id.id, widgetType.fqn).subscribe(() => { |
|
|
|
this.widgets.push(widgetType); |
|
|
|
this.cd.markForCheck(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|