diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.html b/ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.html index c7f8980426..8baaa67ead 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.html @@ -44,6 +44,7 @@ [dashboard]="dashboard" [widget]="widget" [hideHeader]="hideHeader" + [scada]="data.scada" isAdd formControlName="widgetConfig"> diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.ts index 2089c03d5d..662739295b 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/add-widget-dialog.component.ts @@ -37,6 +37,7 @@ export interface AddWidgetDialogData { stateController: IStateController; widget: Widget; widgetInfo: WidgetInfo; + scada: boolean; } @Component({ diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html index a77247b9da..21a99f70e9 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html @@ -380,6 +380,7 @@ [widgetEditMode]="widgetEditMode" [widget]="editingWidget" [widgetLayout]="editingWidgetLayout" + [scada]="editingLayoutCtx?.gridSettings?.layoutType === LayoutType.scada" (revertWidgetConfig)="onRevertWidgetEdit()" (applyWidgetConfig)="saveWidget()"> diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts index 76a4fdbb99..d16e8f360f 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts @@ -1250,7 +1250,8 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC col: 0 }; newWidget = this.dashboardUtils.validateAndUpdateWidget(newWidget); - if (this.isAddingToScadaLayout()) { + const scada = this.isAddingToScadaLayout(); + if (scada) { newWidget = this.dashboardUtils.prepareWidgetForScadaLayout(newWidget); } if (widgetTypeInfo.typeParameters.useCustomDatasources) { @@ -1267,7 +1268,8 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC aliasController: this.dashboardCtx.aliasController, stateController: this.dashboardCtx.stateController, widget: newWidget, - widgetInfo: widgetTypeInfo + widgetInfo: widgetTypeInfo, + scada } }).afterClosed().subscribe((addedWidget) => { if (addedWidget) { diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/edit-widget.component.html b/ui-ngx/src/app/modules/home/components/dashboard-page/edit-widget.component.html index 8c21279f5c..ceeb91d084 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/edit-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/edit-widget.component.html @@ -24,6 +24,7 @@ [dashboard]="dashboard" [widget]="widget" [hideToggleHeader]="previewMode" + [scada]="scada" formControlName="widgetConfig">