Metrics - event props not populating correctly

This commit is contained in:
Michael Shanks 2020-10-05 17:28:44 +01:00
parent 267e8e39aa
commit 775aa0e92c
3 changed files with 12 additions and 11 deletions

View File

@ -24,11 +24,7 @@
} }
let originalName = field.name let originalName = field.name
$: required = field && field.constraints && field.constraints.presence
$: required =
field.constraints &&
field.constraints.presence &&
!field.constraints.presence.allowEmpty
async function saveColumn() { async function saveColumn() {
backendUiStore.update(state => { backendUiStore.update(state => {
@ -50,6 +46,14 @@
field.type = type field.type = type
field.constraints = constraints 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
}
</script> </script>
<div class="actions"> <div class="actions">
@ -68,10 +72,7 @@
<div class="info"> <div class="info">
<div class="field"> <div class="field">
<label>Required</label> <label>Required</label>
<input <input type="checkbox" checked={required} on:change={requiredChanged} />
type="checkbox"
bind:checked={required}
on:change={() => (field.constraints.presence.allowEmpty = required)} />
</div> </div>
{#if field.type === 'string' && field.constraints} {#if field.type === 'string' && field.constraints}

View File

@ -18,9 +18,9 @@
}) })
notifier.success(`Table ${name} created successfully.`) notifier.success(`Table ${name} created successfully.`)
$goto(`./model/${model._id}`) $goto(`./model/${model._id}`)
analytics.captureEvent("Table Created", { name })
name = "" name = ""
dropdown.hide() dropdown.hide()
analytics.captureEvent("Table Created", { name })
} }
const onClosed = () => { const onClosed = () => {

View File

@ -145,7 +145,7 @@
}) })
const appJson = await appResp.json() const appJson = await appResp.json()
analytics.captureEvent("App Created", { analytics.captureEvent("App Created", {
name, name: $createAppStore.values.applicationName,
appId: appJson._id, appId: appJson._id,
}) })