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

Feature/op 81/query param filters #357

Merged
merged 12 commits into from
Oct 27, 2023

Conversation

lencodes
Copy link
Contributor

@lencodes lencodes commented Oct 24, 2023

Before actually implementing the query params, I thought it'd be better to first implement our new filters way of working (open catalogi was still using older methods).

Also before implementing the query params, I'd like to merge this to minimise the code changes per pull request.

Forgot to merge this timely, but the additional changes were smaller than expected, so should be okay to keep in one pull request 🤞🏼

This pull request includes:

  • Refactored all context in the application, to be more alike the context in other projects (custom hook per context-type, with one Provider, instead of multiple);
  • Added a filtersToUrlQueryParams service, which rewrites filters to URL Query params (with URIEncoding, so that we can keep spaces);
  • Added a getParsedParamsFromSearch service, which creates a JSON object from the query params (incl. decoding of numbers, arrays, booleans and the encoded strings);
  • Refactored the FilterContext to push all changes to the URL and thereafter update the filters (this way the URL is always leading, making deep-linking possible)

Known issue / to-do:

  • The clearing of filters in the ActiveFiltersTemplate doesn't work, unsure why at this moment
  • On the Component page, when you select (e.g.) Cards as the display and refresh the page, it switches back to Table (default) before going back to Cards. The result is what we want, but the switching should be addressed still.

@lencodes lencodes requested a review from remko48 October 24, 2023 08:35
Copy link
Collaborator

@remko48 remko48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@remko48 remko48 merged commit 4f19024 into development Oct 27, 2023
2 checks passed
@remko48 remko48 deleted the feature/OP-81/query-param-filters branch October 27, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants