From 9823c780761ca4b0b14120d9526f84199278b183 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Fri, 26 Dec 2025 17:04:37 +0200 Subject: [PATCH 1/6] UI: Fixed show label in select cf entity --- .../alarm-rules/alarm-rule-dialog.component.html | 1 + .../components/alarm-rules/alarm-rules.component.html | 1 + .../calculated-fields/calculated-field.component.html | 1 + .../dialog/calculated-field-dialog.component.html | 1 + .../components/entity/entity-select.component.html | 1 + .../components/entity/entity-select.component.ts | 3 +++ .../components/entity/entity-type-select.component.ts | 10 +++++++++- 7 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rule-dialog.component.html b/ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rule-dialog.component.html index 1b116d0696..ed936cd60e 100644 --- a/ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rule-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/alarm-rules/alarm-rule-dialog.component.html @@ -61,6 +61,7 @@ diff --git a/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.html b/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.html index 7cea16c636..7d4b4b7920 100644 --- a/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.html +++ b/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-field.component.html @@ -66,6 +66,7 @@ diff --git a/ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.html b/ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.html index 78df90701f..293dacdca6 100644 --- a/ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.html @@ -59,6 +59,7 @@ >(); diff --git a/ui-ngx/src/app/shared/components/entity/entity-type-select.component.ts b/ui-ngx/src/app/shared/components/entity/entity-type-select.component.ts index fcfe158da0..dcabc49906 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-type-select.component.ts +++ b/ui-ngx/src/app/shared/components/entity/entity-type-select.component.ts @@ -52,8 +52,16 @@ export class EntityTypeSelectComponent implements ControlValueAccessor, OnInit, @coerceBoolean() showLabel: boolean; + private labelValue = this.translate.instant('entity.type'); + + get label(): string { + return this.labelValue; + } + @Input() - label = this.translate.instant('entity.type'); + set label(value: string) { + this.labelValue = value ?? this.translate.instant('entity.type'); + } @Input() @coerceBoolean() From c4ce25b6bfd353d7dc7f80a814e52b40646b8b68 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Fri, 26 Dec 2025 17:34:53 +0200 Subject: [PATCH 2/6] UI: Disabled change CF type when import --- .../calculated-fields/calculated-fields-table-config.ts | 5 +++-- .../components/dialog/calculated-field-dialog.component.ts | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts b/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts index e5e4063c21..e32bdc1188 100644 --- a/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts +++ b/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts @@ -253,7 +253,7 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig { + private getCalculatedFieldDialog(value?: CalculatedFieldsTableEntity, buttonTitle = 'action.add', isDirty = false, disabledSelectType = false): Observable { const entityId = this.entityId || value?.entityId; const entityName = this.entityName || (value as CalculatedFieldInfo)?.entityName; return this.dialog.open(CalculatedFieldDialogComponent, { @@ -269,6 +269,7 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig this.getCalculatedFieldDialog(this.updateImportedCalculatedField(calculatedField), 'action.add', true)), + switchMap(calculatedField => this.getCalculatedFieldDialog(this.updateImportedCalculatedField(calculatedField), 'action.add', true, true)), filter(Boolean), switchMap(calculatedField => this.calculatedFieldsService.saveCalculatedField(calculatedField)), filter(Boolean), diff --git a/ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.ts b/ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.ts index 28a028eacc..ee38fb2a2d 100644 --- a/ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.ts @@ -50,6 +50,7 @@ export interface CalculatedFieldDialogData { additionalDebugActionConfig: AdditionalDebugActionConfig<(calculatedField: CalculatedField) => void>; getTestScriptDialogFn: CalculatedFieldTestScriptFn; isDirty?: boolean; + disabledSelectType?: boolean; } @Component({ @@ -106,10 +107,14 @@ export class CalculatedFieldDialogComponent extends DialogComponent Date: Fri, 26 Dec 2025 17:42:16 +0200 Subject: [PATCH 3/6] UI: Time series data aggregation CF remove 'Count unique' aggregation function --- .../metrics/calculated-field-metrics-panel.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/calculated-fields/components/metrics/calculated-field-metrics-panel.component.ts b/ui-ngx/src/app/modules/home/components/calculated-fields/components/metrics/calculated-field-metrics-panel.component.ts index 3d5a53ea4e..811f7b87fa 100644 --- a/ui-ngx/src/app/modules/home/components/calculated-fields/components/metrics/calculated-field-metrics-panel.component.ts +++ b/ui-ngx/src/app/modules/home/components/calculated-fields/components/metrics/calculated-field-metrics-panel.component.ts @@ -74,7 +74,7 @@ export class CalculatedFieldMetricsPanelComponent implements OnInit { entityFilter: EntityFilter; - readonly AggFunctions = Object.values(AggFunction) as AggFunction[]; + AggFunctions = Object.values(AggFunction) as AggFunction[]; readonly AggFunctionTranslations = AggFunctionTranslations; readonly ScriptLanguage = ScriptLanguage; readonly AggInputType = AggInputType; @@ -103,6 +103,10 @@ export class CalculatedFieldMetricsPanelComponent implements OnInit { this.validateInputKey(); this.functionArgs = ['ctx', ...this.arguments]; + + if (this.simpleMode) { + this.AggFunctions = this.AggFunctions.filter(aggFunc => aggFunc !== AggFunction.COUNT_UNIQUE); + } } saveMetric(): void { From 1840401b29824aa16ef82e3f50b46d673e7d6605 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Fri, 26 Dec 2025 17:52:57 +0200 Subject: [PATCH 4/6] UI: Add show title in CF page and minor bug show required --- .../calculated-fields/calculated-fields-table-config.ts | 2 +- ...lculated-field-geofencing-zone-groups-panel.component.html | 4 +++- ui-ngx/src/assets/locale/locale.constant-en_US.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts b/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts index e32bdc1188..e09949d2c6 100644 --- a/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts +++ b/ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts @@ -111,7 +111,7 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig
- {{ 'calculated-fields.entity-zone-relationship' | translate }} + + {{ 'calculated-fields.entity-zone-relationship' | translate }} +
diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index 38f72b3206..259008791e 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -1183,7 +1183,7 @@ "perimeter-attribute-key": "Perimeter attribute key", "perimeter-attribute-key-required": "Perimeter attribute key is required.", "perimeter-attribute-key-pattern": "Perimeter attribute key is invalid.", - "entity-zone-relationship": "Path from Entity to Zones *", + "entity-zone-relationship": "Path from Entity to Zones", "direction": "Relation direction", "direction-from": "From entity to zone", "direction-to": "From zone to entity", From 3a647f00379a3fc398d2de5d99ab49652dfea703 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Fri, 26 Dec 2025 18:56:17 +0200 Subject: [PATCH 5/6] UI: Optimize watchKeyChange in CF arguments --- .../calculated-field-argument-panel.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/calculated-fields/components/calculated-field-arguments/calculated-field-argument-panel.component.ts b/ui-ngx/src/app/modules/home/components/calculated-fields/components/calculated-field-arguments/calculated-field-argument-panel.component.ts index 38855ec79e..51d14c9478 100644 --- a/ui-ngx/src/app/modules/home/components/calculated-fields/components/calculated-field-arguments/calculated-field-argument-panel.component.ts +++ b/ui-ngx/src/app/modules/home/components/calculated-fields/components/calculated-field-arguments/calculated-field-argument-panel.component.ts @@ -259,7 +259,11 @@ export class CalculatedFieldArgumentPanelComponent implements OnInit, AfterViewI }; } if (!onInit) { - this.argumentFormGroup.get('refEntityKey').get('key').setValue(''); + this.argumentFormGroup.get('refEntityKey').get('key').setValue('', {emitEvents: !this.watchKeyChange}); + if (this.watchKeyChange && this.argumentFormGroup.get('argumentName').pristine) { + this.argumentFormGroup.get('argumentName').markAsUntouched({emitEvent: false}); + this.argumentFormGroup.get('argumentName').setValue('', {emitEvent: false}); + } } else if (this.predefinedEntityFilter) { entityFilter = this.predefinedEntityFilter; } From 595b52d7b279d0f754dae69ea19024865d0deb7d Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Fri, 26 Dec 2025 19:01:46 +0200 Subject: [PATCH 6/6] UI: Fixed cf argument validation --- .../calculated-field-arguments-table.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/calculated-fields/components/calculated-field-arguments/calculated-field-arguments-table.component.ts b/ui-ngx/src/app/modules/home/components/calculated-fields/components/calculated-field-arguments/calculated-field-arguments-table.component.ts index 983609dfa7..a05326699d 100644 --- a/ui-ngx/src/app/modules/home/components/calculated-fields/components/calculated-field-arguments/calculated-field-arguments-table.component.ts +++ b/ui-ngx/src/app/modules/home/components/calculated-fields/components/calculated-field-arguments/calculated-field-arguments-table.component.ts @@ -154,7 +154,7 @@ export class CalculatedFieldArgumentsTableComponent implements ControlValueAcces validate(): ValidationErrors | null { this.updateErrorText(); - return this.errorText ? { argumentsFormArray: false } : null; + return this.errorText || !this.argumentsFormArray.controls.length ? { argumentsFormArray: false } : null; } setDisabledState(isDisabled: boolean): void {