more conversions

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-26 14:56:55 +02:00
parent c4b6e30391
commit 63dfede85a
2 changed files with 14 additions and 35 deletions

View File

@ -2,26 +2,14 @@
import { goto } from "@roxi/routify"
import { automationStore } from "builderStore"
import { database } from "stores/backend"
import { notifications } from "@budibase/bbui"
import { Icon, Popover } from "@budibase/bbui"
import {
DropdownContainer,
DropdownItem,
} from "components/common/Dropdowns"
import { ActionMenu, MenuItem, notifications, Icon } from "@budibase/bbui"
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
export let automation
let anchor
let dropdown
let confirmDeleteDialog
$: instanceId = $database._id
function showModal() {
dropdown.hide()
confirmDeleteDialog.show()
}
async function deleteAutomation() {
await automationStore.actions.delete({
instanceId,
@ -32,20 +20,15 @@
}
</script>
<div on:click|stopPropagation>
<div bind:this={anchor} class="icon" on:click={dropdown.show}>
<ActionMenu let:open let:closeOnClick>
<div slot="button" class="icon" on:click={open}>
<Icon s hoverable name="MoreSmallList" />
</div>
<Popover align="left" {anchor} bind:this={dropdown}>
<DropdownContainer>
<DropdownItem
icon="ri-delete-bin-line"
title="Delete"
on:click={showModal}
/>
</DropdownContainer>
</Popover>
</div>
<MenuItem icon="Delete" on:click={closeOnClick(confirmDeleteDialog.show)}
>Delete</MenuItem
>
</ActionMenu>
<ConfirmDialog
bind:this={confirmDeleteDialog}
okText="Delete Automation"

View File

@ -1,29 +1,25 @@
<script>
import { ActionMenu, MenuItem, Icon, Popover, notifications } from "@budibase/bbui"
import { ActionMenu, MenuItem, Icon, notifications } from "@budibase/bbui"
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
import { queries } from "stores/backend"
export let query
let dropdown
let confirmDeleteDialog
function hideEditor() {
dropdown?.hide()
}
async function deleteQuery() {
await queries.delete(query)
notifications.success("Query deleted")
hideEditor()
}
</script>
<ActionMenu bind:this={dropdown} let:open let:closeOnClick>
<ActionMenu let:open let:closeOnClick>
<div slot="button" class="icon" on:click={open}>
<Icon s hoverable name="MoreSmallList" />
</div>
<MenuItem icon="Delete" on:click={closeOnClick(confirmDeleteDialog.show)}>Delete</MenuItem>
<MenuItem icon="Delete" on:click={closeOnClick(confirmDeleteDialog.show)}
>Delete</MenuItem
>
</ActionMenu>
<ConfirmDialog