|
|
@ -67,7 +67,7 @@ export class AlarmRuleDialogComponent extends DialogComponent<AlarmRuleDialogCom |
|
|
debugSettings: [], |
|
|
debugSettings: [], |
|
|
entityId: this.fb.group({ |
|
|
entityId: this.fb.group({ |
|
|
entityType: this.fb.control<EntityType | AliasEntityType | null>(null, Validators.required), |
|
|
entityType: this.fb.control<EntityType | AliasEntityType | null>(null, Validators.required), |
|
|
id: ['', Validators.required], |
|
|
id: [null as null | string, Validators.required], |
|
|
}), |
|
|
}), |
|
|
configuration: this.fb.group({ |
|
|
configuration: this.fb.group({ |
|
|
arguments: this.fb.control({}), |
|
|
arguments: this.fb.control({}), |
|
|
@ -101,7 +101,6 @@ export class AlarmRuleDialogComponent extends DialogComponent<AlarmRuleDialogCom |
|
|
private destroyRef: DestroyRef, |
|
|
private destroyRef: DestroyRef, |
|
|
private fb: FormBuilder) { |
|
|
private fb: FormBuilder) { |
|
|
super(store, router, dialogRef); |
|
|
super(store, router, dialogRef); |
|
|
this.observeIsLoading(); |
|
|
|
|
|
this.applyDialogData(); |
|
|
this.applyDialogData(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -178,19 +177,6 @@ export class AlarmRuleDialogComponent extends DialogComponent<AlarmRuleDialogCom |
|
|
this.fieldFormGroup.patchValue({ configuration, type, debugSettings, entityId, ...value }, {emitEvent: false}); |
|
|
this.fieldFormGroup.patchValue({ configuration, type, debugSettings, entityId, ...value }, {emitEvent: false}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private observeIsLoading(): void { |
|
|
|
|
|
this.isLoading$.pipe(takeUntilDestroyed()).subscribe(loading => { |
|
|
|
|
|
if (loading) { |
|
|
|
|
|
this.fieldFormGroup.disable({emitEvent: false}); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.fieldFormGroup.enable({emitEvent: false}); |
|
|
|
|
|
if (this.data.isDirty) { |
|
|
|
|
|
this.fieldFormGroup.markAsDirty(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onTestScript(expression: string): Observable<string> { |
|
|
onTestScript(expression: string): Observable<string> { |
|
|
const calculatedFieldId = this.data.value?.id?.id; |
|
|
const calculatedFieldId = this.data.value?.id?.id; |
|
|
if (calculatedFieldId) { |
|
|
if (calculatedFieldId) { |
|
|
|