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