From d431f633d3b54b4bd4e8617b24cafdbde98ce8ef Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 26 Mar 2024 09:57:13 +0100 Subject: [PATCH 01/11] Use types --- .../src/components/backend/DataTable/formula.js | 15 +++++++-------- .../components/backend/TableNavigator/utils.js | 2 +- packages/builder/src/helpers/schemaGenerator.js | 12 ++++++------ packages/builder/src/helpers/utils.js | 9 +++++---- packages/builder/src/stores/builder/tables.js | 7 ++++--- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/formula.js b/packages/builder/src/components/backend/DataTable/formula.js index f5ff3caec4..e3da4249bc 100644 --- a/packages/builder/src/components/backend/DataTable/formula.js +++ b/packages/builder/src/components/backend/DataTable/formula.js @@ -1,3 +1,4 @@ +import { FieldType } from "@budibase/types" import { FIELDS } from "constants/backend" import { tables } from "stores/builder" import { get as svelteGet } from "svelte/store" @@ -5,14 +6,12 @@ import { get as svelteGet } from "svelte/store" // currently supported level of relationship depth (server side) const MAX_DEPTH = 1 -//https://github.com/Budibase/budibase/issues/3030 -const internalType = "internal" - const TYPES_TO_SKIP = [ - FIELDS.FORMULA.type, - FIELDS.LONGFORM.type, - FIELDS.ATTACHMENT.type, - internalType, + FieldType.FORMULA, + FieldType.LONGFORM, + FieldType.ATTACHMENT, + //https://github.com/Budibase/budibase/issues/3030 + FieldType.INTERNAL, ] export function getBindings({ @@ -26,7 +25,7 @@ export function getBindings({ return bindings } for (let [column, schema] of Object.entries(table.schema)) { - const isRelationship = schema.type === FIELDS.LINK.type + const isRelationship = schema.type === FieldType.LINK // skip relationships after a certain depth and types which // can't bind to if ( diff --git a/packages/builder/src/components/backend/TableNavigator/utils.js b/packages/builder/src/components/backend/TableNavigator/utils.js index b7e46042be..ae7aaa0f0a 100644 --- a/packages/builder/src/components/backend/TableNavigator/utils.js +++ b/packages/builder/src/components/backend/TableNavigator/utils.js @@ -12,7 +12,7 @@ const getDefaultSchema = rows => { newSchema[column] = { name: column, type: "string", - constraints: FIELDS["STRING"].constraints, + constraints: FIELDS.STRING.constraints, } }) }) diff --git a/packages/builder/src/helpers/schemaGenerator.js b/packages/builder/src/helpers/schemaGenerator.js index 33115fc997..eb044496f6 100644 --- a/packages/builder/src/helpers/schemaGenerator.js +++ b/packages/builder/src/helpers/schemaGenerator.js @@ -1,17 +1,17 @@ -import { FIELDS } from "constants/backend" +import { FieldType } from "@budibase/types" function baseConversion(type) { if (type === "string") { return { - type: FIELDS.STRING.type, + type: FieldType.STRING, } } else if (type === "boolean") { return { - type: FIELDS.BOOLEAN.type, + type: FieldType.BOOLEAN, } } else if (type === "number") { return { - type: FIELDS.NUMBER.type, + type: FieldType.NUMBER, } } } @@ -31,7 +31,7 @@ function recurse(schemaLevel = {}, objectLevel) { const schema = recurse(schemaLevel[key], value[0]) if (schema) { schemaLevel[key] = { - type: FIELDS.ARRAY.type, + type: FieldType.ARRAY, schema, } } @@ -45,7 +45,7 @@ function recurse(schemaLevel = {}, objectLevel) { } } if (!schemaLevel.type) { - return { type: FIELDS.JSON.type, schema: schemaLevel } + return { type: FieldType.JSON, schema: schemaLevel } } else { return schemaLevel } diff --git a/packages/builder/src/helpers/utils.js b/packages/builder/src/helpers/utils.js index 6bb333f3c4..a1f9b34e3d 100644 --- a/packages/builder/src/helpers/utils.js +++ b/packages/builder/src/helpers/utils.js @@ -1,3 +1,4 @@ +import { FieldType } from "@budibase/types" import { ActionStepID } from "constants/backend/automations" import { TableNames } from "constants" import { @@ -20,20 +21,20 @@ export function buildAutoColumn(tableName, name, subtype) { switch (subtype) { case AUTO_COLUMN_SUB_TYPES.UPDATED_BY: case AUTO_COLUMN_SUB_TYPES.CREATED_BY: - type = FIELDS.LINK.type + type = FieldType.LINK constraints = FIELDS.LINK.constraints break case AUTO_COLUMN_SUB_TYPES.AUTO_ID: - type = FIELDS.NUMBER.type + type = FieldType.NUMBER constraints = FIELDS.NUMBER.constraints break case AUTO_COLUMN_SUB_TYPES.UPDATED_AT: case AUTO_COLUMN_SUB_TYPES.CREATED_AT: - type = FIELDS.DATETIME.type + type = FieldType.DATETIME constraints = FIELDS.DATETIME.constraints break default: - type = FIELDS.STRING.type + type = FieldType.STRING constraints = FIELDS.STRING.constraints break } diff --git a/packages/builder/src/stores/builder/tables.js b/packages/builder/src/stores/builder/tables.js index f86b37ab85..0163281480 100644 --- a/packages/builder/src/stores/builder/tables.js +++ b/packages/builder/src/stores/builder/tables.js @@ -1,7 +1,8 @@ +import { FieldType } from "@budibase/types" import { get, writable, derived } from "svelte/store" import { cloneDeep } from "lodash/fp" import { API } from "api" -import { SWITCHABLE_TYPES, FIELDS } from "constants/backend" +import { SWITCHABLE_TYPES } from "constants/backend" export function createTablesStore() { const store = writable({ @@ -83,14 +84,14 @@ export function createTablesStore() { // make sure tables up to date (related) let newTableIds = [] for (let column of Object.values(updatedTable?.schema || {})) { - if (column.type === FIELDS.LINK.type) { + if (column.type === FieldType.LINK) { newTableIds.push(column.tableId) } } let oldTableIds = [] for (let column of Object.values(oldTable?.schema || {})) { - if (column.type === FIELDS.LINK.type) { + if (column.type === FieldType.LINK) { oldTableIds.push(column.tableId) } } From 890059829f1df88473c7339956c9e3d588471df3 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 26 Mar 2024 10:04:51 +0100 Subject: [PATCH 02/11] More types --- .../backend/Datasources/relationshipErrors.js | 2 +- .../builder/src/constants/backend/index.js | 55 +++++++++---------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/packages/builder/src/components/backend/Datasources/relationshipErrors.js b/packages/builder/src/components/backend/Datasources/relationshipErrors.js index 259484e9a9..610ff9f1fe 100644 --- a/packages/builder/src/components/backend/Datasources/relationshipErrors.js +++ b/packages/builder/src/components/backend/Datasources/relationshipErrors.js @@ -1,4 +1,4 @@ -import { RelationshipType } from "constants/backend" +import { RelationshipType } from "@budibase/types" const typeMismatch = "Column type of the foreign key must match the primary key" const columnBeingUsed = "Column name cannot be an existing column" diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js index f1e3e1e2c2..cf38aa3153 100644 --- a/packages/builder/src/constants/backend/index.js +++ b/packages/builder/src/constants/backend/index.js @@ -1,12 +1,12 @@ -import { FieldType, FieldSubtype } from "@budibase/types" +import { + FieldType, + FieldSubtype, + INTERNAL_TABLE_SOURCE_ID, + AutoFieldSubType, + Hosting, +} from "@budibase/types" -export const AUTO_COLUMN_SUB_TYPES = { - AUTO_ID: "autoID", - CREATED_BY: "createdBy", - CREATED_AT: "createdAt", - UPDATED_BY: "updatedBy", - UPDATED_AT: "updatedAt", -} +export const AUTO_COLUMN_SUB_TYPES = AutoFieldSubType export const AUTO_COLUMN_DISPLAY_NAMES = { AUTO_ID: "Auto ID", @@ -108,12 +108,20 @@ export const FIELDS = { ATTACHMENT: { name: "Attachment", type: FieldType.ATTACHMENT, - icon: "Folder", + icon: "Multiple", constraints: { type: "array", presence: false, }, }, + ATTACHMENT_SINGLE: { + name: "Attachment", + type: FieldType.ATTACHMENT_SINGLE, + icon: "Folder", + constraints: { + presence: false, + }, + }, LINK: { name: "Relationship", type: FieldType.LINK, @@ -167,10 +175,7 @@ export const FILE_TYPES = { DOCUMENT: ["odf", "docx", "doc", "pdf", "csv"], } -export const HostingTypes = { - CLOUD: "cloud", - SELF: "self", -} +export const HostingTypes = Hosting export const Roles = { ADMIN: "ADMIN", @@ -187,12 +192,6 @@ export function isAutoColumnUserRelationship(subtype) { ) } -export const RelationshipType = { - MANY_TO_MANY: "many-to-many", - ONE_TO_MANY: "one-to-many", - MANY_TO_ONE: "many-to-one", -} - export const PrettyRelationshipDefinitions = { MANY: "Many rows", ONE: "One row", @@ -218,7 +217,7 @@ export const SWITCHABLE_TYPES = [ ...ALLOWABLE_NUMBER_TYPES, ] -export const BUDIBASE_INTERNAL_DB_ID = "bb_internal" +export const BUDIBASE_INTERNAL_DB_ID = INTERNAL_TABLE_SOURCE_ID export const DEFAULT_BB_DATASOURCE_ID = "datasource_internal_bb_default" export const BUDIBASE_DATASOURCE_TYPE = "budibase" export const DB_TYPE_INTERNAL = "internal" @@ -265,10 +264,10 @@ export const IntegrationNames = { } export const SchemaTypeOptions = [ - { label: "Text", value: "string" }, - { label: "Number", value: "number" }, - { label: "Boolean", value: "boolean" }, - { label: "Datetime", value: "datetime" }, + { label: "Text", value: FieldType.STRING }, + { label: "Number", value: FieldType.NUMBER }, + { label: "Boolean", value: FieldType.BOOLEAN }, + { label: "Datetime", value: FieldType.DATETIME }, ] export const SchemaTypeOptionsExpanded = SchemaTypeOptions.map(el => ({ @@ -305,10 +304,10 @@ export const PaginationLocations = [ ] export const BannedSearchTypes = [ - "link", - "attachment", - "formula", - "json", + FieldType.LINK, + FieldType.ATTACHMENT, + FieldType.FORMULA, + FieldType.JSON, "jsonarray", "queryarray", ] From fcda81434c7cc5098cd5821ba8e4e075d8ead153 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 26 Mar 2024 10:07:16 +0100 Subject: [PATCH 03/11] Fix types --- packages/builder/src/constants/backend/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js index cf38aa3153..928eb6bbfd 100644 --- a/packages/builder/src/constants/backend/index.js +++ b/packages/builder/src/constants/backend/index.js @@ -5,6 +5,7 @@ import { AutoFieldSubType, Hosting, } from "@budibase/types" +export { RelationshipType } from "@budibase/types" export const AUTO_COLUMN_SUB_TYPES = AutoFieldSubType From 3d45dcea5f5839354af731648133548e32c5cfd9 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 26 Mar 2024 10:19:52 +0100 Subject: [PATCH 04/11] Type renderers --- packages/frontend-core/package.json | 1 + .../src/components/grid/lib/renderers.js | 28 ++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index fd37af63dc..4ca88de8f2 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -8,6 +8,7 @@ "dependencies": { "@budibase/bbui": "0.0.0", "@budibase/shared-core": "0.0.0", + "@budibase/types": "0.0.0", "dayjs": "^1.10.8", "lodash": "4.17.21", "socket.io-client": "^4.6.1" diff --git a/packages/frontend-core/src/components/grid/lib/renderers.js b/packages/frontend-core/src/components/grid/lib/renderers.js index f5d4cfe297..19bf63312d 100644 --- a/packages/frontend-core/src/components/grid/lib/renderers.js +++ b/packages/frontend-core/src/components/grid/lib/renderers.js @@ -1,3 +1,5 @@ +import { FieldType } from "@budibase/types" + import OptionsCell from "../cells/OptionsCell.svelte" import DateCell from "../cells/DateCell.svelte" import MultiSelectCell from "../cells/MultiSelectCell.svelte" @@ -12,19 +14,19 @@ import AttachmentCell from "../cells/AttachmentCell.svelte" import BBReferenceCell from "../cells/BBReferenceCell.svelte" const TypeComponentMap = { - text: TextCell, - options: OptionsCell, - datetime: DateCell, - barcodeqr: TextCell, - longform: LongFormCell, - array: MultiSelectCell, - number: NumberCell, - boolean: BooleanCell, - attachment: AttachmentCell, - link: RelationshipCell, - formula: FormulaCell, - json: JSONCell, - bb_reference: BBReferenceCell, + [FieldType.STRING]: TextCell, + [FieldType.OPTIONS]: OptionsCell, + [FieldType.DATETIME]: DateCell, + [FieldType.BARCODEQR]: TextCell, + [FieldType.LONGFORM]: LongFormCell, + [FieldType.ARRAY]: MultiSelectCell, + [FieldType.NUMBER]: NumberCell, + [FieldType.BOOLEAN]: BooleanCell, + [FieldType.ATTACHMENT]: AttachmentCell, + [FieldType.LINK]: RelationshipCell, + [FieldType.FORMULA]: FormulaCell, + [FieldType.JSON]: JSONCell, + [FieldType.BB_REFERENCE]: BBReferenceCell, } export const getCellRenderer = column => { return TypeComponentMap[column?.schema?.type] || TextCell From edd3ce8f0f6e2dc3340edf8f4978c948122d000b Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 3 Apr 2024 12:13:33 +0200 Subject: [PATCH 05/11] More types --- .../builder/src/templates/commonComponents.js | 18 ++----------- .../app/blocks/FormBlockComponent.svelte | 26 +++++++++---------- 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/packages/builder/src/templates/commonComponents.js b/packages/builder/src/templates/commonComponents.js index 1a953224a7..884419ae6c 100644 --- a/packages/builder/src/templates/commonComponents.js +++ b/packages/builder/src/templates/commonComponents.js @@ -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) diff --git a/packages/client/src/components/app/blocks/FormBlockComponent.svelte b/packages/client/src/components/app/blocks/FormBlockComponent.svelte index ea1c3b0a37..34168355c4 100644 --- a/packages/client/src/components/app/blocks/FormBlockComponent.svelte +++ b/packages/client/src/components/app/blocks/FormBlockComponent.svelte @@ -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 => { From f771cc17a770feae75db288622b196523f857bb4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 3 Apr 2024 12:15:47 +0200 Subject: [PATCH 06/11] Type FieldTypeToComponentMap --- .../controls/FieldConfiguration/utils.js | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/packages/builder/src/components/design/settings/controls/FieldConfiguration/utils.js b/packages/builder/src/components/design/settings/controls/FieldConfiguration/utils.js index c929263db1..18ebf57d98 100644 --- a/packages/builder/src/components/design/settings/controls/FieldConfiguration/utils.js +++ b/packages/builder/src/components/design/settings/controls/FieldConfiguration/utils.js @@ -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", } From 94890eae3e1d3f81193c7073e7b46f9163c3c0e6 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 3 Apr 2024 12:26:25 +0200 Subject: [PATCH 07/11] Type TypeIconMap --- .../src/components/grid/lib/utils.js | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/frontend-core/src/components/grid/lib/utils.js b/packages/frontend-core/src/components/grid/lib/utils.js index 80bc3d9d67..12a46d3147 100644 --- a/packages/frontend-core/src/components/grid/lib/utils.js +++ b/packages/frontend-core/src/components/grid/lib/utils.js @@ -1,3 +1,5 @@ +import { FieldType, FieldTypeSubtypes } from "@budibase/types" + export const getColor = (idx, opacity = 0.3) => { if (idx == null || idx === -1) { idx = 0 @@ -7,21 +9,21 @@ export const getColor = (idx, opacity = 0.3) => { const TypeIconMap = { text: "Text", - options: "Dropdown", - datetime: "Date", - barcodeqr: "Camera", - longform: "TextAlignLeft", - array: "Dropdown", - number: "123", - boolean: "Boolean", - attachment: "AppleFiles", - link: "DataCorrelated", - formula: "Calculator", - json: "Brackets", - bigint: "TagBold", - bb_reference: { - user: "User", - users: "UserGroup", + [FieldType.OPTIONS]: "Dropdown", + [FieldType.DATETIME]: "Date", + [FieldType.BARCODEQR]: "Camera", + [FieldType.LONGFORM]: "TextAlignLeft", + [FieldType.ARRAY]: "Dropdown", + [FieldType.NUMBER]: "123", + [FieldType.BOOLEAN]: "Boolean", + [FieldType.ATTACHMENT]: "AppleFiles", + [FieldType.LINK]: "DataCorrelated", + [FieldType.FORMULA]: "Calculator", + [FieldType.JSON]: "Brackets", + [FieldType.BIGINT]: "TagBold", + [FieldType.BB_REFERENCE]: { + [FieldTypeSubtypes.BB_REFERENCE.USER]: "User", + [FieldTypeSubtypes.BB_REFERENCE.USERS]: "UserGroup", }, } From 5f55b85e98b2fe3f4f1f2efcfbece84a8a50ce33 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 3 Apr 2024 12:29:13 +0200 Subject: [PATCH 08/11] Remove single --- packages/builder/src/constants/backend/index.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js index 928eb6bbfd..379b8ed713 100644 --- a/packages/builder/src/constants/backend/index.js +++ b/packages/builder/src/constants/backend/index.js @@ -115,14 +115,6 @@ export const FIELDS = { presence: false, }, }, - ATTACHMENT_SINGLE: { - name: "Attachment", - type: FieldType.ATTACHMENT_SINGLE, - icon: "Folder", - constraints: { - presence: false, - }, - }, LINK: { name: "Relationship", type: FieldType.LINK, From 1fd4365cbadaa6e1912400ed2f50788ad51b3e0e Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 3 Apr 2024 12:38:17 +0200 Subject: [PATCH 09/11] Lint --- packages/builder/src/constants/backend/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js index 379b8ed713..b25bee9972 100644 --- a/packages/builder/src/constants/backend/index.js +++ b/packages/builder/src/constants/backend/index.js @@ -5,6 +5,7 @@ import { AutoFieldSubType, Hosting, } from "@budibase/types" + export { RelationshipType } from "@budibase/types" export const AUTO_COLUMN_SUB_TYPES = AutoFieldSubType From fba24987af24b56d9d76f3ea8ff2afd72ecf48eb Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 3 Apr 2024 12:41:32 +0200 Subject: [PATCH 10/11] Undo icon change --- packages/builder/src/constants/backend/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js index b25bee9972..dd751d4e13 100644 --- a/packages/builder/src/constants/backend/index.js +++ b/packages/builder/src/constants/backend/index.js @@ -110,7 +110,7 @@ export const FIELDS = { ATTACHMENT: { name: "Attachment", type: FieldType.ATTACHMENT, - icon: "Multiple", + icon: "Folder", constraints: { type: "array", presence: false, From a6c56c35d4bf4c8a77268853b46c2e528e1df8f0 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 3 Apr 2024 12:43:51 +0200 Subject: [PATCH 11/11] Type --- packages/frontend-core/src/components/grid/lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend-core/src/components/grid/lib/utils.js b/packages/frontend-core/src/components/grid/lib/utils.js index 12a46d3147..8382bfece8 100644 --- a/packages/frontend-core/src/components/grid/lib/utils.js +++ b/packages/frontend-core/src/components/grid/lib/utils.js @@ -8,7 +8,7 @@ export const getColor = (idx, opacity = 0.3) => { } const TypeIconMap = { - text: "Text", + [FieldType.STRING]: "Text", [FieldType.OPTIONS]: "Dropdown", [FieldType.DATETIME]: "Date", [FieldType.BARCODEQR]: "Camera",