More types
This commit is contained in:
parent
3d45dcea5f
commit
edd3ce8f0f
|
@ -1,21 +1,7 @@
|
|||
import { FieldTypeToComponentMap } from "components/design/settings/controls/FieldConfiguration/utils"
|
||||
import { Component } from "./Component"
|
||||
import { getSchemaForDatasource } from "dataBinding"
|
||||
|
||||
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",
|
||||
}
|
||||
|
||||
export function makeDatasourceFormComponents(datasource) {
|
||||
const { schema } = getSchemaForDatasource(null, datasource, {
|
||||
formSchema: true,
|
||||
|
@ -30,7 +16,7 @@ export function makeDatasourceFormComponents(datasource) {
|
|||
}
|
||||
const fieldType =
|
||||
typeof fieldSchema === "object" ? fieldSchema.type : fieldSchema
|
||||
const componentType = fieldTypeToComponentMap[fieldType]
|
||||
const componentType = FieldTypeToComponentMap[fieldType]
|
||||
const fullComponentType = `@budibase/standard-components/${componentType}`
|
||||
if (componentType) {
|
||||
const component = new Component(fullComponentType)
|
||||
|
|
|
@ -7,19 +7,19 @@
|
|||
export let order
|
||||
|
||||
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",
|
||||
}
|
||||
|
||||
const getFieldSchema = field => {
|
||||
|
|
Loading…
Reference in New Issue