Allow custom labels for dynamic filter

This commit is contained in:
Mel O'Hagan 2022-11-18 15:52:30 +00:00
parent cc3b174f87
commit 68d0a4c336
3 changed files with 11 additions and 6 deletions

View File

@ -3940,10 +3940,11 @@
"required": true
},
{
"type": "multifield",
"label": "Allowed filter fields",
"type": "columns",
"label": "Allowed filter columns",
"key": "allowedFields",
"placeholder": "All fields"
"dependsOn": "dataProvider",
"nested": true
},
{
"type": "select",

View File

@ -61,8 +61,9 @@
clonedSchema = schema
} else {
allowedFields?.forEach(field => {
if (schema[field]) {
clonedSchema[field] = schema[field]
if (schema[field.name]) {
clonedSchema[field.name] = schema[field.name]
clonedSchema[field.name].displayName = field.displayName
}
})
}

View File

@ -25,7 +25,10 @@
!BannedTypes.includes(field.type) ||
(field.type === "formula" && field.formulaType === "static")
)
.map(field => field.name)
.map(field => ({
label: field.displayName || field.name,
value: field.name,
}))
const addFilter = () => {
filters = [