From b30ec4b123f00af5741c3d950009807b892798f1 Mon Sep 17 00:00:00 2001 From: ArtemDzhereleiko Date: Tue, 13 Jan 2026 12:34:23 +0200 Subject: [PATCH] UI: Fixed propagete form --- .../calculated-fields/calculated-field.component.ts | 3 ++- .../components/output/calculated-field-output.component.ts | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.ts b/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.ts index 284c07b9ec..f9edffa964 100644 --- a/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.ts +++ b/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.ts @@ -121,9 +121,10 @@ export class CalculatedFieldComponent extends EntityComponent { this.entityForm.patchValue({ configuration: preparedConfig, debugSettings, entityId, ...value }, {emitEvent: false}); + this.entityForm.get('type').updateValueAndValidity(); }); } diff --git a/ui-ngx/src/app/modules/home/components/calculated-fields/components/output/calculated-field-output.component.ts b/ui-ngx/src/app/modules/home/components/calculated-fields/components/output/calculated-field-output.component.ts index c8cb145cfa..a9924909b7 100644 --- a/ui-ngx/src/app/modules/home/components/calculated-fields/components/output/calculated-field-output.component.ts +++ b/ui-ngx/src/app/modules/home/components/calculated-fields/components/output/calculated-field-output.component.ts @@ -186,6 +186,9 @@ export class CalculatedFieldOutputComponent implements ControlValueAccessor, Val this.toggleScopeByOutputType(this.outputForm.get('type').value); this.updatedStrategy(); this.updateTimeSeriesTtl(this.outputForm.get('strategy.saveTimeSeries').value); + if (this.outputForm.invalid) { + this.outputForm.updateValueAndValidity(); + } } } @@ -213,7 +216,7 @@ export class CalculatedFieldOutputComponent implements ControlValueAccessor, Val private updatedFormWithMode(): void { if (this.simpleMode && !this.hiddenName) { - this.outputForm.get('name').enable({emitEvent: true}); + this.outputForm.get('name').enable({emitEvent: false}); } else { this.outputForm.get('name').disable({emitEvent: false}); }