update feature array to be an object
This commit is contained in:
parent
70dfd9e8e5
commit
5a73b02827
|
@ -17,7 +17,11 @@
|
|||
import ActionModal from "./ActionModal.svelte"
|
||||
import FlowItemHeader from "./FlowItemHeader.svelte"
|
||||
import RoleSelect from "components/design/settings/controls/RoleSelect.svelte"
|
||||
import { ActionStepID, TriggerStepID } from "constants/backend/automations"
|
||||
import {
|
||||
ActionStepID,
|
||||
TriggerStepID,
|
||||
Features,
|
||||
} from "constants/backend/automations"
|
||||
import { permissions } from "stores/backend"
|
||||
|
||||
export let block
|
||||
|
@ -187,7 +191,7 @@
|
|||
{#if !isTrigger}
|
||||
<div>
|
||||
<div class="block-options">
|
||||
{#if block?.features?.includes("LOOPING")}
|
||||
{#if block?.features?.[Features.LOOPING] || !block.features}
|
||||
<ActionButton on:click={() => addLooping()} icon="Reuse">
|
||||
Add Looping
|
||||
</ActionButton>
|
||||
|
|
|
@ -27,3 +27,7 @@ export const ActionStepID = {
|
|||
zapier: "zapier",
|
||||
integromat: "integromat",
|
||||
}
|
||||
|
||||
export const Features = {
|
||||
LOOPING: "LOOPING",
|
||||
}
|
||||
|
|
|
@ -19,7 +19,9 @@ export const definition: AutomationStepSchema = {
|
|||
description: "Run a bash script",
|
||||
type: AutomationStepType.ACTION,
|
||||
internal: true,
|
||||
features: [AutomationFeature.LOOPING],
|
||||
features: {
|
||||
[AutomationFeature.LOOPING]: true,
|
||||
},
|
||||
stepId: AutomationActionStepId.EXECUTE_BASH,
|
||||
inputs: {},
|
||||
schema: {
|
||||
|
|
|
@ -15,7 +15,7 @@ export const definition: AutomationStepSchema = {
|
|||
"Collects specified data so it can be provided to the design section",
|
||||
type: AutomationStepType.ACTION,
|
||||
internal: true,
|
||||
features: [],
|
||||
features: {},
|
||||
stepId: AutomationActionStepId.COLLECT,
|
||||
inputs: {},
|
||||
schema: {
|
||||
|
|
|
@ -18,7 +18,9 @@ export const definition: AutomationStepSchema = {
|
|||
description: "Add a row to your database",
|
||||
type: AutomationStepType.ACTION,
|
||||
internal: true,
|
||||
features: [AutomationFeature.LOOPING],
|
||||
features: {
|
||||
[AutomationFeature.LOOPING]: true,
|
||||
},
|
||||
stepId: AutomationActionStepId.CREATE_ROW,
|
||||
inputs: {},
|
||||
schema: {
|
||||
|
|
|
@ -14,7 +14,7 @@ export const definition: AutomationStepSchema = {
|
|||
description: "Delay the automation until an amount of time has passed",
|
||||
stepId: AutomationActionStepId.DELAY,
|
||||
internal: true,
|
||||
features: [],
|
||||
features: {},
|
||||
inputs: {},
|
||||
schema: {
|
||||
inputs: {
|
||||
|
|
|
@ -19,7 +19,9 @@ export const definition: AutomationStepSchema = {
|
|||
type: AutomationStepType.ACTION,
|
||||
stepId: AutomationActionStepId.DELETE_ROW,
|
||||
internal: true,
|
||||
features: [AutomationFeature.LOOPING],
|
||||
features: {
|
||||
[AutomationFeature.LOOPING]: true,
|
||||
},
|
||||
inputs: {},
|
||||
schema: {
|
||||
inputs: {
|
||||
|
|
|
@ -20,7 +20,9 @@ export const definition: AutomationStepSchema = {
|
|||
stepId: AutomationActionStepId.discord,
|
||||
type: AutomationStepType.ACTION,
|
||||
internal: false,
|
||||
features: [AutomationFeature.LOOPING],
|
||||
features: {
|
||||
[AutomationFeature.LOOPING]: true,
|
||||
},
|
||||
inputs: {},
|
||||
schema: {
|
||||
inputs: {
|
||||
|
|
|
@ -19,7 +19,9 @@ export const definition: AutomationStepSchema = {
|
|||
type: AutomationStepType.ACTION,
|
||||
stepId: AutomationActionStepId.EXECUTE_QUERY,
|
||||
internal: true,
|
||||
features: [AutomationFeature.LOOPING],
|
||||
features: {
|
||||
[AutomationFeature.LOOPING]: true,
|
||||
},
|
||||
inputs: {},
|
||||
schema: {
|
||||
inputs: {
|
||||
|
|
|
@ -20,7 +20,9 @@ export const definition: AutomationStepSchema = {
|
|||
internal: true,
|
||||
stepId: AutomationActionStepId.EXECUTE_SCRIPT,
|
||||
inputs: {},
|
||||
features: [AutomationFeature.LOOPING],
|
||||
features: {
|
||||
[AutomationFeature.LOOPING]: true,
|
||||
},
|
||||
schema: {
|
||||
inputs: {
|
||||
properties: {
|
||||
|
|
|
@ -28,7 +28,7 @@ export const definition: AutomationStepSchema = {
|
|||
"Conditionally halt automations which do not meet certain conditions",
|
||||
type: AutomationStepType.LOGIC,
|
||||
internal: true,
|
||||
features: [],
|
||||
features: {},
|
||||
stepId: AutomationActionStepId.FILTER,
|
||||
inputs: {
|
||||
condition: FilterConditions.EQUAL,
|
||||
|
|
|
@ -13,7 +13,7 @@ export const definition: AutomationStepSchema = {
|
|||
description: "Loop",
|
||||
stepId: AutomationActionStepId.LOOP,
|
||||
internal: true,
|
||||
features: [],
|
||||
features: {},
|
||||
inputs: {},
|
||||
schema: {
|
||||
inputs: {
|
||||
|
|
|
@ -19,7 +19,9 @@ export const definition: AutomationStepSchema = {
|
|||
stepId: AutomationActionStepId.integromat,
|
||||
type: AutomationStepType.ACTION,
|
||||
internal: false,
|
||||
features: [AutomationFeature.LOOPING],
|
||||
features: {
|
||||
[AutomationFeature.LOOPING]: true,
|
||||
},
|
||||
inputs: {},
|
||||
schema: {
|
||||
inputs: {
|
||||
|
|
|
@ -22,6 +22,7 @@ export const definition: AutomationStepSchema = {
|
|||
description: "Interact with the OpenAI ChatGPT API.",
|
||||
type: AutomationStepType.ACTION,
|
||||
internal: true,
|
||||
features: {},
|
||||
stepId: AutomationActionStepId.OPENAI,
|
||||
inputs: {
|
||||
prompt: "",
|
||||
|
|
|
@ -33,7 +33,9 @@ export const definition: AutomationStepSchema = {
|
|||
description: "Send a request of specified method to a URL",
|
||||
type: AutomationStepType.ACTION,
|
||||
internal: true,
|
||||
features: [AutomationFeature.LOOPING],
|
||||
features: {
|
||||
[AutomationFeature.LOOPING]: true,
|
||||
},
|
||||
stepId: AutomationActionStepId.OUTGOING_WEBHOOK,
|
||||
inputs: {
|
||||
requestMethod: "POST",
|
||||
|
|
|
@ -43,7 +43,9 @@ export const definition: AutomationStepSchema = {
|
|||
type: AutomationStepType.ACTION,
|
||||
stepId: AutomationActionStepId.QUERY_ROWS,
|
||||
internal: true,
|
||||
features: [AutomationFeature.LOOPING],
|
||||
features: {
|
||||
[AutomationFeature.LOOPING]: true,
|
||||
},
|
||||
inputs: {},
|
||||
schema: {
|
||||
inputs: {
|
||||
|
|
|
@ -16,7 +16,9 @@ export const definition: AutomationStepSchema = {
|
|||
name: "Send Email (SMTP)",
|
||||
type: AutomationStepType.ACTION,
|
||||
internal: true,
|
||||
features: [AutomationFeature.LOOPING],
|
||||
features: {
|
||||
[AutomationFeature.LOOPING]: true,
|
||||
},
|
||||
stepId: AutomationActionStepId.SEND_EMAIL_SMTP,
|
||||
inputs: {},
|
||||
schema: {
|
||||
|
|
|
@ -20,7 +20,9 @@ export const definition: AutomationStepSchema = {
|
|||
description: "Logs the given text to the server (using console.log)",
|
||||
type: AutomationStepType.ACTION,
|
||||
internal: true,
|
||||
features: [AutomationFeature.LOOPING],
|
||||
features: {
|
||||
[AutomationFeature.LOOPING]: true,
|
||||
},
|
||||
stepId: AutomationActionStepId.SERVER_LOG,
|
||||
inputs: {
|
||||
text: "",
|
||||
|
|
|
@ -17,7 +17,9 @@ export const definition: AutomationStepSchema = {
|
|||
stepId: AutomationActionStepId.slack,
|
||||
type: AutomationStepType.ACTION,
|
||||
internal: false,
|
||||
features: [AutomationFeature.LOOPING],
|
||||
features: {
|
||||
[AutomationFeature.LOOPING]: true,
|
||||
},
|
||||
inputs: {},
|
||||
schema: {
|
||||
inputs: {
|
||||
|
|
|
@ -18,7 +18,9 @@ export const definition: AutomationStepSchema = {
|
|||
description: "Update a row in your database",
|
||||
type: AutomationStepType.ACTION,
|
||||
internal: true,
|
||||
features: [AutomationFeature.LOOPING],
|
||||
features: {
|
||||
[AutomationFeature.LOOPING]: true,
|
||||
},
|
||||
stepId: AutomationActionStepId.UPDATE_ROW,
|
||||
inputs: {},
|
||||
schema: {
|
||||
|
|
|
@ -14,7 +14,9 @@ export const definition: AutomationStepSchema = {
|
|||
stepId: AutomationActionStepId.zapier,
|
||||
type: AutomationStepType.ACTION,
|
||||
internal: false,
|
||||
features: [AutomationFeature.LOOPING],
|
||||
features: {
|
||||
[AutomationFeature.LOOPING]: true,
|
||||
},
|
||||
description: "Trigger a Zapier Zap via webhooks",
|
||||
tagline: "Trigger a Zapier Zap",
|
||||
icon: "ri-flashlight-line",
|
||||
|
|
|
@ -124,7 +124,7 @@ export interface AutomationStepSchema {
|
|||
outputs: InputOutputBlock
|
||||
}
|
||||
custom?: boolean
|
||||
features?: AutomationFeature[]
|
||||
features?: Partial<Record<AutomationFeature, boolean>>
|
||||
}
|
||||
|
||||
export enum AutomationFeature {
|
||||
|
|
Loading…
Reference in New Issue