Browse Source

UI: Help for get dashboard state id aciton

pull/12913/head
Artem Dzhereleiko 1 year ago
parent
commit
09cff3ae5c
  1. 2
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/get-value-action-settings-panel.component.ts
  2. 33
      ui-ngx/src/assets/help/en_US/widget/config/parse_value_get_dashboard_state_id_fn.md

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

33
ui-ngx/src/assets/help/en_US/widget/config/parse_value_get_dashboard_state_id_fn.md

@ -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>
Loading…
Cancel
Save