This commit is contained in:
Adria Navarro 2024-09-25 14:20:03 +02:00
parent c351a9bced
commit 475775206c
1 changed files with 7 additions and 3 deletions

View File

@ -72,7 +72,7 @@ const toGridFormat = draggableListColumns => {
})) }))
} }
const toDraggableListFormat = (gridFormatColumns, createComponent) => { const toDraggableListFormat = (gridFormatColumns, createComponent, schema) => {
return gridFormatColumns.map(column => { return gridFormatColumns.map(column => {
return createComponent( return createComponent(
"@budibase/standard-components/labelfield", "@budibase/standard-components/labelfield",
@ -82,7 +82,7 @@ const toDraggableListFormat = (gridFormatColumns, createComponent) => {
active: column.active, active: column.active,
field: column.field, field: column.field,
label: column.label, label: column.label,
columnType: column.columnType, columnType: column.columnType || schema[column.field].type,
width: column.width, width: column.width,
conditions: column.conditions, conditions: column.conditions,
}, },
@ -103,7 +103,11 @@ const getColumns = ({
getDefault(schema), getDefault(schema),
primaryDisplayColumnName primaryDisplayColumnName
) )
const draggableList = toDraggableListFormat(validatedColumns, createComponent) const draggableList = toDraggableListFormat(
validatedColumns,
createComponent,
schema
)
const primary = draggableList const primary = draggableList
.filter(entry => entry.field === primaryDisplayColumnName) .filter(entry => entry.field === primaryDisplayColumnName)
.map(instance => ({ ...instance, schema }))[0] .map(instance => ({ ...instance, schema }))[0]