Merge pull request #12913 from ArtemDzhereleiko/AD/imp/get-dashboard-state-id-help

Help for get dashboard state id aciton
This commit is contained in:
Igor Kulikov 2025-03-13 19:28:48 +02:00 committed by GitHub
commit f52c361b83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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>