UI: Fixed widget config forms validation.
This commit is contained in:
parent
49f5931f1b
commit
59adb5f6a4
@ -17,7 +17,7 @@
|
|||||||
"settingsDirective": "tb-liquid-level-card-widget-settings",
|
"settingsDirective": "tb-liquid-level-card-widget-settings",
|
||||||
"hasBasicMode": true,
|
"hasBasicMode": true,
|
||||||
"basicModeDirective": "tb-liquid-level-card-basic-config",
|
"basicModeDirective": "tb-liquid-level-card-basic-config",
|
||||||
"defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"return Math.floor(Math.random() * 101);\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"tankSelectionType\":\"static\",\"selectedShape\":\"Vertical Cylinder\",\"shapeAttributeName\":\"tankShape\",\"tankColor\":{\"type\":\"range\",\"color\":\"#242770\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E73535DE\"},{\"from\":20,\"to\":null,\"color\":\"#242770\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E73535DE';\\n }\\n}\\nreturn '#242770';\"},\"datasourceUnits\":\"%\",\"layout\":\"percentage\",\"volumeSource\":\"static\",\"volumeConstant\":500,\"volumeAttributeName\":\"volume\",\"volumeUnits\":\"L\",\"volumeFont\":{\"family\":\"Roboto\",\"size\":14,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"volumeColor\":\"rgba(255, 255, 255, 0.18)\",\"units\":\"%\",\"widgetUnitsSource\":\"static\",\"widgetUnitsAttributeName\":\"units\",\"liquidColor\":{\"type\":\"range\",\"color\":\"#7A8BFF\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E27C7CDE\"},{\"from\":20,\"to\":null,\"color\":\"#7A8BFF\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"valueFont\":{\"family\":\"Roboto\",\"size\":24,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"valueColor\":{\"type\":\"range\",\"color\":\"#000000DE\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FF0000DE\"},{\"from\":20,\"to\":null,\"color\":\"rgba(0,0,0,0.87)\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FF0000DE';\\n }\\n}\\nreturn '#000000DE';\"},\"showBackgroundOverlay\":true,\"backgroundOverlayColor\":{\"type\":\"range\",\"color\":\"rgba(255, 255, 255, 0.76)\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FFEFEFDE\"},{\"from\":20,\"to\":null,\"color\":\"#FFFFFFC2\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FFEFEFDE';\\n }\\n}\\nreturn '#FFFFFFC2';\"},\"showTooltip\":true,\"showTooltipLevel\":true,\"tooltipUnits\":\"%\",\"tooltipLevelDecimals\":0,\"tooltipLevelFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipLevelColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.76)\",\"rangeList\":[],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"showTooltipDate\":true,\"tooltipDateFormat\":{\"format\":null,\"lastUpdateAgo\":true,\"custom\":false},\"tooltipDateFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipDateColor\":\"rgba(0, 0, 0, 0.76)\",\"tooltipBackgroundColor\":\"rgba(255, 255, 255, 0.76)\",\"tooltipBackgroundBlur\":3,\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}}},\"title\":\"Liquid level\",\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"configMode\":\"basic\",\"titleFont\":{\"family\":\"Roboto\",\"size\":16,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"1.5\"},\"titleColor\":\"rgba(0, 0, 0, 0.87)\",\"showTitleIcon\":false,\"titleIcon\":\"water_drop\",\"iconColor\":\"#5469FF\",\"decimals\":0,\"enableDataExport\":false,\"enableFullscreen\":false,\"borderRadius\":\"0px\",\"actions\":{},\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"dropShadow\":true,\"margin\":\"0px\",\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"pageSize\":1024,\"noDataDisplayMessage\":\"\"}"
|
"defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"return Math.floor(Math.random() * 101);\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"tankSelectionType\":\"static\",\"selectedShape\":\"Vertical Cylinder\",\"shapeAttributeName\":\"tankShape\",\"tankColor\":{\"type\":\"range\",\"color\":\"#242770\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E73535DE\"},{\"from\":20,\"to\":null,\"color\":\"#242770\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E73535DE';\\n }\\n}\\nreturn '#242770';\"},\"datasourceUnits\":\"%\",\"layout\":\"percentage\",\"volumeSource\":\"static\",\"volumeConstant\":500,\"volumeAttributeName\":\"volume\",\"volumeUnits\":\"L\",\"volumeFont\":{\"family\":\"Roboto\",\"size\":14,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"volumeColor\":\"rgba(0, 0, 0, 0.18)\",\"units\":\"%\",\"widgetUnitsSource\":\"static\",\"widgetUnitsAttributeName\":\"units\",\"liquidColor\":{\"type\":\"range\",\"color\":\"#7A8BFF\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#E27C7CDE\"},{\"from\":20,\"to\":null,\"color\":\"#7A8BFF\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"valueFont\":{\"family\":\"Roboto\",\"size\":24,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"valueColor\":{\"type\":\"range\",\"color\":\"#000000DE\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FF0000DE\"},{\"from\":20,\"to\":null,\"color\":\"rgba(0,0,0,0.87)\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FF0000DE';\\n }\\n}\\nreturn '#000000DE';\"},\"showBackgroundOverlay\":true,\"backgroundOverlayColor\":{\"type\":\"range\",\"color\":\"rgba(255, 255, 255, 0.76)\",\"rangeList\":[{\"from\":null,\"to\":20,\"color\":\"#FFEFEFDE\"},{\"from\":20,\"to\":null,\"color\":\"#FFFFFFC2\"}],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#FFEFEFDE';\\n }\\n}\\nreturn '#FFFFFFC2';\"},\"showTooltip\":true,\"showTooltipLevel\":true,\"tooltipUnits\":\"%\",\"tooltipLevelDecimals\":0,\"tooltipLevelFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipLevelColor\":{\"type\":\"constant\",\"color\":\"rgba(0, 0, 0, 0.76)\",\"rangeList\":[],\"colorFunction\":\"var percent = value;\\nif (typeof percent !== undefined) {\\n if (percent < 20) {\\n return '#E27C7CDE';\\n }\\n}\\nreturn '#7A8BFF';\"},\"showTooltipDate\":true,\"tooltipDateFormat\":{\"format\":null,\"lastUpdateAgo\":true,\"custom\":false},\"tooltipDateFont\":{\"family\":\"Roboto\",\"size\":13,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"100%\"},\"tooltipDateColor\":\"rgba(0, 0, 0, 0.76)\",\"tooltipBackgroundColor\":\"rgba(255, 255, 255, 0.76)\",\"tooltipBackgroundBlur\":3,\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}}},\"title\":\"Liquid level\",\"useDashboardTimewindow\":true,\"displayTimewindow\":true,\"configMode\":\"basic\",\"titleFont\":{\"family\":\"Roboto\",\"size\":16,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"1.5\"},\"titleColor\":\"rgba(0, 0, 0, 0.87)\",\"showTitleIcon\":false,\"titleIcon\":\"water_drop\",\"iconColor\":\"#5469FF\",\"decimals\":0,\"enableDataExport\":false,\"enableFullscreen\":false,\"borderRadius\":\"0px\",\"actions\":{},\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"dropShadow\":true,\"margin\":\"0px\",\"widgetStyle\":{},\"widgetCss\":\"\",\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"pageSize\":1024,\"noDataDisplayMessage\":\"\"}"
|
||||||
},
|
},
|
||||||
"externalId": null,
|
"externalId": null,
|
||||||
"tags": [
|
"tags": [
|
||||||
|
|||||||
@ -75,14 +75,14 @@
|
|||||||
<button *ngIf="!previewMode"
|
<button *ngIf="!previewMode"
|
||||||
mat-button color="primary"
|
mat-button color="primary"
|
||||||
type="button"
|
type="button"
|
||||||
[disabled]="widgetFormGroup.invalid"
|
[disabled]="!widgetFormGroup.valid"
|
||||||
(click)="previewMode = true"
|
(click)="previewMode = true"
|
||||||
cdkFocusInitial>
|
cdkFocusInitial>
|
||||||
{{ 'widget-config.preview' | translate }}
|
{{ 'widget-config.preview' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button mat-raised-button color="primary"
|
<button mat-raised-button color="primary"
|
||||||
(click)="add()"
|
(click)="add()"
|
||||||
[disabled]="widgetFormGroup.invalid">
|
[disabled]="!widgetFormGroup.valid">
|
||||||
{{ 'action.add' | translate }}
|
{{ 'action.add' | translate }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<button *ngIf="!previewMode"
|
<button *ngIf="!previewMode"
|
||||||
fxHide.gt-sm
|
fxHide.gt-sm
|
||||||
[disabled]="widgetFormGroup.invalid"
|
[disabled]="!widgetFormGroup.valid"
|
||||||
mat-button color="primary"
|
mat-button color="primary"
|
||||||
(click)="previewMode = true">
|
(click)="previewMode = true">
|
||||||
<mat-icon>visibility</mat-icon>
|
<mat-icon>visibility</mat-icon>
|
||||||
@ -44,7 +44,7 @@
|
|||||||
<div fxFlex.lt-md class="tb-widget-config-header-suffix" fxLayout="row" fxLayoutAlign="end center" fxLayoutGap="12px">
|
<div fxFlex.lt-md class="tb-widget-config-header-suffix" fxLayout="row" fxLayoutAlign="end center" fxLayoutGap="12px">
|
||||||
<button *ngIf="!previewMode"
|
<button *ngIf="!previewMode"
|
||||||
fxHide.lt-md
|
fxHide.lt-md
|
||||||
[disabled]="widgetFormGroup.invalid"
|
[disabled]="!widgetFormGroup.valid"
|
||||||
mat-button color="primary"
|
mat-button color="primary"
|
||||||
(click)="previewMode = true">
|
(click)="previewMode = true">
|
||||||
<mat-icon>visibility</mat-icon>
|
<mat-icon>visibility</mat-icon>
|
||||||
@ -57,7 +57,7 @@
|
|||||||
<mat-icon>close</mat-icon>
|
<mat-icon>close</mat-icon>
|
||||||
{{ 'action.decline' | translate }}
|
{{ 'action.decline' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button [disabled]="widgetFormGroup.invalid || !widgetFormGroup.dirty"
|
<button [disabled]="!widgetFormGroup.valid || !widgetFormGroup.dirty"
|
||||||
mat-flat-button color="primary"
|
mat-flat-button color="primary"
|
||||||
(click)="onApplyWidgetConfig()">
|
(click)="onApplyWidgetConfig()">
|
||||||
<mat-icon>done</mat-icon>
|
<mat-icon>done</mat-icon>
|
||||||
|
|||||||
@ -41,13 +41,14 @@ import {
|
|||||||
widgetType
|
widgetType
|
||||||
} from '@shared/models/widget.models';
|
} from '@shared/models/widget.models';
|
||||||
import {
|
import {
|
||||||
|
AsyncValidator,
|
||||||
ControlValueAccessor,
|
ControlValueAccessor,
|
||||||
NG_VALIDATORS,
|
NG_ASYNC_VALIDATORS,
|
||||||
NG_VALUE_ACCESSOR,
|
NG_VALUE_ACCESSOR,
|
||||||
UntypedFormBuilder,
|
UntypedFormBuilder,
|
||||||
UntypedFormControl,
|
UntypedFormControl,
|
||||||
UntypedFormGroup,
|
UntypedFormGroup,
|
||||||
Validator,
|
ValidationErrors,
|
||||||
Validators
|
Validators
|
||||||
} from '@angular/forms';
|
} from '@angular/forms';
|
||||||
import { WidgetConfigComponentData } from '@home/models/widget-component.models';
|
import { WidgetConfigComponentData } from '@home/models/widget-component.models';
|
||||||
@ -59,7 +60,7 @@ import { UtilsService } from '@core/services/utils.service';
|
|||||||
import { DataKeyType } from '@shared/models/telemetry/telemetry.models';
|
import { DataKeyType } from '@shared/models/telemetry/telemetry.models';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { EntityType } from '@shared/models/entity-type.models';
|
import { EntityType } from '@shared/models/entity-type.models';
|
||||||
import { Observable, of, Subscription } from 'rxjs';
|
import { Observable, of, Subject, Subscription } from 'rxjs';
|
||||||
import {
|
import {
|
||||||
IBasicWidgetConfigComponent,
|
IBasicWidgetConfigComponent,
|
||||||
WidgetConfigCallbacks
|
WidgetConfigCallbacks
|
||||||
@ -68,7 +69,7 @@ import {
|
|||||||
EntityAliasDialogComponent,
|
EntityAliasDialogComponent,
|
||||||
EntityAliasDialogData
|
EntityAliasDialogData
|
||||||
} from '@home/components/alias/entity-alias-dialog.component';
|
} from '@home/components/alias/entity-alias-dialog.component';
|
||||||
import { catchError, mergeMap, tap } from 'rxjs/operators';
|
import { catchError, map, mergeMap, tap } from 'rxjs/operators';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { EntityService } from '@core/http/entity.service';
|
import { EntityService } from '@core/http/entity.service';
|
||||||
import { JsonFormComponentData } from '@shared/components/json-form/json-form-component.models';
|
import { JsonFormComponentData } from '@shared/components/json-form/json-form-component.models';
|
||||||
@ -102,13 +103,13 @@ const defaultSettingsForm = [
|
|||||||
multi: true
|
multi: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
provide: NG_VALIDATORS,
|
provide: NG_ASYNC_VALIDATORS,
|
||||||
useExisting: forwardRef(() => WidgetConfigComponent),
|
useExisting: forwardRef(() => WidgetConfigComponent),
|
||||||
multi: true,
|
multi: true,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class WidgetConfigComponent extends PageComponent implements OnInit, OnDestroy, ControlValueAccessor, Validator {
|
export class WidgetConfigComponent extends PageComponent implements OnInit, OnDestroy, ControlValueAccessor, AsyncValidator {
|
||||||
|
|
||||||
@ViewChild('basicModeContainer', {read: ViewContainerRef, static: false}) basicModeContainer: ViewContainerRef;
|
@ViewChild('basicModeContainer', {read: ViewContainerRef, static: false}) basicModeContainer: ViewContainerRef;
|
||||||
|
|
||||||
@ -181,6 +182,7 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, OnDe
|
|||||||
private createBasicModeComponentTimeout: Timeout;
|
private createBasicModeComponentTimeout: Timeout;
|
||||||
private basicModeComponentRef: ComponentRef<IBasicWidgetConfigComponent>;
|
private basicModeComponentRef: ComponentRef<IBasicWidgetConfigComponent>;
|
||||||
private basicModeComponent: IBasicWidgetConfigComponent;
|
private basicModeComponent: IBasicWidgetConfigComponent;
|
||||||
|
private basicModeComponent$: Subject<IBasicWidgetConfigComponent> = null;
|
||||||
private basicModeComponentChangeSubscription: Subscription;
|
private basicModeComponentChangeSubscription: Subscription;
|
||||||
|
|
||||||
private dataSettingsChangesSubscription: Subscription;
|
private dataSettingsChangesSubscription: Subscription;
|
||||||
@ -437,6 +439,11 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, OnDe
|
|||||||
this.propagateChange(this.modelValue);
|
this.propagateChange(this.modelValue);
|
||||||
this.cd.markForCheck();
|
this.cd.markForCheck();
|
||||||
});
|
});
|
||||||
|
if (this.basicModeComponent$) {
|
||||||
|
this.basicModeComponent$.next(this.basicModeComponent);
|
||||||
|
this.basicModeComponent$.complete();
|
||||||
|
this.basicModeComponent$ = null;
|
||||||
|
}
|
||||||
this.cd.markForCheck();
|
this.cd.markForCheck();
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
@ -876,16 +883,39 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, OnDe
|
|||||||
return stateId => stateId.toLowerCase().indexOf(lowercaseQuery) === 0;
|
return stateId => stateId.toLowerCase().indexOf(lowercaseQuery) === 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public validate(c: UntypedFormControl) {
|
public validate(c: UntypedFormControl): Observable<ValidationErrors | null> {
|
||||||
|
const basicComponentMode = this.hasBasicModeDirective && this.widgetConfigMode === WidgetConfigMode.basic;
|
||||||
|
let comp$: Observable<IBasicWidgetConfigComponent>;
|
||||||
|
if (basicComponentMode) {
|
||||||
if (this.basicModeComponent) {
|
if (this.basicModeComponent) {
|
||||||
if (!this.basicModeComponent.validateConfig()) {
|
comp$ = of(this.basicModeComponent);
|
||||||
|
} else {
|
||||||
|
if (this.useDefinedBasicModeDirective) {
|
||||||
|
this.basicModeComponent$ = new Subject();
|
||||||
|
comp$ = this.basicModeComponent$;
|
||||||
|
} else {
|
||||||
|
comp$ = of(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
comp$ = of(null);
|
||||||
|
}
|
||||||
|
return comp$.pipe(
|
||||||
|
map((comp) => this.doValidate(basicComponentMode, comp))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private doValidate(basicComponentMode: boolean, basicModeComponent?: IBasicWidgetConfigComponent): ValidationErrors | null {
|
||||||
|
if (basicComponentMode) {
|
||||||
|
if (!basicModeComponent || !basicModeComponent.validateConfig()) {
|
||||||
return {
|
return {
|
||||||
basicWidgetConfig: {
|
basicWidgetConfig: {
|
||||||
valid: false
|
valid: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} else if (!this.dataSettings.valid) {
|
} else {
|
||||||
|
if (!this.dataSettings.valid) {
|
||||||
return {
|
return {
|
||||||
dataSettings: {
|
dataSettings: {
|
||||||
valid: false
|
valid: false
|
||||||
@ -909,7 +939,9 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, OnDe
|
|||||||
valid: false
|
valid: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else if (this.modelValue) {
|
}
|
||||||
|
}
|
||||||
|
if (this.modelValue) {
|
||||||
const config = this.modelValue.config;
|
const config = this.modelValue.config;
|
||||||
if (this.widgetType === widgetType.rpc && this.modelValue.isDataEnabled) {
|
if (this.widgetType === widgetType.rpc && this.modelValue.isDataEnabled) {
|
||||||
if (!this.widgetEditMode && (!config.targetDeviceAliasIds || !config.targetDeviceAliasIds.length)) {
|
if (!this.widgetEditMode && (!config.targetDeviceAliasIds || !config.targetDeviceAliasIds.length)) {
|
||||||
@ -923,4 +955,5 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, OnDe
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user