Trigger info data in the frontend

This commit is contained in:
Adria Navarro 2024-10-23 16:26:14 +02:00
parent ad475be4f7
commit a24728394f
1 changed files with 11 additions and 5 deletions

View File

@ -3,7 +3,7 @@
automationStore,
selectedAutomation,
permissions,
selectedAutomationDisplayData,
tables,
} from "stores/builder"
import {
Icon,
@ -17,6 +17,7 @@
AbsTooltip,
InlineAlert,
} from "@budibase/bbui"
import { sdk } from "@budibase/shared-core"
import AutomationBlockSetup from "../../SetupPanel/AutomationBlockSetup.svelte"
import CreateWebhookModal from "components/automation/Shared/CreateWebhookModal.svelte"
import ActionModal from "./ActionModal.svelte"
@ -51,7 +52,12 @@
$: isAppAction && setPermissions(role)
$: 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) {
if (!role || !automationId) {
@ -187,10 +193,10 @@
{block}
{webhookModal}
/>
{#if isTrigger && triggerInfo}
{#if triggerInfo}
<InlineAlert
header={triggerInfo.type}
message={`This trigger is tied to the "${triggerInfo.rowAction.name}" row action in your ${triggerInfo.table.name} table`}
header={triggerInfo.title}
message={`This trigger is tied to your "${triggerInfo.tableName}" table`}
/>
{/if}
{#if lastStep}