From 09cff3ae5c6702873a70080bbca2aee5921db07c Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Thu, 13 Mar 2025 13:32:16 +0200 Subject: [PATCH] UI: Help for get dashboard state id aciton --- ...t-value-action-settings-panel.component.ts | 2 ++ .../parse_value_get_dashboard_state_id_fn.md | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 ui-ngx/src/assets/help/en_US/widget/config/parse_value_get_dashboard_state_id_fn.md 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 1d1df6a8d5..9f85e9dd85 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 @@ -171,6 +171,8 @@ export class GetValueActionSettingsPanelComponent extends PageComponent implemen const action: GetValueAction = this.getValueSettingsFormGroup.get('action').value; if (action === GetValueAction.GET_DASHBOARD_STATE_OBJECT) { return 'widget/config/parse_value_get_dashboard_state_object_fn'; + } else if (action === GetValueAction.GET_DASHBOARD_STATE) { + return 'widget/config/parse_value_get_dashboard_state_id_fn'; } return 'widget/lib/rpc/parse_value_fn'; } diff --git a/ui-ngx/src/assets/help/en_US/widget/config/parse_value_get_dashboard_state_id_fn.md b/ui-ngx/src/assets/help/en_US/widget/config/parse_value_get_dashboard_state_id_fn.md new file mode 100644 index 0000000000..3a580b4136 --- /dev/null +++ b/ui-ngx/src/assets/help/en_US/widget/config/parse_value_get_dashboard_state_id_fn.md @@ -0,0 +1,33 @@ +#### Parse value function + +
+
+ +*function (data): boolean* + +A JavaScript function that converts the current dashboard state id into a boolean value. + +**Parameters:** + + + +**Returns:** + +`true` if the widget should be in an activated state, `false` otherwise. + +
+ +##### Examples + +* Check if the current dashboard state id is "default": + +```javascript +return data === 'default' ? true : false; +{:copy-code} +``` + +
+