allow deletion of queries and datasources

This commit is contained in:
Martin McKeaveney 2021-01-12 17:04:51 +00:00
parent 04eca5b663
commit 66fccccc1e
4 changed files with 8 additions and 4 deletions

View File

@ -47,5 +47,6 @@
.close { .close {
font-size: var(--font-size-xl); font-size: var(--font-size-xl);
cursor: pointer;
} }
</style> </style>

View File

@ -2,7 +2,7 @@
import { Button, Icon, DropdownMenu, Spacer, Heading } from "@budibase/bbui" import { Button, Icon, DropdownMenu, Spacer, Heading } from "@budibase/bbui"
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
import { store, backendUiStore, currentAsset } from "builderStore" import { store, backendUiStore, currentAsset } from "builderStore"
// import DataBindingDrawer from "components/userInterface/DataBindingDrawer/index.svelte" import { notifier } from "builderStore/store/notifications"
import BottomDrawer from "components/common/BottomDrawer.svelte" import BottomDrawer from "components/common/BottomDrawer.svelte"
import ParameterBuilder from "components/integration/QueryParameterBuilder.svelte" import ParameterBuilder from "components/integration/QueryParameterBuilder.svelte"
import fetchBindableProperties from "../../builderStore/fetchBindableProperties" import fetchBindableProperties from "../../builderStore/fetchBindableProperties"
@ -92,7 +92,10 @@
{#if bindingDrawerOpen} {#if bindingDrawerOpen}
<BottomDrawer title={'Query'} onClose={closeDatabindingDrawer}> <BottomDrawer title={'Query'} onClose={closeDatabindingDrawer}>
<div slot="buttons"> <div slot="buttons">
<Button blue thin on:click={() => handleSelected(value)}>Save</Button> <Button blue thin on:click={() => {
notifier.success("Query parameters saved.")
handleSelected(value)
}}>Save</Button>
</div> </div>
<div class="drawer-contents" slot="body"> <div class="drawer-contents" slot="body">
<pre>{value.queryString}</pre> <pre>{value.queryString}</pre>

View File

@ -66,7 +66,7 @@ exports.destroy = async function(ctx) {
await db.bulkDocs(rows.rows.map(row => ({ ...row.doc, _deleted: true }))) await db.bulkDocs(rows.rows.map(row => ({ ...row.doc, _deleted: true })))
// delete the datasource // delete the datasource
await db.destroy(ctx.params.datasourceId) await db.remove(ctx.params.datasourceId)
ctx.message = `Datasource deleted.` ctx.message = `Datasource deleted.`
ctx.status = 200 ctx.status = 200

View File

@ -79,7 +79,7 @@ exports.execute = async function(ctx) {
exports.destroy = async function(ctx) { exports.destroy = async function(ctx) {
const db = new CouchDB(ctx.user.appId) const db = new CouchDB(ctx.user.appId)
await db.destroy(ctx.params.queryId) await db.remove(ctx.params.queryId)
ctx.message = `Query deleted.` ctx.message = `Query deleted.`
ctx.status = 200 ctx.status = 200
} }