Support date properties in facet search - change default type

This commit is contained in:
flammermann 2024-01-02 21:50:03 +00:00
parent 6572138780
commit fc97134d13
2 changed files with 3 additions and 3 deletions

View file

@ -706,7 +706,7 @@ L.U.Help = L.Class.extend({
slugKey: L._('The name of the property to use as feature unique identifier.'), slugKey: L._('The name of the property to use as feature unique identifier.'),
filterKey: L._('Comma separated list of properties to use when filtering features'), filterKey: L._('Comma separated list of properties to use when filtering features'),
facetKey: L._( facetKey: L._(
'Comma separated list of properties to use for facet search (eg.: mykey,otherkey). To control label, add it after a | (eg.: mykey|My Key,otherkey|Other Key). To control type, add it after another | (eg.: mykey|My Key|checkbox,otherkey|Other Key|date)' 'Comma separated list of properties to use for facet search (eg.: mykey,otherkey). To control label, add it after a | (eg.: mykey|My Key,otherkey|Other Key). To control data type, add it after another | (eg.: mykey|My Key|enum,otherkey|Other Key|date)'
), ),
interactive: L._('If false, the polygon or line will act as a part of the underlying map.'), interactive: L._('If false, the polygon or line will act as a part of the underlying map.'),
outlink: L._('Define link to open in a new window on polygon click.'), outlink: L._('Define link to open in a new window on polygon click.'),

View file

@ -1364,7 +1364,7 @@ L.U.Map.include({
{ {
handler: 'Input', handler: 'Input',
helpEntries: 'facetKey', helpEntries: 'facetKey',
placeholder: L._('Example: key1,key2|Label 2,key3|Label 3|checkbox'), placeholder: L._('Example: key1,key2|Label 2,key3|Label 3|enum'),
label: L._('Facet keys'), label: L._('Facet keys'),
}, },
], ],
@ -2035,7 +2035,7 @@ L.U.Map.include({
const els = curr.split('|') const els = curr.split('|')
acc[els[0]] = { acc[els[0]] = {
"label": els[1] || els[0], "label": els[1] || els[0],
"type": els[2] || "checkbox" "type": els[2] || "enum"
} }
return acc return acc
}, {}) }, {})