1
0
Fork 0
mirror of synced 2024-08-08 06:37:55 +12:00

Use types

This commit is contained in:
Adria Navarro 2023-10-04 13:06:57 +02:00
parent 4bbd575cb0
commit fe15b4d1e3

View file

@ -1,7 +1,9 @@
import { FieldType, FieldSubtype } from "@budibase/types"
export const FIELDS = {
STRING: {
name: "Text",
type: "string",
type: FieldType.STRING,
icon: "Text",
constraints: {
type: "string",
@ -11,7 +13,7 @@ export const FIELDS = {
},
BARCODEQR: {
name: "Barcode/QR",
type: "barcodeqr",
type: FieldType.BARCODEQR,
icon: "Camera",
constraints: {
type: "string",
@ -21,7 +23,7 @@ export const FIELDS = {
},
LONGFORM: {
name: "Long Form Text",
type: "longform",
type: FieldType.LONGFORM,
icon: "TextAlignLeft",
constraints: {
type: "string",
@ -31,7 +33,7 @@ export const FIELDS = {
},
OPTIONS: {
name: "Options",
type: "options",
type: FieldType.OPTIONS,
icon: "Dropdown",
constraints: {
type: "string",
@ -41,7 +43,7 @@ export const FIELDS = {
},
ARRAY: {
name: "Multi-select",
type: "array",
type: FieldType.ARRAY,
icon: "Duplicate",
constraints: {
type: "array",
@ -51,7 +53,7 @@ export const FIELDS = {
},
NUMBER: {
name: "Number",
type: "number",
type: FieldType.NUMBER,
icon: "123",
constraints: {
type: "number",
@ -61,12 +63,12 @@ export const FIELDS = {
},
BIGINT: {
name: "BigInt",
type: "bigint",
type: FieldType.BIGINT,
icon: "TagBold",
},
BOOLEAN: {
name: "Boolean",
type: "boolean",
type: FieldType.BOOLEAN,
icon: "Boolean",
constraints: {
type: "boolean",
@ -75,7 +77,7 @@ export const FIELDS = {
},
DATETIME: {
name: "Date/Time",
type: "datetime",
type: FieldType.DATETIME,
icon: "Calendar",
constraints: {
type: "string",
@ -89,7 +91,7 @@ export const FIELDS = {
},
ATTACHMENT: {
name: "Attachment",
type: "attachment",
type: FieldType.ATTACHMENT,
icon: "Folder",
constraints: {
type: "array",
@ -98,7 +100,7 @@ export const FIELDS = {
},
LINK: {
name: "Relationship",
type: "link",
type: FieldType.LINK,
icon: "Link",
constraints: {
type: "array",
@ -107,13 +109,13 @@ export const FIELDS = {
},
FORMULA: {
name: "Formula",
type: "formula",
type: FieldType.FORMULA,
icon: "Calculator",
constraints: {},
},
JSON: {
name: "JSON",
type: "json",
type: FieldType.JSON,
icon: "Brackets",
constraints: {
type: "object",
@ -122,9 +124,9 @@ export const FIELDS = {
},
BB_REFERENCE_USER: {
name: "User",
type: "bb_reference",
subtype: "user",
compositeType: "bb_reference_user", // Used for working with the subtype on CreateEditColumn as is it was a primary type
type: FieldType.BB_REFERENCE,
subtype: FieldSubtype.USER,
compositeType: `${FieldType.BB_REFERENCE}_${FieldSubtype.USER}`, // Used for working with the subtype on CreateEditColumn as is it was a primary type
icon: "User",
},
}