2020-12-05 00:16:07 +01:00
|
|
|
<script>
|
2021-03-17 12:40:24 +01:00
|
|
|
import { goto } from "@roxi/routify"
|
2020-12-07 21:29:41 +01:00
|
|
|
import { notifier } from "builderStore/store/notifications"
|
2020-12-09 15:53:03 +01:00
|
|
|
import { store } from "builderStore"
|
2020-12-05 00:16:07 +01:00
|
|
|
import { Input, ModalContent } from "@budibase/bbui"
|
|
|
|
|
|
|
|
let name = ""
|
|
|
|
|
2020-12-07 21:29:41 +01:00
|
|
|
async function save() {
|
|
|
|
try {
|
2021-01-15 15:23:27 +01:00
|
|
|
await store.actions.layouts.save({ name })
|
2020-12-07 21:29:41 +01:00
|
|
|
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>
|