fix DataSourceSelect Query Panel

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-28 15:31:41 +02:00
parent 672046a76c
commit 504a5df4a8
1 changed files with 33 additions and 31 deletions

View File

@ -5,8 +5,10 @@
Popover, Popover,
Divider, Divider,
Select, Select,
Layout,
Heading, Heading,
Drawer, Drawer,
DrawerContent,
} from "@budibase/bbui" } from "@budibase/bbui"
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
import { store, currentAsset } from "builderStore" import { store, currentAsset } from "builderStore"
@ -103,38 +105,38 @@
{#if value?.type === "query"} {#if value?.type === "query"}
<i class="ri-settings-5-line" on:click={drawer.show} /> <i class="ri-settings-5-line" on:click={drawer.show} />
<Drawer title={"Query Parameters"} bind:this={drawer}> <Drawer title={"Query Parameters"} bind:this={drawer}>
<div slot="buttons"> <Button
<Button slot="buttons"
blue cta
thin on:click={() => {
on:click={() => { notifications.success("Query parameters saved.")
notifications.success("Query parameters saved.") handleSelected(value)
handleSelected(value) drawer.hide()
drawer.hide() }}
}} >
> Save
Save </Button>
</Button> <DrawerContent slot="body">
</div> <Layout>
<div class="drawer-contents" slot="body"> {#if value.parameters.length > 0}
{#if value.parameters.length > 0} <ParameterBuilder
<ParameterBuilder bind:customParams={value.queryParams}
bind:customParams={value.queryParams} parameters={queries.find((query) => query._id === value._id)
parameters={queries.find((query) => query._id === value._id) .parameters}
.parameters} bindings={queryBindableProperties}
bindings={queryBindableProperties} />
{/if}
<IntegrationQueryEditor
height={200}
query={value}
schema={fetchQueryDefinition(value)}
datasource={$datasources.list.find(
(ds) => ds._id === value.datasourceId
)}
editable={false}
/> />
{/if} </Layout>
<IntegrationQueryEditor </DrawerContent>
height={200}
query={value}
schema={fetchQueryDefinition(value)}
datasource={$datasources.list.find(
(ds) => ds._id === value.datasourceId
)}
editable={false}
/>
</div>
</Drawer> </Drawer>
{/if} {/if}
</div> </div>