MyAutomations
Description#
This component renders the list of user's automations and a button to add a new one.
Import#
import { MyAutomations } from "@rollout/connect-react";
Usage#
Here's a basic usage example:
<MyAutomationsonCreateAutomation={() => navigate("create")}onEditAutomation={(automation) => navigate(`${automation.id}/edit`)}/>
Filtering#
Filtering automations is possible by specifying a predicate via the optional filter
function property.
The example below will filter automations whose trigger.inputParams.form_id
is 123
.
<MyAutomationsonCreateAutomation={() => navigate("create")}onEditAutomation={(automation) => navigate(`${automation.id}/edit`)}filter={(automation) => automation.trigger.inputParams.form_id === "123"}/>
Props#
prop | type | required | Description |
---|---|---|---|
onCreateAutomation | () => void | true | A callback to call when user clicks on the "New" button. Use this to navigate to a view which renders AutomationCreator . |
onEditAutomation | (automation) => void | true | A callback to call when user intents to edit an existing automation. Use this to navigate to a view which renders AutomationEditor . |
filter | (automation) => boolean | false | A predicate function callback used to filter the automations. |
title | string | false | Customizes the title of the manager. |
searchPlaceholder | string | false | Customizes the placeholder of the search bar. |
noAutomationsMessage | string | false | Customizes the message displayed when no automations are found. |
newButtonText | string | false | Customizes the text of the button used for creating new automations. |
saveButtonText | string | false | Customizes the text of the button used for saving an automation. |
deleteButtonText | string | false | Customizes the text of the button used for deleting an automation. |
viewButtonText | string | false | Customizes the text of the view button on an item's menu. |