From f771cc17a770feae75db288622b196523f857bb4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 3 Apr 2024 12:15:47 +0200 Subject: [PATCH] Type FieldTypeToComponentMap --- .../controls/FieldConfiguration/utils.js | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/packages/builder/src/components/design/settings/controls/FieldConfiguration/utils.js b/packages/builder/src/components/design/settings/controls/FieldConfiguration/utils.js index c929263db1..18ebf57d98 100644 --- a/packages/builder/src/components/design/settings/controls/FieldConfiguration/utils.js +++ b/packages/builder/src/components/design/settings/controls/FieldConfiguration/utils.js @@ -1,3 +1,5 @@ +import { FieldType } from "@budibase/types" + export const convertOldFieldFormat = fields => { if (!fields) { return [] @@ -31,17 +33,17 @@ export const getComponentForField = (field, schema) => { } export const FieldTypeToComponentMap = { - string: "stringfield", - number: "numberfield", - bigint: "bigintfield", - options: "optionsfield", - array: "multifieldselect", - boolean: "booleanfield", - longform: "longformfield", - datetime: "datetimefield", - attachment: "attachmentfield", - link: "relationshipfield", - json: "jsonfield", - barcodeqr: "codescanner", - bb_reference: "bbreferencefield", + [FieldType.STRING]: "stringfield", + [FieldType.NUMBER]: "numberfield", + [FieldType.BIGINT]: "bigintfield", + [FieldType.OPTIONS]: "optionsfield", + [FieldType.ARRAY]: "multifieldselect", + [FieldType.BOOLEAN]: "booleanfield", + [FieldType.LONGFORM]: "longformfield", + [FieldType.DATETIME]: "datetimefield", + [FieldType.ATTACHMENT]: "attachmentfield", + [FieldType.LINK]: "relationshipfield", + [FieldType.JSON]: "jsonfield", + [FieldType.BARCODEQR]: "codescanner", + [FieldType.BB_REFERENCE]: "bbreferencefield", }