UI: Help for get dashboard state id aciton

This commit is contained in:
Artem Dzhereleiko 2025-03-13 13:32:16 +02:00
parent e4123446d7
commit 09cff3ae5c
2 changed files with 35 additions and 0 deletions

View File

@ -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';
}

View File

@ -0,0 +1,33 @@
#### Parse value function
<div class="divider"></div>
<br/>
*function (data): boolean*
A JavaScript function that converts the current dashboard state id into a boolean value.
**Parameters:**
<ul>
<li><b>data:</b> <code> string </code> - the current dashboard state id.
</li>
</ul>
**Returns:**
`true` if the widget should be in an activated state, `false` otherwise.
<div class="divider"></div>
##### Examples
* Check if the current dashboard state id is "default":
```javascript
return data === 'default' ? true : false;
{:copy-code}
```
<br>
<br>