Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed May 7, 2020
1 parent 12e8da4 commit 61b1b0f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions x-pack/plugins/triggers_actions_ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -985,8 +985,8 @@ Each action type should be defined as an `ActionTypeModel` object with the follo
|selectMessage|Short description of action type responsibility, that will be displayed on the select card in UI.|
|validateConnector|Validation function for action connector.|
|validateParams|Validation function for action params.|
|actionConnectorFields|React functional component for building UI of current action type connector.|
|actionParamsFields|React functional component for building UI of current action type params. Displayed as a part of Create Alert flyout.|
|actionConnectorFields|A lazy loaded React component for building UI of current action type connector.|
|actionParamsFields|A lazy loaded React component for building UI of current action type params. Displayed as a part of Create Alert flyout.|

## Register action type model

Expand Down Expand Up @@ -1082,8 +1082,8 @@ export function getActionType(): ActionTypeModel {
}
return validationResult;
},
actionConnectorFields: ExampleConnectorFields,
actionParamsFields: ExampleParamsFields,
actionConnectorFields: lazy(() => import('./example_connector_fields')),
actionParamsFields: lazy(() => import('./example_params_fields')),
};
}
```
Expand Down Expand Up @@ -1130,6 +1130,9 @@ const ExampleConnectorFields: React.FunctionComponent<ActionConnectorFieldsProps
</Fragment>
);
};
// Export as default in order to support lazy loading
export {ExampleConnectorFields as default};
```

3. Define action type params fields using the property of `ActionTypeModel` `actionParamsFields`:
Expand Down Expand Up @@ -1175,6 +1178,9 @@ const ExampleParamsFields: React.FunctionComponent<ActionParamsProps<ExampleActi
</Fragment>
);
};
// Export as default in order to support lazy loading
export {ExampleParamsFields as default};
```

4. Extend registration code with the new action type register in the file `x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/index.ts`
Expand Down

0 comments on commit 61b1b0f

Please sign in to comment.