From 7a747f101efd6b7846a677d0bf6dcdfe3d14a186 Mon Sep 17 00:00:00 2001 From: rusikv Date: Tue, 13 Feb 2024 18:16:27 +0200 Subject: [PATCH] UI: added 'Default coma separetad values' hint to alarm rule condition string filter predicate value input in case of 'in' and 'not in' operations --- .../filter/filter-predicate-value.component.html | 2 +- .../filter/filter-predicate-value.component.ts | 14 +++++++++++++- .../filter/string-filter-predicate.component.html | 1 + .../src/assets/locale/locale.constant-en_US.json | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/filter/filter-predicate-value.component.html b/ui-ngx/src/app/modules/home/components/filter/filter-predicate-value.component.html index 4e7a499895..c6ae39f295 100644 --- a/ui-ngx/src/app/modules/home/components/filter/filter-predicate-value.component.html +++ b/ui-ngx/src/app/modules/home/components/filter/filter-predicate-value.component.html @@ -41,7 +41,7 @@ -
filter.default-value
+
{{ hintText | translate }}
diff --git a/ui-ngx/src/app/modules/home/components/filter/filter-predicate-value.component.ts b/ui-ngx/src/app/modules/home/components/filter/filter-predicate-value.component.ts index 30260b26ea..473e01801f 100644 --- a/ui-ngx/src/app/modules/home/components/filter/filter-predicate-value.component.ts +++ b/ui-ngx/src/app/modules/home/components/filter/filter-predicate-value.component.ts @@ -32,7 +32,8 @@ import { EntityKeyValueType, FilterPredicateValue, getDynamicSourcesForAllowUser, - inheritModeForDynamicValueSourceType + inheritModeForDynamicValueSourceType, + StringOperation } from '@shared/models/query/query.models'; @Component({ @@ -81,6 +82,15 @@ export class FilterPredicateValueComponent implements ControlValueAccessor, Vali return this.onlyUserDynamicSourceValue; } + @Input() + set operation(operation: StringOperation) { + if (operation && (operation === StringOperation.IN || operation === StringOperation.NOT_IN)) { + this.hintText = 'filter.default-coma-separated-values'; + } else { + this.hintText = 'filter.default-value'; + } + } + @Input() valueType: EntityKeyValueType; @@ -98,6 +108,8 @@ export class FilterPredicateValueComponent implements ControlValueAccessor, Vali inheritMode = false; + hintText = 'filter.default-value'; + private propagateChange = null; private propagateChangePending = false; diff --git a/ui-ngx/src/app/modules/home/components/filter/string-filter-predicate.component.html b/ui-ngx/src/app/modules/home/components/filter/string-filter-predicate.component.html index 2ce80373e8..c2888fa06f 100644 --- a/ui-ngx/src/app/modules/home/components/filter/string-filter-predicate.component.html +++ b/ui-ngx/src/app/modules/home/components/filter/string-filter-predicate.component.html @@ -31,6 +31,7 @@ [onlyUserDynamicSource]="onlyUserDynamicSource" fxFlex="70" [valueType]="valueTypeEnum.STRING" + [operation]="stringFilterPredicateFormGroup.get('operation').value" formControlName="value">
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 19981797f8..cb77262623 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -2667,6 +2667,7 @@ "current-user": "Current user", "current-device": "Current device", "default-value": "Default value", + "default-coma-separated-values": "Default coma separated values", "dynamic-source-type": "Dynamic source type", "dynamic-value": "Dynamic value", "no-dynamic-value": "No dynamic value",