2020-05-27 22:51:32 +02:00
|
|
|
<script>
|
2020-10-26 13:18:34 +01:00
|
|
|
import TableSelector from "./TableSelector.svelte"
|
|
|
|
import RowSelector from "./RowSelector.svelte"
|
2022-07-26 17:33:27 +02:00
|
|
|
import FieldSelector from "./FieldSelector.svelte"
|
2021-01-08 18:25:06 +01:00
|
|
|
import SchemaSetup from "./SchemaSetup.svelte"
|
2021-09-16 22:15:09 +02:00
|
|
|
import {
|
|
|
|
Button,
|
|
|
|
Input,
|
|
|
|
Select,
|
|
|
|
Label,
|
|
|
|
ActionButton,
|
|
|
|
Drawer,
|
2021-10-11 20:38:43 +02:00
|
|
|
Modal,
|
2022-01-11 17:54:43 +01:00
|
|
|
Detail,
|
2022-01-25 16:44:08 +01:00
|
|
|
notifications,
|
2021-09-16 22:15:09 +02:00
|
|
|
} from "@budibase/bbui"
|
2021-10-11 20:38:43 +02:00
|
|
|
import CreateWebhookModal from "components/automation/Shared/CreateWebhookModal.svelte"
|
|
|
|
|
2020-09-21 14:49:34 +02:00
|
|
|
import { automationStore } from "builderStore"
|
2021-09-16 22:15:09 +02:00
|
|
|
import { tables } from "stores/backend"
|
2020-10-26 17:04:02 +01:00
|
|
|
import WebhookDisplay from "../Shared/WebhookDisplay.svelte"
|
2021-04-30 17:17:57 +02:00
|
|
|
import DrawerBindableInput from "../../common/bindings/DrawerBindableInput.svelte"
|
|
|
|
import AutomationBindingPanel from "../../common/bindings/ServerBindingPanel.svelte"
|
2021-05-06 19:31:03 +02:00
|
|
|
import CodeEditorModal from "./CodeEditorModal.svelte"
|
|
|
|
import QuerySelector from "./QuerySelector.svelte"
|
|
|
|
import QueryParamSelector from "./QueryParamSelector.svelte"
|
2021-05-18 23:20:41 +02:00
|
|
|
import CronBuilder from "./CronBuilder.svelte"
|
2021-05-06 19:31:03 +02:00
|
|
|
import Editor from "components/integration/QueryEditor.svelte"
|
2021-09-16 22:15:09 +02:00
|
|
|
import ModalBindableInput from "components/common/bindings/ModalBindableInput.svelte"
|
2022-04-26 15:22:32 +02:00
|
|
|
import FilterDrawer from "components/design/settings/controls/FilterEditor/FilterDrawer.svelte"
|
2022-01-20 12:19:37 +01:00
|
|
|
import { LuceneUtils } from "@budibase/frontend-core"
|
2022-02-15 15:59:11 +01:00
|
|
|
import { getSchemaForTable } from "builderStore/dataBinding"
|
2022-04-26 11:47:57 +02:00
|
|
|
import { Utils } from "@budibase/frontend-core"
|
2022-07-15 18:13:45 +02:00
|
|
|
import { TriggerStepID, ActionStepID } from "constants/backend/automations"
|
2022-07-26 17:33:27 +02:00
|
|
|
import { cloneDeep } from "lodash/fp"
|
2020-05-28 21:20:03 +02:00
|
|
|
|
2020-09-11 15:23:31 +02:00
|
|
|
export let block
|
2021-09-16 22:15:09 +02:00
|
|
|
export let testData
|
|
|
|
export let schemaProperties
|
|
|
|
export let isTestModal = false
|
2022-12-07 09:57:17 +01:00
|
|
|
|
2021-10-11 20:38:43 +02:00
|
|
|
let webhookModal
|
2021-09-16 22:15:09 +02:00
|
|
|
let drawer
|
|
|
|
let fillWidth = true
|
2022-01-11 17:54:43 +01:00
|
|
|
let codeBindingOpen = false
|
2022-07-26 17:33:27 +02:00
|
|
|
let inputData
|
2021-10-11 20:38:43 +02:00
|
|
|
|
2022-12-07 09:57:17 +01:00
|
|
|
$: filters = lookForFilters(schemaProperties) || []
|
|
|
|
$: tempFilters = filters
|
2020-10-26 17:04:02 +01:00
|
|
|
$: stepId = block.stepId
|
2020-09-17 15:18:22 +02:00
|
|
|
$: bindings = getAvailableBindings(
|
2021-09-16 22:15:09 +02:00
|
|
|
block || $automationStore.selectedBlock,
|
2020-09-21 14:49:34 +02:00
|
|
|
$automationStore.selectedAutomation?.automation?.definition
|
2020-09-17 14:43:52 +02:00
|
|
|
)
|
2022-07-26 17:33:27 +02:00
|
|
|
|
|
|
|
$: getInputData(testData, block.inputs)
|
|
|
|
const getInputData = (testData, blockInputs) => {
|
2022-07-26 18:22:42 +02:00
|
|
|
let newInputData = testData || blockInputs
|
2022-07-26 17:33:27 +02:00
|
|
|
|
|
|
|
if (block.event === "app:trigger" && !newInputData?.fields) {
|
|
|
|
newInputData = cloneDeep(blockInputs)
|
|
|
|
}
|
|
|
|
|
|
|
|
inputData = newInputData
|
|
|
|
}
|
|
|
|
|
2021-09-16 22:15:09 +02:00
|
|
|
$: tableId = inputData ? inputData.tableId : null
|
|
|
|
$: table = tableId
|
|
|
|
? $tables.list.find(table => table._id === inputData.tableId)
|
|
|
|
: { schema: {} }
|
2022-02-15 15:59:11 +01:00
|
|
|
$: schema = getSchemaForTable(tableId, { searchableSchema: true }).schema
|
|
|
|
$: schemaFields = Object.values(schema || {})
|
2022-05-11 12:25:53 +02:00
|
|
|
$: queryLimit = tableId?.includes("datasource") ? "∞" : "1000"
|
2022-07-15 14:39:47 +02:00
|
|
|
$: isTrigger = block?.type === "TRIGGER"
|
2021-09-16 22:15:09 +02:00
|
|
|
|
2022-04-26 11:47:57 +02:00
|
|
|
const onChange = Utils.sequential(async (e, key) => {
|
2022-01-25 16:44:08 +01:00
|
|
|
try {
|
|
|
|
if (isTestModal) {
|
|
|
|
// Special case for webhook, as it requires a body, but the schema already brings back the body's contents
|
2022-07-15 18:13:45 +02:00
|
|
|
if (stepId === TriggerStepID.WEBHOOK) {
|
2022-01-25 16:44:08 +01:00
|
|
|
automationStore.actions.addTestDataToAutomation({
|
|
|
|
body: {
|
|
|
|
[key]: e.detail,
|
2022-08-10 18:09:51 +02:00
|
|
|
...$automationStore.selectedAutomation.automation.testData?.body,
|
2022-01-25 16:44:08 +01:00
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
2021-10-12 12:00:49 +02:00
|
|
|
automationStore.actions.addTestDataToAutomation({
|
2022-01-25 16:44:08 +01:00
|
|
|
[key]: e.detail,
|
2021-10-12 12:00:49 +02:00
|
|
|
})
|
2022-01-25 16:44:08 +01:00
|
|
|
testData[key] = e.detail
|
|
|
|
} else {
|
|
|
|
block.inputs[key] = e.detail
|
2021-09-16 22:15:09 +02:00
|
|
|
}
|
2022-07-26 17:33:27 +02:00
|
|
|
|
|
|
|
await automationStore.actions.save(
|
|
|
|
$automationStore.selectedAutomation?.automation
|
|
|
|
)
|
2022-01-25 16:44:08 +01:00
|
|
|
} catch (error) {
|
|
|
|
notifications.error("Error saving automation")
|
2021-11-17 14:49:34 +01:00
|
|
|
}
|
2022-04-26 11:47:57 +02:00
|
|
|
})
|
2020-09-17 14:43:52 +02:00
|
|
|
|
2020-09-21 14:49:34 +02:00
|
|
|
function getAvailableBindings(block, automation) {
|
|
|
|
if (!block || !automation) {
|
2020-09-17 14:43:52 +02:00
|
|
|
return []
|
|
|
|
}
|
2020-09-17 15:18:22 +02:00
|
|
|
// Find previous steps to the selected one
|
2020-09-21 14:49:34 +02:00
|
|
|
let allSteps = [...automation.steps]
|
2022-04-11 11:26:59 +02:00
|
|
|
|
2020-09-21 14:49:34 +02:00
|
|
|
if (automation.trigger) {
|
|
|
|
allSteps = [automation.trigger, ...allSteps]
|
2020-09-17 15:18:22 +02:00
|
|
|
}
|
2022-04-11 11:26:59 +02:00
|
|
|
let blockIdx = allSteps.findIndex(step => step.id === block.id)
|
2020-09-17 15:18:22 +02:00
|
|
|
|
2022-04-11 11:26:59 +02:00
|
|
|
// Extract all outputs from all previous steps as available bindins
|
2020-09-17 14:43:52 +02:00
|
|
|
let bindings = []
|
2022-09-23 14:35:27 +02:00
|
|
|
let loopBlockCount = 0
|
2020-09-17 14:43:52 +02:00
|
|
|
for (let idx = 0; idx < blockIdx; idx++) {
|
2022-09-23 14:35:27 +02:00
|
|
|
let wasLoopBlock = allSteps[idx - 1]?.stepId === ActionStepID.LOOP
|
2022-04-12 00:10:29 +02:00
|
|
|
let isLoopBlock =
|
2022-07-15 18:13:45 +02:00
|
|
|
allSteps[idx]?.stepId === ActionStepID.LOOP &&
|
2022-04-12 00:10:29 +02:00
|
|
|
allSteps.find(x => x.blockToLoop === block.id)
|
|
|
|
|
2022-10-25 16:19:07 +02:00
|
|
|
// If the previous block was a loop block, decrement the index so the following
|
2022-04-12 00:10:29 +02:00
|
|
|
// steps are in the correct order
|
|
|
|
if (wasLoopBlock) {
|
2022-09-23 14:35:27 +02:00
|
|
|
loopBlockCount++
|
|
|
|
continue
|
2022-04-12 00:10:29 +02:00
|
|
|
}
|
2022-04-11 11:26:59 +02:00
|
|
|
|
|
|
|
let schema = allSteps[idx]?.schema?.outputs?.properties ?? {}
|
2022-04-12 00:10:29 +02:00
|
|
|
|
|
|
|
// If its a Loop Block, we need to add this custom schema
|
2022-04-11 11:26:59 +02:00
|
|
|
if (isLoopBlock) {
|
|
|
|
schema = {
|
|
|
|
currentItem: {
|
|
|
|
type: "string",
|
|
|
|
description: "the item currently being executed",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const outputs = Object.entries(schema)
|
|
|
|
|
2020-09-17 14:43:52 +02:00
|
|
|
bindings = bindings.concat(
|
2021-12-08 11:59:26 +01:00
|
|
|
outputs.map(([name, value]) => {
|
2022-04-11 11:26:59 +02:00
|
|
|
let runtimeName = isLoopBlock
|
|
|
|
? `loop.${name}`
|
2022-04-18 11:05:43 +02:00
|
|
|
: block.name.startsWith("JS")
|
2022-09-23 14:35:27 +02:00
|
|
|
? `steps[${idx - loopBlockCount}].${name}`
|
|
|
|
: `steps.${idx - loopBlockCount}.${name}`
|
2022-03-29 11:29:51 +02:00
|
|
|
const runtime = idx === 0 ? `trigger.${name}` : runtimeName
|
2021-12-08 11:59:26 +01:00
|
|
|
return {
|
|
|
|
label: runtime,
|
|
|
|
type: value.type,
|
|
|
|
description: value.description,
|
2022-04-11 11:26:59 +02:00
|
|
|
category:
|
|
|
|
idx === 0
|
|
|
|
? "Trigger outputs"
|
|
|
|
: isLoopBlock
|
|
|
|
? "Loop Outputs"
|
2022-09-23 14:35:27 +02:00
|
|
|
: `Step ${idx - loopBlockCount} outputs`,
|
2021-12-08 11:59:26 +01:00
|
|
|
path: runtime,
|
|
|
|
}
|
|
|
|
})
|
2020-09-17 14:43:52 +02:00
|
|
|
)
|
|
|
|
}
|
2022-03-29 11:29:51 +02:00
|
|
|
|
2020-09-17 14:43:52 +02:00
|
|
|
return bindings
|
|
|
|
}
|
2021-09-16 22:15:09 +02:00
|
|
|
|
|
|
|
function lookForFilters(properties) {
|
|
|
|
if (!properties) {
|
|
|
|
return []
|
|
|
|
}
|
|
|
|
let filters
|
|
|
|
const inputs = testData ? testData : block.inputs
|
|
|
|
for (let [key, field] of properties) {
|
|
|
|
// need to look for the builder definition (keyed separately, see saveFilters)
|
|
|
|
const defKey = `${key}-def`
|
|
|
|
if (field.customType === "filters" && inputs?.[defKey]) {
|
|
|
|
filters = inputs[defKey]
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return filters || []
|
|
|
|
}
|
|
|
|
|
|
|
|
function saveFilters(key) {
|
2022-01-20 12:19:37 +01:00
|
|
|
const filters = LuceneUtils.buildLuceneQuery(tempFilters)
|
2021-09-16 22:15:09 +02:00
|
|
|
const defKey = `${key}-def`
|
|
|
|
inputData[key] = filters
|
|
|
|
inputData[defKey] = tempFilters
|
|
|
|
onChange({ detail: filters }, key)
|
|
|
|
// need to store the builder definition in the automation
|
|
|
|
onChange({ detail: tempFilters }, defKey)
|
|
|
|
drawer.hide()
|
|
|
|
}
|
2020-05-27 22:51:32 +02:00
|
|
|
</script>
|
|
|
|
|
2021-04-22 11:58:04 +02:00
|
|
|
<div class="fields">
|
2021-09-16 22:15:09 +02:00
|
|
|
{#each schemaProperties as [key, value]}
|
2021-04-22 11:58:04 +02:00
|
|
|
<div class="block-field">
|
2022-07-26 17:33:27 +02:00
|
|
|
{#if key !== "fields"}
|
|
|
|
<Label
|
|
|
|
tooltip={value.title === "Binding / Value"
|
|
|
|
? "If using the String input type, please use a comma or newline separated string"
|
|
|
|
: null}>{value.title || (key === "row" ? "Table" : key)}</Label
|
|
|
|
>
|
|
|
|
{/if}
|
2021-05-04 10:55:14 +02:00
|
|
|
{#if value.type === "string" && value.enum}
|
2021-04-22 11:58:04 +02:00
|
|
|
<Select
|
2021-09-16 22:15:09 +02:00
|
|
|
on:change={e => onChange(e, key)}
|
|
|
|
value={inputData[key]}
|
2021-04-22 11:58:04 +02:00
|
|
|
options={value.enum}
|
2021-05-04 10:55:14 +02:00
|
|
|
getOptionLabel={(x, idx) => (value.pretty ? value.pretty[idx] : x)}
|
|
|
|
/>
|
2021-09-16 22:15:09 +02:00
|
|
|
{:else if value.customType === "column"}
|
|
|
|
<Select
|
|
|
|
on:change={e => onChange(e, key)}
|
|
|
|
value={inputData[key]}
|
2022-03-28 17:26:37 +02:00
|
|
|
options={Object.keys(table?.schema || {})}
|
2021-09-16 22:15:09 +02:00
|
|
|
/>
|
|
|
|
{:else if value.customType === "filters"}
|
|
|
|
<ActionButton on:click={drawer.show}>Define filters</ActionButton>
|
|
|
|
<Drawer bind:this={drawer} {fillWidth} title="Filtering">
|
2022-12-07 09:57:17 +01:00
|
|
|
<Button cta slot="buttons" on:click={() => saveFilters(key)}>
|
|
|
|
Save
|
|
|
|
</Button>
|
2021-09-16 22:15:09 +02:00
|
|
|
<FilterDrawer
|
|
|
|
slot="body"
|
2022-12-07 09:57:17 +01:00
|
|
|
{filters}
|
2021-09-16 22:15:09 +02:00
|
|
|
{bindings}
|
|
|
|
{schemaFields}
|
|
|
|
panel={AutomationBindingPanel}
|
2022-09-23 14:35:27 +02:00
|
|
|
fillWidth
|
2022-12-07 09:57:17 +01:00
|
|
|
on:change={e => (tempFilters = e.detail)}
|
2021-09-16 22:15:09 +02:00
|
|
|
/>
|
|
|
|
</Drawer>
|
2021-05-04 10:55:14 +02:00
|
|
|
{:else if value.customType === "password"}
|
2021-09-16 22:15:09 +02:00
|
|
|
<Input
|
|
|
|
type="password"
|
|
|
|
on:change={e => onChange(e, key)}
|
|
|
|
value={inputData[key]}
|
2021-05-04 12:04:42 +02:00
|
|
|
/>
|
2021-09-16 22:15:09 +02:00
|
|
|
{:else if value.customType === "email"}
|
|
|
|
{#if isTestModal}
|
|
|
|
<ModalBindableInput
|
|
|
|
title={value.title}
|
|
|
|
value={inputData[key]}
|
|
|
|
panel={AutomationBindingPanel}
|
|
|
|
type="email"
|
|
|
|
on:change={e => onChange(e, key)}
|
|
|
|
{bindings}
|
|
|
|
fillWidth
|
2022-04-25 16:17:35 +02:00
|
|
|
updateOnChange={false}
|
2021-09-16 22:15:09 +02:00
|
|
|
/>
|
|
|
|
{:else}
|
|
|
|
<DrawerBindableInput
|
|
|
|
fillWidth
|
|
|
|
title={value.title}
|
|
|
|
panel={AutomationBindingPanel}
|
|
|
|
type="email"
|
|
|
|
value={inputData[key]}
|
|
|
|
on:change={e => onChange(e, key)}
|
|
|
|
{bindings}
|
2021-10-12 17:52:56 +02:00
|
|
|
allowJS={false}
|
2022-04-25 15:51:36 +02:00
|
|
|
updateOnChange={false}
|
2022-07-20 17:38:42 +02:00
|
|
|
drawerLeft="260px"
|
2021-09-16 22:15:09 +02:00
|
|
|
/>
|
|
|
|
{/if}
|
2021-05-10 15:50:37 +02:00
|
|
|
{:else if value.customType === "query"}
|
2021-09-16 22:15:09 +02:00
|
|
|
<QuerySelector
|
|
|
|
on:change={e => onChange(e, key)}
|
|
|
|
value={inputData[key]}
|
|
|
|
/>
|
2021-05-18 23:20:41 +02:00
|
|
|
{:else if value.customType === "cron"}
|
2021-09-16 22:15:09 +02:00
|
|
|
<CronBuilder on:change={e => onChange(e, key)} value={inputData[key]} />
|
2021-05-10 15:50:37 +02:00
|
|
|
{:else if value.customType === "queryParams"}
|
2021-09-16 22:15:09 +02:00
|
|
|
<QueryParamSelector
|
|
|
|
on:change={e => onChange(e, key)}
|
|
|
|
value={inputData[key]}
|
|
|
|
{bindings}
|
|
|
|
/>
|
2021-05-04 12:04:42 +02:00
|
|
|
{:else if value.customType === "table"}
|
2021-09-16 22:15:09 +02:00
|
|
|
<TableSelector
|
2022-07-15 14:39:47 +02:00
|
|
|
{isTrigger}
|
2021-09-16 22:15:09 +02:00
|
|
|
value={inputData[key]}
|
|
|
|
on:change={e => onChange(e, key)}
|
|
|
|
/>
|
2021-05-04 10:55:14 +02:00
|
|
|
{:else if value.customType === "row"}
|
2021-09-16 22:15:09 +02:00
|
|
|
<RowSelector
|
2022-02-15 14:03:24 +01:00
|
|
|
{block}
|
2021-09-16 22:15:09 +02:00
|
|
|
value={inputData[key]}
|
|
|
|
on:change={e => onChange(e, key)}
|
|
|
|
{bindings}
|
2022-04-29 12:37:40 +02:00
|
|
|
{isTestModal}
|
2021-09-16 22:15:09 +02:00
|
|
|
/>
|
2021-05-04 10:55:14 +02:00
|
|
|
{:else if value.customType === "webhookUrl"}
|
2021-10-11 20:38:43 +02:00
|
|
|
<WebhookDisplay
|
|
|
|
on:change={e => onChange(e, key)}
|
|
|
|
value={inputData[key]}
|
|
|
|
/>
|
2022-07-26 17:33:27 +02:00
|
|
|
{:else if value.customType === "fields"}
|
|
|
|
<FieldSelector
|
|
|
|
{block}
|
|
|
|
value={inputData[key]}
|
|
|
|
on:change={e => onChange(e, key)}
|
|
|
|
{bindings}
|
|
|
|
{isTestModal}
|
|
|
|
/>
|
2021-05-04 10:55:14 +02:00
|
|
|
{:else if value.customType === "triggerSchema"}
|
2021-09-20 17:23:33 +02:00
|
|
|
<SchemaSetup on:change={e => onChange(e, key)} value={inputData[key]} />
|
2021-05-06 19:31:03 +02:00
|
|
|
{:else if value.customType === "code"}
|
|
|
|
<CodeEditorModal>
|
2022-01-11 17:54:43 +01:00
|
|
|
<ActionButton
|
|
|
|
on:click={() => (codeBindingOpen = !codeBindingOpen)}
|
|
|
|
quiet
|
|
|
|
icon={codeBindingOpen ? "ChevronDown" : "ChevronRight"}
|
|
|
|
>
|
|
|
|
<Detail size="S">Bindings</Detail>
|
|
|
|
</ActionButton>
|
|
|
|
{#if codeBindingOpen}
|
|
|
|
<pre>{JSON.stringify(bindings, null, 2)}</pre>
|
|
|
|
{/if}
|
2021-05-06 19:31:03 +02:00
|
|
|
<Editor
|
|
|
|
mode="javascript"
|
2021-05-10 15:50:37 +02:00
|
|
|
on:change={e => {
|
2021-11-09 19:07:21 +01:00
|
|
|
// need to pass without the value inside
|
|
|
|
onChange({ detail: e.detail.value }, key)
|
2021-09-16 22:15:09 +02:00
|
|
|
inputData[key] = e.detail.value
|
2021-05-06 19:31:03 +02:00
|
|
|
}}
|
2021-09-16 22:15:09 +02:00
|
|
|
value={inputData[key]}
|
2021-05-06 19:31:03 +02:00
|
|
|
/>
|
|
|
|
</CodeEditorModal>
|
2022-03-25 10:26:55 +01:00
|
|
|
{:else if value.customType === "loopOption"}
|
|
|
|
<Select
|
|
|
|
on:change={e => onChange(e, key)}
|
|
|
|
autoWidth
|
|
|
|
value={inputData[key]}
|
|
|
|
options={["Array", "String"]}
|
|
|
|
defaultValue={"Array"}
|
|
|
|
/>
|
2021-12-08 11:14:30 +01:00
|
|
|
{:else if value.type === "string" || value.type === "number" || value.type === "integer"}
|
2021-09-16 22:15:09 +02:00
|
|
|
{#if isTestModal}
|
|
|
|
<ModalBindableInput
|
|
|
|
title={value.title}
|
|
|
|
value={inputData[key]}
|
|
|
|
panel={AutomationBindingPanel}
|
|
|
|
type={value.customType}
|
|
|
|
on:change={e => onChange(e, key)}
|
|
|
|
{bindings}
|
2022-04-25 16:17:35 +02:00
|
|
|
updateOnChange={false}
|
2021-09-16 22:15:09 +02:00
|
|
|
/>
|
|
|
|
{:else}
|
|
|
|
<div class="test">
|
|
|
|
<DrawerBindableInput
|
|
|
|
fillWidth={true}
|
|
|
|
title={value.title}
|
|
|
|
panel={AutomationBindingPanel}
|
|
|
|
type={value.customType}
|
|
|
|
value={inputData[key]}
|
|
|
|
on:change={e => onChange(e, key)}
|
|
|
|
{bindings}
|
2022-04-25 15:51:36 +02:00
|
|
|
updateOnChange={false}
|
2022-05-11 12:25:53 +02:00
|
|
|
placeholder={value.customType === "queryLimit" ? queryLimit : ""}
|
2022-07-20 17:38:42 +02:00
|
|
|
drawerLeft="260px"
|
2021-09-16 22:15:09 +02:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
{/if}
|
2021-04-22 11:58:04 +02:00
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
{/each}
|
|
|
|
</div>
|
2021-10-11 20:38:43 +02:00
|
|
|
<Modal bind:this={webhookModal} width="30%">
|
|
|
|
<CreateWebhookModal />
|
|
|
|
</Modal>
|
|
|
|
|
2022-07-15 18:13:45 +02:00
|
|
|
{#if stepId === TriggerStepID.WEBHOOK}
|
2021-04-22 11:58:04 +02:00
|
|
|
<Button secondary on:click={() => webhookModal.show()}>Set Up Webhook</Button>
|
2020-10-27 16:50:34 +01:00
|
|
|
{/if}
|
2020-05-28 21:20:03 +02:00
|
|
|
|
|
|
|
<style>
|
2021-04-22 11:58:04 +02:00
|
|
|
.fields {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: flex-start;
|
|
|
|
align-items: stretch;
|
|
|
|
gap: var(--spacing-s);
|
|
|
|
}
|
|
|
|
|
2020-05-28 21:20:03 +02:00
|
|
|
.block-field {
|
2020-06-26 15:32:45 +02:00
|
|
|
display: grid;
|
2021-07-14 16:46:00 +02:00
|
|
|
grid-gap: 5px;
|
2020-05-28 21:20:03 +02:00
|
|
|
}
|
2020-06-04 20:27:25 +02:00
|
|
|
|
2021-09-16 22:15:09 +02:00
|
|
|
.test :global(.drawer) {
|
|
|
|
width: 10000px !important;
|
2020-05-28 21:20:03 +02:00
|
|
|
}
|
|
|
|
</style>
|