wip: work on routing in automation tab
This commit is contained in:
parent
de56953d70
commit
4e85caa7b0
|
@ -9,6 +9,9 @@
|
|||
onMount(() => {
|
||||
automationStore.actions.fetch()
|
||||
})
|
||||
function selectAutomation(automation) {
|
||||
automationStore.actions.select(automation)
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="automations-list">
|
||||
|
@ -18,7 +21,7 @@
|
|||
icon="ri-stackshare-line"
|
||||
text={automation.name}
|
||||
selected={automation._id === selectedAutomationId}
|
||||
on:click={() => automationStore.actions.select(automation)}>
|
||||
on:click={() => selectAutomation(automation)}>
|
||||
<EditAutomationPopover {automation} />
|
||||
</NavItem>
|
||||
{/each}
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
<script>
|
||||
import { store } from "builderStore"
|
||||
import { automationStore } from "builderStore"
|
||||
import { params } from "@sveltech/routify"
|
||||
|
||||
store.actions.layouts.select($params.layout)
|
||||
if ($params.automation) {
|
||||
const automation = $automationStore.automations.find(
|
||||
m => m._id === $params.automation
|
||||
)
|
||||
if (automation) {
|
||||
automationStore.actions.select(automation)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
|
|
|
@ -1,5 +1,21 @@
|
|||
<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 />
|
||||
|
|
Loading…
Reference in New Issue