Navigate to new layout after creating it
This commit is contained in:
parent
31f0b51039
commit
112fce654c
|
@ -1,19 +1,15 @@
|
||||||
<script>
|
<script>
|
||||||
import { goto } from "@sveltech/routify"
|
import { goto } from "@sveltech/routify"
|
||||||
import api from "builderStore/api"
|
|
||||||
import { notifier } from "builderStore/store/notifications"
|
import { notifier } from "builderStore/store/notifications"
|
||||||
import { store, backendUiStore, allScreens } from "builderStore"
|
import { store } from "builderStore"
|
||||||
import { Input, ModalContent } from "@budibase/bbui"
|
import { Input, ModalContent } from "@budibase/bbui"
|
||||||
import analytics from "analytics"
|
|
||||||
|
|
||||||
const CONTAINER = "@budibase/standard-components/container"
|
|
||||||
|
|
||||||
let name = ""
|
let name = ""
|
||||||
|
|
||||||
async function save() {
|
async function save() {
|
||||||
try {
|
try {
|
||||||
await store.actions.layouts.save({ name })
|
const layout = store.actions.layouts.save({ name })
|
||||||
$goto(`./${$store.currentAssetId}`)
|
$goto(`./${layout._id}`)
|
||||||
notifier.success(`Layout ${name} created successfully`)
|
notifier.success(`Layout ${name} created successfully`)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
notifier.danger(`Error creating layout ${name}.`)
|
notifier.danger(`Error creating layout ${name}.`)
|
||||||
|
|
Loading…
Reference in New Issue