diff --git a/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte b/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte index 075b556134..1c5509544e 100644 --- a/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte +++ b/packages/builder/src/components/backend/DataTable/RowFieldControl.svelte @@ -21,12 +21,11 @@ {#if type === 'options'} - - Choose an option - {#each meta.constraints.inclusion as opt} - {opt} - {/each} - + {:else if type === 'datetime'} {:else if type === 'attachment'} @@ -47,7 +46,6 @@ {:else} - import { - Button, - Icon, - Modal, - ModalContent, - } from "@budibase/bbui" + import { Button, Icon, Modal, ModalContent } from "@budibase/bbui" import CreateEditColumn from "../modals/CreateEditColumn.svelte" let modal @@ -15,7 +10,7 @@ diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 2d17338885..11335eb4a6 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -1,12 +1,5 @@ - + - {#each Object.values(fieldDefinitions) as field} - {field.name} - {/each} - Auto Column - + bind:value={field.type} + options={[...Object.values(fieldDefinitions), { name: 'Auto Column', type: AUTO_COL }]} + getOptionLabel={field => field.name} + getOptionValue={field => field.type} /> {#if canBeRequired} @@ -238,22 +226,20 @@ {:else if field.type === 'number'} {:else if field.type === 'link'} - - Choose an option - {#each tableOptions as table} - {table.name} - {/each} - + table.name} + getOptionValue={table => table._id} /> {#if relationshipOptions && relationshipOptions.length > 0} Define the relationship @@ -274,23 +260,24 @@ {/if} - + {:else if field.type === AUTO_COL} - - Choose a subtype - {#each Object.entries(getAutoColumnInformation()) as [subtype, info]} - {info.name} - {/each} - + (field.subtype = e.detail)} + options={Object.entries(getAutoColumnInformation())} + getOptionLabel={option => option[1].name} + getOptionValue={option => option[0]} /> {/if} - + value={linkedIds?.[0]} + options={rows} + getOptionLabel={getPrettyName} + getOptionValue={row => row._id} + on:change={e => (linkedIds = e.detail ? [e.detail] : [])} + {label} /> {:else} - {#each rows as row} - {getPrettyName(row)} - {/each} - + options={rows} + getOptionLabel={getPrettyName} + getOptionValue={row => row._id} /> {/if} {/if} diff --git a/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte b/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte index 70e2306dcf..9b36324412 100644 --- a/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte +++ b/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte @@ -38,7 +38,7 @@ } const updateAccessRole = event => { - const role = event.target.value + const role = event.detail // Select a valid screen with this new role - otherwise we'll not be // able to change role at all because ComponentNavigationTree will kick us @@ -80,11 +80,10 @@ secondary on:change={updateAccessRole} value={$selectedAccessRole} - label="Filter by Access"> - {#each $roles as role} - {role.name} - {/each} - + label="Filter by Access" + getOptionLabel={role => role.name} + getOptionValue={role => role._id} + options={$roles} />