1
0
Fork 0
mirror of synced 2024-10-02 10:08:09 +13:00

Magic strings to enums

This commit is contained in:
Adria Navarro 2024-03-13 15:16:21 +01:00
parent 563eada394
commit fa84b3fbc2

View file

@ -479,7 +479,7 @@
newError.name = `Column name already in use.`
}
if (fieldInfo.type === "auto" && !fieldInfo.subtype) {
if (fieldInfo.type === FieldType.AUTO && !fieldInfo.subtype) {
newError.subtype = `Auto Column requires a type`
}
@ -540,18 +540,18 @@
}}
/>
{#if editableColumn.type === "string"}
{#if editableColumn.type === FieldType.STRING}
<Input
type="number"
label="Max Length"
bind:value={editableColumn.constraints.length.maximum}
/>
{:else if editableColumn.type === "options"}
{:else if editableColumn.type === FieldType.OPTIONS}
<OptionSelectDnD
bind:constraints={editableColumn.constraints}
bind:optionColors={editableColumn.optionColors}
/>
{:else if editableColumn.type === "longform"}
{:else if editableColumn.type === FieldType.LONGFORM}
<div>
<div class="tooltip-alignment">
<Label size="M">Formatting</Label>
@ -569,12 +569,12 @@
text="Enable rich text support (markdown)"
/>
</div>
{:else if editableColumn.type === "array"}
{:else if editableColumn.type === FieldType.ARRAY}
<OptionSelectDnD
bind:constraints={editableColumn.constraints}
bind:optionColors={editableColumn.optionColors}
/>
{:else if editableColumn.type === "datetime" && !editableColumn.autocolumn}
{:else if editableColumn.type === FieldType.DATETIME && !editableColumn.autocolumn}
<div class="split-label">
<div class="label-length">
<Label size="M">Earliest</Label>
@ -613,7 +613,7 @@
</div>
{/if}
<Toggle bind:value={editableColumn.dateOnly} text="Date only" />
{:else if editableColumn.type === "number" && !editableColumn.autocolumn}
{:else if editableColumn.type === FieldType.NUMBER && !editableColumn.autocolumn}
<div class="split-label">
<div class="label-length">
<Label size="M">Min Value</Label>
@ -638,7 +638,7 @@
/>
</div>
</div>
{:else if editableColumn.type === "link"}
{:else if editableColumn.type === FieldType.LINK}
<RelationshipSelector
bind:relationshipPart1
bind:relationshipPart2