From fa84b3fbc2a15917a2deea197779baa64ca65b07 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 13 Mar 2024 15:16:21 +0100 Subject: [PATCH] Magic strings to enums --- .../DataTable/modals/CreateEditColumn.svelte | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 1bad1ee221..c866f45e46 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -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} - {:else if editableColumn.type === "options"} + {:else if editableColumn.type === FieldType.OPTIONS} - {:else if editableColumn.type === "longform"} + {:else if editableColumn.type === FieldType.LONGFORM}
@@ -569,12 +569,12 @@ text="Enable rich text support (markdown)" />
- {:else if editableColumn.type === "array"} + {:else if editableColumn.type === FieldType.ARRAY} - {:else if editableColumn.type === "datetime" && !editableColumn.autocolumn} + {:else if editableColumn.type === FieldType.DATETIME && !editableColumn.autocolumn}
@@ -613,7 +613,7 @@
{/if} - {:else if editableColumn.type === "number" && !editableColumn.autocolumn} + {:else if editableColumn.type === FieldType.NUMBER && !editableColumn.autocolumn}
@@ -638,7 +638,7 @@ />
- {:else if editableColumn.type === "link"} + {:else if editableColumn.type === FieldType.LINK}