Update table component to use new settings component and support new column config setting structure
This commit is contained in:
parent
b94ed3d23b
commit
5f72066dde
|
@ -2680,11 +2680,10 @@
|
||||||
"defaultValue": 8
|
"defaultValue": 8
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "multifield",
|
"type": "columns",
|
||||||
"label": "Columns",
|
"label": "Columns",
|
||||||
"key": "columns",
|
"key": "columns",
|
||||||
"dependsOn": "dataProvider",
|
"dependsOn": "dataProvider"
|
||||||
"placeholder": "All columns"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "select",
|
"type": "select",
|
||||||
|
|
|
@ -40,7 +40,8 @@
|
||||||
// Check for an invalid column selection
|
// Check for an invalid column selection
|
||||||
let invalid = false
|
let invalid = false
|
||||||
customColumns?.forEach(column => {
|
customColumns?.forEach(column => {
|
||||||
if (schema[column] == null) {
|
const columnName = typeof column === "string" ? column : column.name
|
||||||
|
if (schema[columnName] == null) {
|
||||||
invalid = true
|
invalid = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -75,9 +76,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
fields.forEach(field => {
|
fields.forEach(field => {
|
||||||
newSchema[field] = schema[field]
|
const columnName = typeof field === "string" ? field : field.name
|
||||||
if (schema[field] && UnsortableTypes.indexOf(schema[field].type) !== -1) {
|
if (!schema[columnName]) {
|
||||||
newSchema[field].sortable = false
|
return
|
||||||
|
}
|
||||||
|
newSchema[columnName] = schema[columnName]
|
||||||
|
if (UnsortableTypes.includes(schema[columnName].type)) {
|
||||||
|
newSchema[columnName].sortable = false
|
||||||
|
}
|
||||||
|
if (field?.displayName) {
|
||||||
|
newSchema[columnName].displayName = field?.displayName
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return newSchema
|
return newSchema
|
||||||
|
|
Loading…
Reference in New Issue