Prevent datetime and boolean fields showing in workflow block setup until these are handled properly

This commit is contained in:
Andrew Kingston 2020-09-18 16:14:37 +01:00
parent 68c84438da
commit aa05718766
1 changed files with 2 additions and 13 deletions

View File

@ -12,17 +12,6 @@
// Ensure any nullish modelId values get set to empty string so // Ensure any nullish modelId values get set to empty string so
// that the select works // that the select works
$: if (value?.modelId == null) value = { modelId: "" } $: if (value?.modelId == null) value = { modelId: "" }
function setParsedValue(evt, field) {
const fieldSchema = model?.schema[field]
if (fieldSchema) {
if (fieldSchema.type === "number") {
value[field] = parseInt(evt.target.value)
return
}
}
value[field] = evt.target.value
}
</script> </script>
<div class="block-field"> <div class="block-field">
@ -49,12 +38,12 @@
<option value={option}>{option}</option> <option value={option}>{option}</option>
{/each} {/each}
</Select> </Select>
{:else} {:else if schema.type === "string"}
<BindableInput <BindableInput
thin thin
bind:value={value[field]} bind:value={value[field]}
on:change={e => setParsedValue(e, field)}
label={field} label={field}
type={schema.type}
{bindings} /> {bindings} />
{/if} {/if}
</div> </div>