From 1f5a8ef70f8912a00912b318abcf3396e7d72f61 Mon Sep 17 00:00:00 2001 From: Kalutka Zhenya Date: Tue, 18 May 2021 10:52:38 +0300 Subject: [PATCH] Updated logic for 'Set entity from widget' in static widget --- .../widget/action/manage-widget-actions.component.ts | 6 +++++- .../action/widget-action-dialog.component.html | 2 +- .../widget/action/widget-action-dialog.component.ts | 12 +++++++++++- .../components/widget/widget-config.component.html | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/action/manage-widget-actions.component.ts b/ui-ngx/src/app/modules/home/components/widget/action/manage-widget-actions.component.ts index 0367cf3ce5..2a68251c3d 100644 --- a/ui-ngx/src/app/modules/home/components/widget/action/manage-widget-actions.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/action/manage-widget-actions.component.ts @@ -42,6 +42,7 @@ import { WidgetActionDialogData } from '@home/components/widget/action/widget-action-dialog.component'; import { deepClone } from '@core/utils'; +import { WidgetConfigComponentData } from '@home/models/widget-component.models'; @Component({ selector: 'tb-manage-widget-actions', @@ -59,6 +60,8 @@ export class ManageWidgetActionsComponent extends PageComponent implements OnIni @Input() disabled: boolean; + @Input() modelValue: WidgetConfigComponentData; + @Input() callbacks: WidgetActionCallbacks; innerValue: WidgetActionsData; @@ -180,7 +183,8 @@ export class ManageWidgetActionsComponent extends PageComponent implements OnIni isAdd, callbacks: this.callbacks, actionsData, - action: deepClone(action) + action: deepClone(action), + modelValue: this.modelValue } }).afterClosed().subscribe( (res) => { diff --git a/ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.html b/ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.html index 44bfe44e1e..36234da531 100644 --- a/ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.html @@ -120,7 +120,7 @@ widgetActionFormGroup.get('type').value === widgetActionType.updateDashboardState || widgetActionFormGroup.get('type').value === widgetActionType.openDashboard ? widgetActionFormGroup.get('type').value : ''"> - + {{ 'widget-action.set-entity-from-widget' | translate }} , protected router: Router, @@ -139,9 +148,10 @@ export class WidgetActionDialogComponent extends DialogComponent