From dd9e45deee753a58b9e518607fdda211fc4a0b98 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Wed, 5 Feb 2025 16:37:10 +0200 Subject: [PATCH] UI: Rename 'get dashboard state with params' to 'get dashboard state object' --- .../widget/lib/action/action-widget.models.ts | 2 +- .../get-value-action-settings-panel.component.html | 2 +- .../get-value-action-settings-panel.component.ts | 6 +++--- .../action/get-value-action-settings.component.ts | 6 +++--- .../shared/models/action-widget-settings.models.ts | 4 ++-- ... => parse_value_get_dashboard_state_object_fn.md} | 4 ++-- ui-ngx/src/assets/locale/locale.constant-en_US.json | 12 ++++++------ 7 files changed, 18 insertions(+), 18 deletions(-) rename ui-ngx/src/assets/help/en_US/widget/config/{parse_value_get_dashboard_state_with_params_fn.md => parse_value_get_dashboard_state_object_fn.md} (89%) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/action/action-widget.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/action/action-widget.models.ts index 9c5bc7885a..2e02d36f04 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/action/action-widget.models.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/action/action-widget.models.ts @@ -271,7 +271,7 @@ export abstract class ValueGetter extends ValueAction { return new AlarmStatusValueGetter(ctx, settings, valueType, valueObserver, simulated); case GetValueAction.GET_DASHBOARD_STATE: return new DashboardStateGetter(ctx, settings, valueType, valueObserver, simulated); - case GetValueAction.GET_DASHBOARD_STATE_WITH_PARAMS: + case GetValueAction.GET_DASHBOARD_STATE_OBJECT: return new DashboardStateWithParamsGetter(ctx, settings, valueType, valueObserver, simulated); } } diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.html index 7783c0af20..9c9f45173d 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.html @@ -133,7 +133,7 @@
widgets.value-action.action-result-converter
+ [class.invisible]="getValueSettingsFormGroup.get('action').value === getValueAction.GET_DASHBOARD_STATE_OBJECT"> {{ 'widgets.value-action.converter-none' | translate }} {{ 'widgets.value-action.converter-function' | translate }} diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.ts index 4c98c0cac4..9b8b86e626 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.ts @@ -169,8 +169,8 @@ export class GetValueActionSettingsPanelComponent extends PageComponent implemen getParseValueFunctionHelpId(): string { const action: GetValueAction = this.getValueSettingsFormGroup.get('action').value; - if (action === GetValueAction.GET_DASHBOARD_STATE_WITH_PARAMS) { - return 'widget/config/parse_value_get_dashboard_state_with_params_fn'; + if (action === GetValueAction.GET_DASHBOARD_STATE_OBJECT) { + return 'widget/config/parse_value_get_dashboard_state_object_fn'; } return 'widget/lib/rpc/parse_value_fn'; } @@ -206,7 +206,7 @@ export class GetValueActionSettingsPanelComponent extends PageComponent implemen case GetValueAction.GET_ALARM_STATUS: this.getValueSettingsFormGroup.get('getAlarmStatus').enable({emitEvent: false}); break; - case GetValueAction.GET_DASHBOARD_STATE_WITH_PARAMS: + case GetValueAction.GET_DASHBOARD_STATE_OBJECT: this.getValueSettingsFormGroup.get('dataToValue.type').setValue(DataToValueType.FUNCTION, {emitEvent: false}); dataToValueType = DataToValueType.FUNCTION; break diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings.component.ts index d482d2e9fe..5e2661df59 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings.component.ts @@ -191,12 +191,12 @@ export class GetValueActionSettingsComponent implements OnInit, ControlValueAcce this.displayValue = this.translate.instant('widgets.value-action.get-dashboard-state-text'); } break; - case GetValueAction.GET_DASHBOARD_STATE_WITH_PARAMS: + case GetValueAction.GET_DASHBOARD_STATE_OBJECT: if (this.valueType === ValueType.BOOLEAN) { const state = this.modelValue.dataToValue?.compareToValue; - this.displayValue = this.translate.instant('widgets.value-action.when-dashboard-state-with-params-function-is-text', {state}); + this.displayValue = this.translate.instant('widgets.value-action.when-dashboard-state-object-function-is-text', {state}); } else { - this.displayValue = this.translate.instant('widgets.value-action.get-dashboard-state-with-params-text'); + this.displayValue = this.translate.instant('widgets.value-action.get-dashboard-state-object-text'); } break; } diff --git a/ui-ngx/src/app/shared/models/action-widget-settings.models.ts b/ui-ngx/src/app/shared/models/action-widget-settings.models.ts index 1c83669206..fd78ab30f0 100644 --- a/ui-ngx/src/app/shared/models/action-widget-settings.models.ts +++ b/ui-ngx/src/app/shared/models/action-widget-settings.models.ts @@ -26,7 +26,7 @@ export enum GetValueAction { GET_TIME_SERIES = 'GET_TIME_SERIES', GET_ALARM_STATUS = 'GET_ALARM_STATUS', GET_DASHBOARD_STATE = 'GET_DASHBOARD_STATE', - GET_DASHBOARD_STATE_WITH_PARAMS = 'GET_DASHBOARD_STATE_WITH_PARAMS', + GET_DASHBOARD_STATE_OBJECT = 'GET_DASHBOARD_STATE_OBJECT', } export const getValueActions = Object.keys(GetValueAction) as GetValueAction[]; @@ -47,7 +47,7 @@ export const getValueActionTranslations = new Map( [GetValueAction.GET_TIME_SERIES, 'widgets.value-action.get-time-series'], [GetValueAction.GET_ALARM_STATUS, 'widgets.value-action.get-alarm-status'], [GetValueAction.GET_DASHBOARD_STATE, 'widgets.value-action.get-dashboard-state'], - [GetValueAction.GET_DASHBOARD_STATE_WITH_PARAMS, 'widgets.value-action.get-dashboard-state-with-params'], + [GetValueAction.GET_DASHBOARD_STATE_OBJECT, 'widgets.value-action.get-dashboard-state-object'], ] ); diff --git a/ui-ngx/src/assets/help/en_US/widget/config/parse_value_get_dashboard_state_with_params_fn.md b/ui-ngx/src/assets/help/en_US/widget/config/parse_value_get_dashboard_state_object_fn.md similarity index 89% rename from ui-ngx/src/assets/help/en_US/widget/config/parse_value_get_dashboard_state_with_params_fn.md rename to ui-ngx/src/assets/help/en_US/widget/config/parse_value_get_dashboard_state_object_fn.md index c272a07f79..ddc1ed7bc8 100644 --- a/ui-ngx/src/assets/help/en_US/widget/config/parse_value_get_dashboard_state_with_params_fn.md +++ b/ui-ngx/src/assets/help/en_US/widget/config/parse_value_get_dashboard_state_object_fn.md @@ -5,7 +5,7 @@ *function (data): boolean* -A JavaScript function that converts the current dashboard state and parameters into a boolean value. +A JavaScript function that converts the current dashboard state object into a boolean value. **Parameters:** @@ -22,7 +22,7 @@ A JavaScript function that converts the current dashboard state and parameters i ##### Examples -* Check if the current dashboard state ID is "default": +* Check if the current dashboard state id is "default": ```javascript return data.id === 'default' ? true : false; 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 cd91f44b4b..7871e6c022 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -8334,18 +8334,18 @@ "set-attribute": "Set attribute", "get-time-series": "Get time series", "get-alarm-status": "Get alarm status", - "get-dashboard-state": "Get dashboard state", - "get-dashboard-state-with-params": "Get dashboard state with params", + "get-dashboard-state": "Get dashboard state id", + "get-dashboard-state-object": "Get dashboard state object", "add-time-series": "Add time series", "execute-rpc-text": "Execute RPC method '{{methodName}}'", "get-time-series-text": "Use time series '{{key}}'", "get-attribute-text": "Use attribute '{{key}}'", "get-alarm-status-text": "Use alarm status", "get-dashboard-state-text": "Use dashboard state", - "get-dashboard-state-with-params-text": "Use dashboard state with params", - "when-dashboard-state-is-text": "When dashboard state is '{{state}}'", - "when-dashboard-state-function-is-text": "When f(dashboard state) is '{{state}}'", - "when-dashboard-state-with-params-function-is-text": "When f(dashboard state with params) is '{{state}}'", + "get-dashboard-state-object-text": "Use dashboard state object", + "when-dashboard-state-is-text": "When dashboard state id is '{{state}}'", + "when-dashboard-state-function-is-text": "When f(dashboard state id) is '{{state}}'", + "when-dashboard-state-object-function-is-text": "When f(dashboard state object) is '{{state}}'", "set-attribute-to-value-text": "Set '{{key}}' attribute to: {{value}}", "add-time-series-value-text": "Add '{{key}}' time series value: {{value}}", "set-attribute-text": "Set '{{key}}' attribute",