adds routing to the automation tab
This commit is contained in:
parent
4e85caa7b0
commit
2900704a4c
|
@ -1,12 +1,9 @@
|
|||
<script>
|
||||
import { automationStore, backendUiStore } from "builderStore"
|
||||
import { automationStore } from "builderStore"
|
||||
import Flowchart from "./FlowChart/FlowChart.svelte"
|
||||
import BlockList from "./BlockList.svelte"
|
||||
|
||||
$: automation = $automationStore.selectedAutomation?.automation
|
||||
$: automationLive = automation?.live
|
||||
$: instanceId = $backendUiStore.selectedDatabase._id
|
||||
$: automationCount = $automationStore.automations?.length ?? 0
|
||||
|
||||
function onSelect(block) {
|
||||
automationStore.update(state => {
|
||||
|
@ -19,14 +16,4 @@
|
|||
{#if automation}
|
||||
<BlockList />
|
||||
<Flowchart {automation} {onSelect} />
|
||||
{:else if automationCount === 0}
|
||||
<i>Create your first automation to get started</i>
|
||||
{:else}<i>Select an automation to edit</i>{/if}
|
||||
|
||||
<style>
|
||||
i {
|
||||
font-size: var(--font-size-m);
|
||||
color: var(--grey-5);
|
||||
margin-top: 2px;
|
||||
}
|
||||
</style>
|
||||
{/if}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
import { automationStore } from "builderStore"
|
||||
import { DropdownMenu, Modal } from "@budibase/bbui"
|
||||
import { DropdownContainer, DropdownItem } from "components/common/Dropdowns"
|
||||
import analytics from "analytics"
|
||||
import CreateWebhookModal from "../Shared/CreateWebhookModal.svelte"
|
||||
|
||||
$: hasTrigger = $automationStore.selectedAutomation.hasTrigger()
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<script>
|
||||
import { onMount } from "svelte"
|
||||
import { goto } from "@sveltech/routify"
|
||||
import { automationStore } from "builderStore"
|
||||
import NavItem from "components/common/NavItem.svelte"
|
||||
import EditAutomationPopover from "./EditAutomationPopover.svelte"
|
||||
|
@ -11,6 +12,7 @@
|
|||
})
|
||||
function selectAutomation(automation) {
|
||||
automationStore.actions.select(automation)
|
||||
$goto(`./${automation._id}`)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<script>
|
||||
import { store, backendUiStore, automationStore } from "builderStore"
|
||||
import { backendUiStore, automationStore } from "builderStore"
|
||||
import { goto } from "@sveltech/routify"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import { Input, ModalContent } from "@budibase/bbui"
|
||||
import analytics from "analytics"
|
||||
|
@ -15,6 +16,7 @@
|
|||
instanceId,
|
||||
})
|
||||
notifier.success(`Automation ${name} created.`)
|
||||
$goto(`./${$automationStore.selectedAutomation.automation._id}`)
|
||||
analytics.captureEvent("Automation Created", { name })
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
import { TableNames } from "constants"
|
||||
import EditTablePopover from "./popovers/EditTablePopover.svelte"
|
||||
import EditViewPopover from "./popovers/EditViewPopover.svelte"
|
||||
import { Switcher } from "@budibase/bbui"
|
||||
import NavItem from "components/common/NavItem.svelte"
|
||||
|
||||
$: selectedView =
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<script>
|
||||
import { onMount } from 'svelte'
|
||||
import { automationStore } from "builderStore"
|
||||
import AutomationBuilder from "components/automation/AutomationBuilder/AutomationBuilder.svelte"
|
||||
|
||||
onMount(async () => {
|
||||
console.log('Automation Store: ', $automationStore)
|
||||
console.log('Automation Store Methods: ', automationStore)
|
||||
// navigate to first automation in list, if not already selected
|
||||
// if (
|
||||
// !$leftover &&
|
||||
// $backendUiStore.tables.length > 0 &&
|
||||
// (!$backendUiStore.selectedTable || !$backendUiStore.selectedTable._id)
|
||||
// ) {
|
||||
// // this file routes as .../tables/index, so, go up one.
|
||||
// $goto(`../${$backendUiStore.tables[0]._id}`)
|
||||
// }
|
||||
})
|
||||
</script>
|
||||
|
||||
<AutomationBuilder />
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
<script>
|
||||
import { onMount } from 'svelte'
|
||||
import { automationStore } from "builderStore"
|
||||
import AutomationBuilder from "components/automation/AutomationBuilder/AutomationBuilder.svelte"
|
||||
|
||||
$: automationCount = $automationStore.automations?.length ?? 0
|
||||
|
||||
onMount(async () => {
|
||||
console.log('Automation Store: ', $automationStore)
|
||||
|
@ -18,4 +19,15 @@
|
|||
})
|
||||
</script>
|
||||
|
||||
<AutomationBuilder />
|
||||
|
||||
{#if automationCount === 0}
|
||||
<i>Create your first automation to get started</i>
|
||||
{:else}<i>Select an automation to edit</i>{/if}
|
||||
|
||||
<style>
|
||||
i {
|
||||
font-size: var(--font-size-m);
|
||||
color: var(--grey-5);
|
||||
margin-top: 2px;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue