Adding concept of internal and external actions.

This commit is contained in:
mike12345567 2021-09-14 12:40:19 +01:00
parent 458db567ea
commit e94c629bab
17 changed files with 26 additions and 5 deletions

View File

@ -24,7 +24,7 @@ context("Create a automation", () => {
}) })
// Create action // Create action
cy.contains("Action").click() cy.contains("Internal").click()
cy.contains("Create Row").click() cy.contains("Create Row").click()
cy.get(".setup").within(() => { cy.get(".setup").within(() => {
cy.get(".spectrum-Picker-label").click() cy.get(".spectrum-Picker-label").click()

View File

@ -14,15 +14,17 @@
disabled: hasTrigger, disabled: hasTrigger,
}, },
{ {
label: "Action", label: "Internal",
value: "ACTION", value: "ACTION",
internal: true,
icon: "Actions", icon: "Actions",
disabled: !hasTrigger, disabled: !hasTrigger,
}, },
{ {
label: "Logic", label: "External",
value: "LOGIC", value: "ACTION",
icon: "Filter", internal: false,
icon: "Extension",
disabled: !hasTrigger, disabled: !hasTrigger,
}, },
] ]
@ -32,9 +34,13 @@
let popover let popover
let webhookModal let webhookModal
$: selectedTab = selectedIndex == null ? null : tabs[selectedIndex].value $: selectedTab = selectedIndex == null ? null : tabs[selectedIndex].value
$: selectedInternal =
selectedIndex == null ? null : tabs[selectedIndex].internal
$: anchor = selectedIndex === -1 ? null : anchors[selectedIndex] $: anchor = selectedIndex === -1 ? null : anchors[selectedIndex]
$: blocks = sortBy(entry => entry[1].name)( $: blocks = sortBy(entry => entry[1].name)(
Object.entries($automationStore.blockDefinitions[selectedTab] ?? {}) Object.entries($automationStore.blockDefinitions[selectedTab] ?? {})
).filter(
entry => selectedInternal == null || entry[1].internal === selectedInternal
) )
function onChangeTab(idx) { function onChangeTab(idx) {

View File

@ -7,6 +7,7 @@ exports.definition = {
icon: "ri-terminal-box-line", icon: "ri-terminal-box-line",
description: "Run a bash script", description: "Run a bash script",
type: "ACTION", type: "ACTION",
internal: true,
stepId: "EXECUTE_BASH", stepId: "EXECUTE_BASH",
inputs: {}, inputs: {},
schema: { schema: {

View File

@ -9,6 +9,7 @@ exports.definition = {
icon: "ri-save-3-line", icon: "ri-save-3-line",
description: "Add a row to your database", description: "Add a row to your database",
type: "ACTION", type: "ACTION",
internal: true,
stepId: "CREATE_ROW", stepId: "CREATE_ROW",
inputs: {}, inputs: {},
schema: { schema: {

View File

@ -6,6 +6,7 @@ exports.definition = {
tagline: "Delay for {{inputs.time}} milliseconds", tagline: "Delay for {{inputs.time}} milliseconds",
description: "Delay the automation until an amount of time has passed", description: "Delay the automation until an amount of time has passed",
stepId: "DELAY", stepId: "DELAY",
internal: true,
inputs: {}, inputs: {},
schema: { schema: {
inputs: { inputs: {

View File

@ -9,6 +9,7 @@ exports.definition = {
tagline: "Delete a {{inputs.enriched.table.name}} row", tagline: "Delete a {{inputs.enriched.table.name}} row",
type: "ACTION", type: "ACTION",
stepId: "DELETE_ROW", stepId: "DELETE_ROW",
internal: true,
inputs: {}, inputs: {},
schema: { schema: {
inputs: { inputs: {

View File

@ -11,6 +11,7 @@ exports.definition = {
icon: "ri-discord-line", icon: "ri-discord-line",
stepId: "discord", stepId: "discord",
type: "ACTION", type: "ACTION",
internal: false,
inputs: {}, inputs: {},
schema: { schema: {
inputs: { inputs: {

View File

@ -8,6 +8,7 @@ exports.definition = {
description: "Execute a query in an external data connector", description: "Execute a query in an external data connector",
type: "ACTION", type: "ACTION",
stepId: "EXECUTE_QUERY", stepId: "EXECUTE_QUERY",
internal: true,
inputs: {}, inputs: {},
schema: { schema: {
inputs: { inputs: {

View File

@ -7,6 +7,7 @@ exports.definition = {
icon: "ri-terminal-box-line", icon: "ri-terminal-box-line",
description: "Run a piece of JavaScript code in your automation", description: "Run a piece of JavaScript code in your automation",
type: "ACTION", type: "ACTION",
internal: true,
stepId: "EXECUTE_SCRIPT", stepId: "EXECUTE_SCRIPT",
inputs: {}, inputs: {},
schema: { schema: {

View File

@ -21,6 +21,7 @@ exports.definition = {
icon: "ri-git-branch-line", icon: "ri-git-branch-line",
description: "Filter any automations which do not meet certain conditions", description: "Filter any automations which do not meet certain conditions",
type: "LOGIC", type: "LOGIC",
internal: true,
stepId: "FILTER", stepId: "FILTER",
inputs: { inputs: {
condition: FilterConditions.EQUALS, condition: FilterConditions.EQUALS,

View File

@ -9,6 +9,7 @@ exports.definition = {
icon: "ri-shut-down-line", icon: "ri-shut-down-line",
stepId: "integromat", stepId: "integromat",
type: "ACTION", type: "ACTION",
internal: false,
inputs: {}, inputs: {},
schema: { schema: {
inputs: { inputs: {

View File

@ -23,6 +23,7 @@ exports.definition = {
icon: "ri-send-plane-line", icon: "ri-send-plane-line",
description: "Send a request of specified method to a URL", description: "Send a request of specified method to a URL",
type: "ACTION", type: "ACTION",
internal: true,
stepId: "OUTGOING_WEBHOOK", stepId: "OUTGOING_WEBHOOK",
inputs: { inputs: {
requestMethod: "POST", requestMethod: "POST",

View File

@ -6,6 +6,7 @@ exports.definition = {
icon: "ri-mail-open-line", icon: "ri-mail-open-line",
name: "Send Email (SMTP)", name: "Send Email (SMTP)",
type: "ACTION", type: "ACTION",
internal: true,
stepId: "SEND_EMAIL_SMTP", stepId: "SEND_EMAIL_SMTP",
inputs: {}, inputs: {},
schema: { schema: {

View File

@ -10,6 +10,7 @@ exports.definition = {
icon: "ri-server-line", icon: "ri-server-line",
description: "Logs the given text to the server (using console.log)", description: "Logs the given text to the server (using console.log)",
type: "ACTION", type: "ACTION",
internal: true,
stepId: "SERVER_LOG", stepId: "SERVER_LOG",
inputs: { inputs: {
text: "", text: "",

View File

@ -8,6 +8,7 @@ exports.definition = {
icon: "ri-slack-line", icon: "ri-slack-line",
stepId: "slack", stepId: "slack",
type: "ACTION", type: "ACTION",
internal: false,
inputs: {}, inputs: {},
schema: { schema: {
inputs: { inputs: {

View File

@ -7,6 +7,7 @@ exports.definition = {
icon: "ri-refresh-line", icon: "ri-refresh-line",
description: "Update a row in your database", description: "Update a row in your database",
type: "ACTION", type: "ACTION",
internal: true,
stepId: "UPDATE_ROW", stepId: "UPDATE_ROW",
inputs: {}, inputs: {},
schema: { schema: {

View File

@ -5,6 +5,7 @@ exports.definition = {
name: "Zapier Webhook", name: "Zapier Webhook",
stepId: "zapier", stepId: "zapier",
type: "ACTION", type: "ACTION",
internal: false,
description: "Trigger a Zapier Zap via webhooks", description: "Trigger a Zapier Zap via webhooks",
tagline: "Trigger a Zapier Zap", tagline: "Trigger a Zapier Zap",
icon: "ri-flashlight-line", icon: "ri-flashlight-line",