diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 841e781cf2..32a2d1f659 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -9,6 +9,7 @@ DatePicker, ModalContent, Context, + Modal, } from "@budibase/bbui" import { createEventDispatcher } from "svelte" import { cloneDeep } from "lodash/fp" @@ -32,12 +33,14 @@ import ModalBindableInput from "components/common/bindings/ModalBindableInput.svelte" import { getBindings } from "components/backend/DataTable/formula" import { getContext } from "svelte" + import JSONSchemaModal from "./JSONSchemaModal.svelte" const AUTO_TYPE = "auto" const FORMULA_TYPE = FIELDS.FORMULA.type const LINK_TYPE = FIELDS.LINK.type const STRING_TYPE = FIELDS.STRING.type const NUMBER_TYPE = FIELDS.NUMBER.type + const JSON_TYPE = FIELDS.JSON.type const dispatch = createEventDispatcher() const PROHIBITED_COLUMN_NAMES = ["type", "_id", "_rev", "tableId"] @@ -63,6 +66,7 @@ let confirmDeleteDialog let deletion let deleteColName + let jsonSchemaModal $: checkConstraints(field) $: required = !!field?.constraints?.presence || primaryDisplay @@ -83,6 +87,7 @@ // used to select what different options can be displayed for column type $: canBeSearched = field.type !== LINK_TYPE && + field.type !== JSON_TYPE && field.subtype !== AUTO_COLUMN_SUB_TYPES.CREATED_BY && field.subtype !== AUTO_COLUMN_SUB_TYPES.UPDATED_BY && field.type !== FORMULA_TYPE @@ -173,6 +178,10 @@ } } + function openJsonSchemaEditor() { + jsonSchemaModal.show() + } + function confirmDelete() { confirmDeleteDialog.show() deletion = true @@ -400,6 +409,10 @@ getOptionLabel={option => option[1].name} getOptionValue={option => option[0]} /> + {:else if field.type === JSON_TYPE} + {/if}