Browse Source

Adding concept of internal and external actions.

master
mike12345567 5 years ago
parent
commit
70bc68fb61
  1. 2
      packages/builder/cypress/integration/createAutomation.spec.js
  2. 14
      packages/builder/src/components/automation/AutomationBuilder/BlockList.svelte
  3. 1
      packages/server/src/automations/steps/bash.js
  4. 1
      packages/server/src/automations/steps/createRow.js
  5. 1
      packages/server/src/automations/steps/delay.js
  6. 1
      packages/server/src/automations/steps/deleteRow.js
  7. 1
      packages/server/src/automations/steps/discord.js
  8. 1
      packages/server/src/automations/steps/executeQuery.js
  9. 1
      packages/server/src/automations/steps/executeScript.js
  10. 1
      packages/server/src/automations/steps/filter.js
  11. 1
      packages/server/src/automations/steps/integromat.js
  12. 1
      packages/server/src/automations/steps/outgoingWebhook.js
  13. 1
      packages/server/src/automations/steps/sendSmtpEmail.js
  14. 1
      packages/server/src/automations/steps/serverLog.js
  15. 1
      packages/server/src/automations/steps/slack.js
  16. 1
      packages/server/src/automations/steps/updateRow.js
  17. 1
      packages/server/src/automations/steps/zapier.js

2
packages/builder/cypress/integration/createAutomation.spec.js

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

14
packages/builder/src/components/automation/AutomationBuilder/BlockList.svelte

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

1
packages/server/src/automations/steps/bash.js

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

1
packages/server/src/automations/steps/createRow.js

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

1
packages/server/src/automations/steps/delay.js

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

1
packages/server/src/automations/steps/deleteRow.js

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

1
packages/server/src/automations/steps/discord.js

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

1
packages/server/src/automations/steps/executeQuery.js

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

1
packages/server/src/automations/steps/executeScript.js

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

1
packages/server/src/automations/steps/filter.js

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

1
packages/server/src/automations/steps/integromat.js

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

1
packages/server/src/automations/steps/outgoingWebhook.js

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

1
packages/server/src/automations/steps/sendSmtpEmail.js

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

1
packages/server/src/automations/steps/serverLog.js

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

1
packages/server/src/automations/steps/slack.js

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

1
packages/server/src/automations/steps/updateRow.js

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

1
packages/server/src/automations/steps/zapier.js

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

Loading…
Cancel
Save