Add the option to use bindable inputs in your confirmations (#14138)

Co-authored-by: deanhannigan <deanhannigan@gmail.com>
This commit is contained in:
Conor Webb 2024-07-15 14:01:08 +01:00 committed by GitHub
parent f6141af91f
commit ab679ac85d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 106 additions and 49 deletions

View File

@ -1,5 +1,5 @@
<script> <script>
import { Select, Label, Checkbox, Input, Body } from "@budibase/bbui" import { Select, Label, Checkbox, Body } from "@budibase/bbui"
import { tables, viewsV2 } from "stores/builder" import { tables, viewsV2 } from "stores/builder"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte" import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
@ -46,19 +46,35 @@
{#if parameters.confirm} {#if parameters.confirm}
<Label small>Title</Label> <Label small>Title</Label>
<Input placeholder="Delete Row" bind:value={parameters.customTitleText} /> <DrawerBindableInput
placeholder="Prompt User"
value={parameters.customTitleText}
on:change={e => (parameters.customTitleText = e.detail)}
{bindings}
/>
<Label small>Text</Label> <Label small>Text</Label>
<Input <DrawerBindableInput
placeholder="Are you sure you want to delete?" placeholder="Are you sure you want to continue?"
bind:value={parameters.confirmText} value={parameters.confirmText}
on:change={e => (parameters.confirmText = e.detail)}
{bindings}
/> />
<Label small>Confirm Text</Label> <Label small>Confirm Text</Label>
<Input placeholder="Confirm" bind:value={parameters.confirmButtonText} /> <DrawerBindableInput
placeholder="Confirm"
value={parameters.confirmButtonText}
on:change={e => (parameters.confirmButtonText = e.detail)}
{bindings}
/>
<Label small>Cancel Text</Label> <Label small>Cancel Text</Label>
<Input placeholder="Cancel" bind:value={parameters.cancelButtonText} /> <DrawerBindableInput
placeholder="Cancel"
value={parameters.cancelButtonText}
on:change={e => (parameters.cancelButtonText = e.detail)}
{bindings}
/>
{/if} {/if}
</div> </div>
</div> </div>

View File

@ -1,11 +1,12 @@
<script> <script>
import { Select, Label, Body, Checkbox, Input } from "@budibase/bbui" import { Select, Label, Body, Checkbox } from "@budibase/bbui"
import { import {
selectedScreen, selectedScreen,
componentStore, componentStore,
tables, tables,
viewsV2, viewsV2,
} from "stores/builder" } from "stores/builder"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
import { getSchemaForDatasourcePlus } from "dataBinding" import { getSchemaForDatasourcePlus } from "dataBinding"
import SaveFields from "./SaveFields.svelte" import SaveFields from "./SaveFields.svelte"
import { getDatasourceLikeProviders } from "components/design/settings/controls/ButtonActionEditor/actions/utils" import { getDatasourceLikeProviders } from "components/design/settings/controls/ButtonActionEditor/actions/utils"
@ -73,22 +74,35 @@
{#if parameters.confirm} {#if parameters.confirm}
<Label small>Title</Label> <Label small>Title</Label>
<Input <DrawerBindableInput
placeholder="Duplicate Row" placeholder="Prompt User"
bind:value={parameters.customTitleText} value={parameters.customTitleText}
on:change={e => (parameters.customTitleText = e.detail)}
{bindings}
/> />
<Label small>Text</Label> <Label small>Text</Label>
<Input <DrawerBindableInput
placeholder="Are you sure you want to duplicate this row?" placeholder="Are you sure you want to continue?"
bind:value={parameters.confirmText} value={parameters.confirmText}
on:change={e => (parameters.confirmText = e.detail)}
{bindings}
/> />
<Label small>Confirm Text</Label> <Label small>Confirm Text</Label>
<Input placeholder="Confirm" bind:value={parameters.confirmButtonText} /> <DrawerBindableInput
placeholder="Confirm"
value={parameters.confirmButtonText}
on:change={e => (parameters.confirmButtonText = e.detail)}
{bindings}
/>
<Label small>Cancel Text</Label> <Label small>Cancel Text</Label>
<Input placeholder="Cancel" bind:value={parameters.cancelButtonText} /> <DrawerBindableInput
placeholder="Cancel"
value={parameters.cancelButtonText}
on:change={e => (parameters.cancelButtonText = e.detail)}
{bindings}
/>
{/if} {/if}
</div> </div>

View File

@ -1,5 +1,6 @@
<script> <script>
import { Select, Layout, Input, Checkbox } from "@budibase/bbui" import { Select, Layout, Checkbox } from "@budibase/bbui"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
import { datasources, integrations, queries } from "stores/builder" import { datasources, integrations, queries } from "stores/builder"
import BindingBuilder from "components/integration/QueryBindingBuilder.svelte" import BindingBuilder from "components/integration/QueryBindingBuilder.svelte"
import IntegrationQueryEditor from "components/integration/index.svelte" import IntegrationQueryEditor from "components/integration/index.svelte"
@ -58,37 +59,46 @@
text="Do not display default notification" text="Do not display default notification"
bind:value={parameters.notificationOverride} bind:value={parameters.notificationOverride}
/> />
<br />
{#if parameters.queryId} {#if parameters.queryId}
<Checkbox text="Require confirmation" bind:value={parameters.confirm} /> <Checkbox text="Require confirmation" bind:value={parameters.confirm} />
{#if parameters.confirm} {#if parameters.confirm}
<Input <div class="params">
label="Title" <DrawerBindableInput
placeholder="Execute Query" label="Title"
bind:value={parameters.customTitleText} placeholder="Prompt User"
/> value={parameters.customTitleText}
on:change={e => (parameters.customTitleText = e.detail)}
{bindings}
/>
<DrawerBindableInput
label="Message"
placeholder="Are you sure you want to continue?"
value={parameters.confirmText}
on:change={e => (parameters.confirmText = e.detail)}
{bindings}
/>
<Input <DrawerBindableInput
label="Text" label="Confirm Text"
placeholder="Are you sure you want to execute this query?" placeholder="Confirm"
bind:value={parameters.confirmText} value={parameters.confirmButtonText}
/> on:change={e => (parameters.confirmButtonText = e.detail)}
{bindings}
/>
<Input <DrawerBindableInput
label="Confirm Text" label="Cancel Text"
placeholder="Confirm" placeholder="Cancel"
bind:value={parameters.confirmButtonText} value={parameters.cancelButtonText}
/> on:change={e => (parameters.cancelButtonText = e.detail)}
{bindings}
<Input />
label="Cancel Text" </div>
placeholder="Cancel"
bind:value={parameters.cancelButtonText}
/>
{/if} {/if}
{#if query?.parameters?.length > 0} {#if query?.parameters?.length > 0}
<br />
<div class="params"> <div class="params">
<BindingBuilder <BindingBuilder
customParams={parameters.queryParams} customParams={parameters.queryParams}

View File

@ -1,11 +1,12 @@
<script> <script>
import { Select, Label, Body, Checkbox, Input } from "@budibase/bbui" import { Select, Label, Body, Checkbox } from "@budibase/bbui"
import { import {
selectedScreen, selectedScreen,
componentStore, componentStore,
tables, tables,
viewsV2, viewsV2,
} from "stores/builder" } from "stores/builder"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
import { getSchemaForDatasourcePlus } from "dataBinding" import { getSchemaForDatasourcePlus } from "dataBinding"
import SaveFields from "./SaveFields.svelte" import SaveFields from "./SaveFields.svelte"
import { getDatasourceLikeProviders } from "components/design/settings/controls/ButtonActionEditor/actions/utils" import { getDatasourceLikeProviders } from "components/design/settings/controls/ButtonActionEditor/actions/utils"
@ -73,19 +74,35 @@
{#if parameters.confirm} {#if parameters.confirm}
<Label small>Title</Label> <Label small>Title</Label>
<Input placeholder="Save Row" bind:value={parameters.customTitleText} /> <DrawerBindableInput
placeholder="Prompt User"
value={parameters.customTitleText}
on:change={e => (parameters.customTitleText = e.detail)}
{bindings}
/>
<Label small>Text</Label> <Label small>Text</Label>
<Input <DrawerBindableInput
placeholder="Are you sure you want to save this row?" placeholder="Are you sure you want to continue?"
bind:value={parameters.confirmText} value={parameters.confirmText}
on:change={e => (parameters.confirmText = e.detail)}
{bindings}
/> />
<Label small>Confirm Text</Label> <Label small>Confirm Text</Label>
<Input placeholder="Confirm" bind:value={parameters.confirmButtonText} /> <DrawerBindableInput
placeholder="Confirm"
value={parameters.confirmButtonText}
on:change={e => (parameters.confirmButtonText = e.detail)}
{bindings}
/>
<Label small>Cancel Text</Label> <Label small>Cancel Text</Label>
<Input placeholder="Cancel" bind:value={parameters.cancelButtonText} /> <DrawerBindableInput
placeholder="Cancel"
value={parameters.cancelButtonText}
on:change={e => (parameters.cancelButtonText = e.detail)}
{bindings}
/>
{/if} {/if}
</div> </div>