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 "required": true
}, },
{ {
"type": "multifield", "type": "columns",
"label": "Allowed filter fields", "label": "Allowed filter columns",
"key": "allowedFields", "key": "allowedFields",
"placeholder": "All fields" "dependsOn": "dataProvider",
"nested": true
}, },
{ {
"type": "select", "type": "select",

View File

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

View File

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