Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
18.4.6
-
Unknown
-
Description
Steps to reproduce
- Have a class with a static list property, e.g. status with the values DRAFT=draft|DISCLOSED=disclosed, and a few pages holding an object of it with different values.
- Display them in a live data which filters on that property by default, either with the macro parameter or with the live data configuration:
{{liveData id="test" properties="doc.title,status" source="liveTable" sourceParameters="className=Sandbox.TestClass" filters="status=DISCLOSED" /}}or
{"query": {"filters": [{"property": "status", "constraints": [{"operator": "equals", "value": "DISCLOSED"}]}]}} - View the page.
Expected
The status column filter (and the advanced filter panel) display the default filter value, disclosed, so that the user knows the entries are filtered and can remove the filter from there.
Actual
The entries are correctly filtered, but the status column filter and the value of the advanced filter panel look empty: the user can't see that the entries are filtered, nor remove the filter from the column.
Cause
In FilterList.vue, the selectize settings pass options: this.config.options || []. When the filter descriptor has no options (the values are only suggested through its searchURL, as for a static list property of the liveTable source), that empty array replaces the option Tom Select creates from the initial value of the input. The initial item is then dropped since no option matches it, so it's not selected, and its label is never loaded through loadSelected.
Reproduced on 18.4.6 (Tom Select). Not reproduced on 17.10.0 (Selectize), which has the same FilterList.vue code: the bug was probably introduced by the switch to Tom Select (XWIKI-24088).
Workaround
Pass the options of the list filter explicitly in the live data configuration, so that the initial value is among them:
{"meta": {"propertyDescriptors": [{"id": "status", "filter": {"options": [{"value": "DRAFT", "label": "draft"}, {"value": "DISCLOSED", "label": "disclosed"}]}}]}}
Attachments
Issue Links
- relates to
-
XWIKI-24088 Replace Selectize with Tom Select
-
- Closed
-