diff --git a/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte index 270e4b6e25..1e5e23823c 100644 --- a/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte @@ -24,11 +24,7 @@ } let originalName = field.name - - $: required = - field.constraints && - field.constraints.presence && - !field.constraints.presence.allowEmpty + $: required = field && field.constraints && field.constraints.presence async function saveColumn() { backendUiStore.update(state => { @@ -50,6 +46,14 @@ field.type = type field.constraints = constraints } + + const getPresence = required => (required ? { allowEmpty: false } : false) + + const requiredChanged = ev => { + const req = ev.target.checked + field.constraints.presence = req ? { allowEmpty: false } : false + required = req + }
@@ -68,10 +72,7 @@
- (field.constraints.presence.allowEmpty = required)} /> +
{#if field.type === 'string' && field.constraints} diff --git a/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte b/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte index 3c05b0de00..0f4b604166 100644 --- a/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte +++ b/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte @@ -18,9 +18,9 @@ }) notifier.success(`Table ${name} created successfully.`) $goto(`./model/${model._id}`) + analytics.captureEvent("Table Created", { name }) name = "" dropdown.hide() - analytics.captureEvent("Table Created", { name }) } const onClosed = () => { diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte index 84ddd9f8ec..2aa7097685 100644 --- a/packages/builder/src/components/start/CreateAppModal.svelte +++ b/packages/builder/src/components/start/CreateAppModal.svelte @@ -145,7 +145,7 @@ }) const appJson = await appResp.json() analytics.captureEvent("App Created", { - name, + name: $createAppStore.values.applicationName, appId: appJson._id, })