Trigger info data in the frontend
This commit is contained in:
parent
ad475be4f7
commit
a24728394f
|
@ -3,7 +3,7 @@
|
||||||
automationStore,
|
automationStore,
|
||||||
selectedAutomation,
|
selectedAutomation,
|
||||||
permissions,
|
permissions,
|
||||||
selectedAutomationDisplayData,
|
tables,
|
||||||
} from "stores/builder"
|
} from "stores/builder"
|
||||||
import {
|
import {
|
||||||
Icon,
|
Icon,
|
||||||
|
@ -17,6 +17,7 @@
|
||||||
AbsTooltip,
|
AbsTooltip,
|
||||||
InlineAlert,
|
InlineAlert,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
|
import { sdk } from "@budibase/shared-core"
|
||||||
import AutomationBlockSetup from "../../SetupPanel/AutomationBlockSetup.svelte"
|
import AutomationBlockSetup from "../../SetupPanel/AutomationBlockSetup.svelte"
|
||||||
import CreateWebhookModal from "components/automation/Shared/CreateWebhookModal.svelte"
|
import CreateWebhookModal from "components/automation/Shared/CreateWebhookModal.svelte"
|
||||||
import ActionModal from "./ActionModal.svelte"
|
import ActionModal from "./ActionModal.svelte"
|
||||||
|
@ -51,7 +52,12 @@
|
||||||
$: isAppAction && setPermissions(role)
|
$: isAppAction && setPermissions(role)
|
||||||
$: isAppAction && getPermissions(automationId)
|
$: isAppAction && getPermissions(automationId)
|
||||||
|
|
||||||
$: triggerInfo = $selectedAutomationDisplayData?.triggerInfo
|
$: triggerInfo = sdk.automations.isRowAction($selectedAutomation) && {
|
||||||
|
title: "Automation trigger",
|
||||||
|
tableName: $tables.list.find(
|
||||||
|
x => x._id === $selectedAutomation.definition.trigger.inputs?.tableId
|
||||||
|
)?.name,
|
||||||
|
}
|
||||||
|
|
||||||
async function setPermissions(role) {
|
async function setPermissions(role) {
|
||||||
if (!role || !automationId) {
|
if (!role || !automationId) {
|
||||||
|
@ -187,10 +193,10 @@
|
||||||
{block}
|
{block}
|
||||||
{webhookModal}
|
{webhookModal}
|
||||||
/>
|
/>
|
||||||
{#if isTrigger && triggerInfo}
|
{#if triggerInfo}
|
||||||
<InlineAlert
|
<InlineAlert
|
||||||
header={triggerInfo.type}
|
header={triggerInfo.title}
|
||||||
message={`This trigger is tied to the "${triggerInfo.rowAction.name}" row action in your ${triggerInfo.table.name} table`}
|
message={`This trigger is tied to your "${triggerInfo.tableName}" table`}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{#if lastStep}
|
{#if lastStep}
|
||||||
|
|
Loading…
Reference in New Issue