From 475775206cae52626d6da06841214b19d114f8e7 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 25 Sep 2024 14:20:03 +0200 Subject: [PATCH] Fix test --- .../controls/GridColumnConfiguration/getColumns.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/design/settings/controls/GridColumnConfiguration/getColumns.js b/packages/builder/src/components/design/settings/controls/GridColumnConfiguration/getColumns.js index dcfed9053f..d3f081756d 100644 --- a/packages/builder/src/components/design/settings/controls/GridColumnConfiguration/getColumns.js +++ b/packages/builder/src/components/design/settings/controls/GridColumnConfiguration/getColumns.js @@ -72,7 +72,7 @@ const toGridFormat = draggableListColumns => { })) } -const toDraggableListFormat = (gridFormatColumns, createComponent) => { +const toDraggableListFormat = (gridFormatColumns, createComponent, schema) => { return gridFormatColumns.map(column => { return createComponent( "@budibase/standard-components/labelfield", @@ -82,7 +82,7 @@ const toDraggableListFormat = (gridFormatColumns, createComponent) => { active: column.active, field: column.field, label: column.label, - columnType: column.columnType, + columnType: column.columnType || schema[column.field].type, width: column.width, conditions: column.conditions, }, @@ -103,7 +103,11 @@ const getColumns = ({ getDefault(schema), primaryDisplayColumnName ) - const draggableList = toDraggableListFormat(validatedColumns, createComponent) + const draggableList = toDraggableListFormat( + validatedColumns, + createComponent, + schema + ) const primary = draggableList .filter(entry => entry.field === primaryDisplayColumnName) .map(instance => ({ ...instance, schema }))[0]