Type FieldTypeToComponentMap

This commit is contained in:
Adria Navarro 2024-04-03 12:15:47 +02:00
parent edd3ce8f0f
commit f771cc17a7
1 changed files with 15 additions and 13 deletions

View File

@ -1,3 +1,5 @@
import { FieldType } from "@budibase/types"
export const convertOldFieldFormat = fields => { export const convertOldFieldFormat = fields => {
if (!fields) { if (!fields) {
return [] return []
@ -31,17 +33,17 @@ export const getComponentForField = (field, schema) => {
} }
export const FieldTypeToComponentMap = { export const FieldTypeToComponentMap = {
string: "stringfield", [FieldType.STRING]: "stringfield",
number: "numberfield", [FieldType.NUMBER]: "numberfield",
bigint: "bigintfield", [FieldType.BIGINT]: "bigintfield",
options: "optionsfield", [FieldType.OPTIONS]: "optionsfield",
array: "multifieldselect", [FieldType.ARRAY]: "multifieldselect",
boolean: "booleanfield", [FieldType.BOOLEAN]: "booleanfield",
longform: "longformfield", [FieldType.LONGFORM]: "longformfield",
datetime: "datetimefield", [FieldType.DATETIME]: "datetimefield",
attachment: "attachmentfield", [FieldType.ATTACHMENT]: "attachmentfield",
link: "relationshipfield", [FieldType.LINK]: "relationshipfield",
json: "jsonfield", [FieldType.JSON]: "jsonfield",
barcodeqr: "codescanner", [FieldType.BARCODEQR]: "codescanner",
bb_reference: "bbreferencefield", [FieldType.BB_REFERENCE]: "bbreferencefield",
} }