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 => {
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",
}