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

89 lines
1.7 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-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
async function createAutomation() {
await automationStore.actions.create({
2020-05-22 08:40:16 +12:00
name,
instanceId,
})
onClosed()
notifier.success(`Automation ${name} created.`)
2020-05-22 08:40:16 +12:00
}
</script>
<header>
<i class="ri-stackshare-line" />
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" />
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>
<ActionButton disabled={!valid} on:click={createAutomation}>Save</ActionButton>
2020-05-22 08:40:16 +12:00
</footer>
<style>
header {
font-size: 24px;
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);
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;
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>