You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a hookonAggregationUpdateHook that runs when aggregations are retrieved.
When onAggregationUpdateHook runs, it updates the options in the uiFilters ref, but these new options are not reflected to the user because TideSearchFilters's attribute filterInputs is not populated from uiFilters, but from userFilters.
alan-cole
changed the title
Tide Custom Collection filters using aggregations don't update with their fields after page load.
Tide Custom Collection filters using aggregations don't update their field options after aggregations load.
Apr 5, 2024
Environment
Darwin
v16.16.0
3.6.5
2.5.2
npm@8.12.1
vite
extends
-
-
Reproduction
Create a Custom Collection using a filter that is loaded through aggregations, e.g.
As we have no
props.options
defined, it should update it's dynamicOptions after the aggregations have completed.Describe the bug
TideCustomCollection.vue
has:userFilters
which is passed toTideSearchFilters
attributefilterInputs
to defined form elements for user changeable filters.uiFilters
which is initially set touserFilters
.onAggregationUpdateHook
that runs when aggregations are retrieved.When
onAggregationUpdateHook
runs, it updates the options in theuiFilters
ref, but these new options are not reflected to the user becauseTideSearchFilters
's attributefilterInputs
is not populated fromuiFilters
, but fromuserFilters
.By changing this line:
https://github.com/dpc-sdp/ripple-framework/blob/develop/packages/ripple-tide-search/components/global/TideCustomCollection.vue#L498
from
:filterInputs="userFilters"
to:filterInputs="uiFilters"
, when aggregations become available, the form options will correctly update.Additional context
This bug may also be present in
TideSearchListingPage
, as it seems to have the same pattern:https://github.com/dpc-sdp/ripple-framework/blob/develop/packages/ripple-tide-search/components/TideSearchListingPage.vue#L150C7-L150C16
uiFilters
that updatehttps://github.com/dpc-sdp/ripple-framework/blob/develop/packages/ripple-tide-search/components/TideSearchListingPage.vue#L385
userFilters
that is passed to the form.Solution example
Below are 2 videos to show the difference between the bug as it currently is, and the proposed solution.
https://github.com/dpc-sdp/ripple-framework/assets/12739575/49857c0f-79ce-41a8-b6fe-114d33c12300
In this video using the OOTB
TideCustomCollection
, the "Area of law" dropdown is still not populated with aggregated results even after the pins have loaded.https://github.com/dpc-sdp/ripple-framework/assets/12739575/ae38e116-79aa-4920-9521-b4440406aca9
In this video using a modified
TideCustomCollection
with theuiFilters
change, the aggregate results appear as soon as the pins have loaded.Logs
No response
Final checks
The text was updated successfully, but these errors were encountered: