Class
The abstract class for data action.
Implements
Properties
Property | Type | Notes |
---|---|---|
string | IconResult | The action icon. | |
string | The unique ID | |
IntlShape | The | |
boolean | Whether the action is watching the data sets change. If the action is watching the data sets change, the | |
string | The user readable-label for the action. | |
string | The action name. | |
string | The widget ID that provides the action |
Methods
Method | Returns | Notes |
---|---|---|
destroy() | void | This method will be invoked when the widget that provides the action is removed. |
isSupported(dataSets, dataLevel, widgetId) | Promise<boolean> | Will be invoked to determine whether the data action can process the data. |
onExecute(dataSets, dataLevel, widgetId, actionConfig?) | Promise<boolean | ReactElement<any, string | JSXElementConstructor<any>>> | This is the action logic. |
destroy
Class Methoddestroy(): void
This method will be invoked when the widget that provides the action is removed.
Returns
void
isSupported
isSupported(dataSets: DataRecordSet[], dataLevel: DataLevel, widgetId: string): Promise<boolean>
Will be invoked to determine whether the data action can process the data.
Parameters
Parameter | Type | Notes |
---|---|---|
data | DataRecordSet[] | The data sets that will be processed. |
data | DataLevel | The data level that will be processed. |
widget | string | The widget id that use the data actions. |
Returns
Promise<boolean>
true
if the data action can process the data.
onExecute
onExecute(dataSets: DataRecordSet[], dataLevel: DataLevel, widgetId: string, actionConfig?: any): Promise<boolean | ReactElement<any, string | JSXElementConstructor<any>>>
This is the action logic.
Parameters
Parameter | Type | Notes |
---|---|---|
data | DataRecordSet[] | The data sets that will be processed. |
data | DataLevel | The data level that will be processed. |
widget | string | The widget id that use the data actions. |
action | any | The action config that is set by the user. Not all actions have the config. |
Returns
Promise<boolean | ReactElement<any, string | JSXElementConstructor<any>>>
true
if the action is executed successfully. If the action needs to show a dialog, return the dialog content.