more conversions
This commit is contained in:
parent
f7cacbc8ae
commit
f0e25612a1
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue