2020-12-05 00:16:07 +01:00
|
|
|
<script>
|
|
|
|
import { goto } from "@sveltech/routify"
|
|
|
|
import api from "builderStore/api"
|
2020-12-07 21:29:41 +01:00
|
|
|
import { notifier } from "builderStore/store/notifications"
|
2020-12-05 00:16:07 +01:00
|
|
|
import { store, backendUiStore, allScreens } from "builderStore"
|
|
|
|
import { Input, ModalContent } from "@budibase/bbui"
|
|
|
|
import analytics from "analytics"
|
|
|
|
|
|
|
|
const CONTAINER = "@budibase/standard-components/container"
|
|
|
|
|
|
|
|
let name = ""
|
|
|
|
|
2020-12-07 21:29:41 +01:00
|
|
|
async function save() {
|
|
|
|
try {
|
|
|
|
await store.actions.layouts.save({ name })
|
|
|
|
$goto(`./${$store.currentAssetId}`)
|
|
|
|
notifier.success(`Layout ${name} created successfully`)
|
|
|
|
} catch (err) {
|
|
|
|
notifier.danger(`Error creating layout ${name}.`)
|
|
|
|
}
|
2020-12-05 00:16:07 +01:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<ModalContent title="Create Layout" confirmText="Create" onConfirm={save}>
|
|
|
|
<Input thin label="Name" bind:value={name} />
|
|
|
|
</ModalContent>
|