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

62 lines
1.4 KiB
Svelte
Raw Normal View History

2020-05-22 08:40:16 +12:00
<script>
import { store, backendUiStore, automationStore } from "builderStore"
import { notifier } from "builderStore/store/notifications"
2020-08-19 04:14:35 +12:00
import { Input } from "@budibase/bbui"
import analytics from "analytics"
import { ModalTitle, ModalFooter } from "components/common/Modal"
2020-05-22 08:40:16 +12:00
let name
$: valid = !!name
$: instanceId = $backendUiStore.selectedDatabase._id
$: appId = $store.appId
function sleep(ms) {
return new Promise(resolve => {
setTimeout(resolve, ms)
})
}
async function createAutomation() {
await automationStore.actions.create({
2020-05-22 08:40:16 +12:00
name,
instanceId,
})
notifier.success(`Automation ${name} created.`)
analytics.captureEvent("Automation Created", { name })
2020-05-22 08:40:16 +12:00
}
</script>
<ModalTitle>Create Automation</ModalTitle>
<Input bind:value={name} label="Name" />
<ModalFooter
confirmText="Create"
onConfirm={createAutomation}
disabled={!valid}>
<a
target="_blank"
href="https://docs.budibase.com/automate/introduction-to-automate">
<i class="ri-information-line" />
<span>Learn about automations</span>
</a>
</ModalFooter>
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>