Allow custom labels for dynamic filter
This commit is contained in:
parent
cc3b174f87
commit
68d0a4c336
|
@ -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",
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 = [
|
||||||
|
|
Loading…
Reference in New Issue