Skip to content

feat(ViewFilters): View filter expansions

Pandu Supriyono requested to merge feature/expand-view-filters into master

Related pulse

https://uncinc.monday.com/boards/99020894/pulses/4898878962

What does this MR do?

  • Adds an option in the ViewFilterQueryProvider to determine the "source of truth" with regards to the filtering and pagination state: it can now be set using the storageType prop and can be set to memory or url (defaults to memory if not provided or an invalid value is provided)
  • Adds an option so that a ViewFilterQueryProvider is rendered with View by adding a withProvider prop to the View (and optionally the props for the provider).
  • Removes a minor and redundant operation when determining new filters in the setFilters and setQueryParams callbacks.

Rationale

Sometimes you might want multiple views on a page, one of which is controlled by the URL query params and the other(s) are controlled by a React State. Previously, there was no analogous solution (that is, with a similar interface) to manage filtering and pagination using React state. Alternatively, you could even manage all views on a page using URL query params, given that the filter keys are unique (as well as the pagination key, which you can alter with the pageQueryParam prop).

Additionally, the previous implementation did not provide an easy or idiomatic way to implement the provider in a project. With this MR, we bake the provider in the View component, so little extra work needs to be done to activate this feature.

Checklist

  • Manual testing to check if breaking
  • Automatic testing
  • Run and fixed eslint
Edited by Pandu Supriyono

Merge request reports

Loading