1
0
Fork 0
mirror of synced 2024-06-17 01:44:53 +12:00
budibase/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte

59 lines
1.4 KiB
Svelte
Raw Normal View History

2020-05-22 08:40:16 +12:00
<script>
2021-03-19 02:33:45 +13:00
import { goto } from "@roxi/routify"
2021-04-01 22:29:47 +13:00
import { database } from "stores/backend"
2021-04-07 22:33:14 +12:00
import { automationStore } from "builderStore"
import { notifier } from "builderStore/store/notifications"
2020-10-08 21:35:11 +13:00
import { Input, ModalContent } from "@budibase/bbui"
import analytics from "analytics"
2020-05-22 08:40:16 +12:00
let name
$: valid = !!name
$: instanceId = $database._id
async function createAutomation() {
await automationStore.actions.create({
2020-05-22 08:40:16 +12:00
name,
instanceId,
})
notifier.success(`Automation ${name} created.`)
2021-03-16 03:00:34 +13:00
$goto(`./${$automationStore.selectedAutomation.automation._id}`)
analytics.captureEvent("Automation Created", { name })
2020-05-22 08:40:16 +12:00
}
</script>
2020-10-08 21:35:11 +13:00
<ModalContent
title="Create Automation"
confirmText="Create"
onConfirm={createAutomation}
disabled={!valid}>
<Input bind:value={name} label="Name" />
2020-10-07 23:38:05 +13:00
<div slot="footer">
<a
target="_blank"
href="https://docs.budibase.com/automate/introduction-to-automate">
<i class="ri-information-line" />
<span>Learn about automations</span>
</a>
2020-10-07 23:38:05 +13:00
</div>
2020-10-08 21:35:11 +13:00
</ModalContent>
2020-05-22 08:40:16 +12:00
<style>
a {
color: var(--ink);
2020-05-22 08:40:16 +12:00
font-size: 14px;
vertical-align: middle;
display: flex;
align-items: center;
text-decoration: none;
}
a span {
text-decoration: underline;
2020-05-22 08:40:16 +12:00
}
i {
2020-05-22 08:40:16 +12:00
font-size: 20px;
margin-right: var(--spacing-m);
text-decoration: none;
2020-05-22 08:40:16 +12:00
}
</style>