Browse Source

adds working automation routing

gh-pages
Keviin Åberg Kultalahti 6 years ago
parent
commit
2bafdfb6c2
  1. 22
      packages/builder/src/pages/[application]/automate/[automation]/index.svelte
  2. 29
      packages/builder/src/pages/[application]/automate/index.svelte

22
packages/builder/src/pages/[application]/automate/[automation]/index.svelte

@ -1,22 +1,6 @@
<script>
import { onMount } from 'svelte'
import { automationStore } from "builderStore"
import AutomationBuilder from "components/automation/AutomationBuilder/AutomationBuilder.svelte"
import AutomationBuilder from "components/automation/AutomationBuilder/AutomationBuilder.svelte"
</script>
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 />
<AutomationBuilder />

29
packages/builder/src/pages/[application]/automate/index.svelte

@ -1,22 +1,20 @@
<script>
import { goto, leftover } from "@sveltech/routify"
import { onMount } from 'svelte'
import { automationStore } from "builderStore"
$: automationCount = $automationStore.automations?.length ?? 0
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}`)
// }
})
// navigate to first automation in list, if not already selected
if (
!$leftover &&
$automationStore.automations.length > 0 &&
(!$automationStore.selectedAutomation || !$automationStore.selectedAutomation?.automation?._id)
) {
$goto(`../${$automationStore.automations[0]._id}`)
}
})
</script>
@ -24,10 +22,3 @@
<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…
Cancel
Save