2020-05-22 08:40:16 +12:00
|
|
|
<script>
|
2020-09-22 00:49:34 +12:00
|
|
|
import { store, backendUiStore, automationStore } from "builderStore"
|
2020-06-24 23:41:26 +12:00
|
|
|
import { notifier } from "builderStore/store/notifications"
|
2020-05-22 08:40:16 +12:00
|
|
|
import ActionButton from "components/common/ActionButton.svelte"
|
2020-08-19 04:14:35 +12:00
|
|
|
import { Input } from "@budibase/bbui"
|
2020-05-22 08:40:16 +12:00
|
|
|
|
|
|
|
export let onClosed
|
|
|
|
|
|
|
|
let name
|
|
|
|
|
|
|
|
$: valid = !!name
|
|
|
|
$: instanceId = $backendUiStore.selectedDatabase._id
|
|
|
|
$: appId = $store.appId
|
|
|
|
|
2020-09-22 00:49:34 +12:00
|
|
|
async function createAutomation() {
|
|
|
|
await automationStore.actions.create({
|
2020-05-22 08:40:16 +12:00
|
|
|
name,
|
|
|
|
instanceId,
|
|
|
|
})
|
|
|
|
onClosed()
|
2020-09-22 00:49:34 +12:00
|
|
|
notifier.success(`Automation ${name} created.`)
|
2020-05-22 08:40:16 +12:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<header>
|
|
|
|
<i class="ri-stackshare-line" />
|
2020-09-22 00:49:34 +12:00
|
|
|
Create Automation
|
2020-05-22 08:40:16 +12:00
|
|
|
</header>
|
|
|
|
<div>
|
2020-08-19 04:14:35 +12:00
|
|
|
<Input bind:value={name} label="Name" />
|
2020-05-22 08:40:16 +12:00
|
|
|
</div>
|
|
|
|
<footer>
|
|
|
|
<a href="https://docs.budibase.com">
|
|
|
|
<i class="ri-information-line" />
|
2020-09-22 00:49:34 +12:00
|
|
|
Learn about automations
|
2020-05-22 08:40:16 +12:00
|
|
|
</a>
|
2020-06-05 06:27:25 +12:00
|
|
|
<ActionButton secondary on:click={onClosed}>Cancel</ActionButton>
|
2020-09-22 00:49:34 +12:00
|
|
|
<ActionButton disabled={!valid} on:click={createAutomation}>Save</ActionButton>
|
2020-05-22 08:40:16 +12:00
|
|
|
</footer>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
header {
|
|
|
|
font-size: 24px;
|
2020-06-23 19:19:16 +12:00
|
|
|
color: var(--ink);
|
2020-05-22 08:40:16 +12:00
|
|
|
font-weight: bold;
|
|
|
|
padding: 30px;
|
|
|
|
}
|
|
|
|
|
|
|
|
header i {
|
|
|
|
margin-right: 10px;
|
|
|
|
font-size: 20px;
|
2020-06-25 04:13:16 +12:00
|
|
|
background: var(--blue-light);
|
2020-06-23 19:19:16 +12:00
|
|
|
color: var(--grey-4);
|
2020-05-22 08:40:16 +12:00
|
|
|
padding: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
div {
|
|
|
|
padding: 0 30px 30px 30px;
|
|
|
|
}
|
|
|
|
|
|
|
|
label {
|
|
|
|
font-size: 18px;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
|
|
|
|
footer {
|
|
|
|
display: grid;
|
|
|
|
grid-auto-flow: column;
|
|
|
|
grid-gap: 5px;
|
|
|
|
grid-auto-columns: 3fr 1fr 1fr;
|
|
|
|
padding: 20px;
|
2020-06-23 19:19:16 +12:00
|
|
|
background: var(--grey-1);
|
2020-05-22 08:40:16 +12:00
|
|
|
border-radius: 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
footer a {
|
|
|
|
color: var(--primary);
|
|
|
|
font-size: 14px;
|
|
|
|
vertical-align: middle;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
footer i {
|
|
|
|
font-size: 20px;
|
|
|
|
margin-right: 10px;
|
|
|
|
}
|
|
|
|
</style>
|