Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tide Custom Collection - Provide filter values to child components. #1114

Open
3 of 4 tasks
alan-cole opened this issue Apr 15, 2024 · 1 comment
Open
3 of 4 tasks
Assignees
Labels
Proposal - Draft New feature proposal

Comments

@alan-cole
Copy link
Contributor

alan-cole commented Apr 15, 2024

Describe the feature

Allow the values of filters in a Custom Collection to be accessible to children (particularly results).

Motivation

In some cases a result component may require a value from the applied filters.

For example:

Screenshot 2024-04-15 at 11 40 12 AM

An "Open in google maps" link on on a result. This requires an origin and destination to correctly fill the link:

https://www.google.com/maps/dir/?api=1&origin=[ORIGIN]&destination=[DESTINATION]

While the destination can be found from the result's address field, the origin would be the the user defined address in the search form, which is not passed through to the results.

Proposal

Using the provide / inject method, we could provide the necessary fields to any child of the custom collection, e.g.:

provide('rplTideCustomCollectionFilters', {
  searchTerm,
  locationQuery,
  filterForm
})

in here:

https://github.com/dpc-sdp/ripple-framework/blob/develop/packages/ripple-tide-search/components/global/TideCustomCollection.vue#L386

Note it doesn't need to be limited to these, and could include other useful variables as well.

Benefits

Solves the issue outlined in motivation, and could be useful for other cases (e.g. showing all terms of a field and highlighting the ones being filtered upon).

Drawbacks

This may open a pathway to unwanted workarounds to other limitations, as additional scope is now exposed.

Adoption strategy

Could be documented in an example, a test, or other developer documentation.

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be created outside of Ripple-framework as a layer?

Final checks

@alan-cole alan-cole added the Proposal - Draft New feature proposal label Apr 15, 2024
@alan-cole
Copy link
Contributor Author

This feature is no longer required for the particular project I was working on and can be closed if deemed unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Proposal - Draft New feature proposal
Projects
None yet
Development

No branches or pull requests

2 participants