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

Helpers for encoding/decoding listings filters #274

Merged
merged 27 commits into from
Aug 2, 2021
Merged

Conversation

abbiefarr
Copy link

@abbiefarr abbiefarr commented Jul 27, 2021

Issue

#240

Addresses # (issue)

  • This change addresses the issue in full
  • This change addresses only certain aspects of the issue
  • This change is a dependency for another issue
  • This change has a dependency from another issue

Description

Adds helpers to:

  • create a backend query string based on ListingFilterParams
  • create a frontend query string based on ListingFilterParams
  • create ListingFilterParams from a frontend url, e.g. one provided by the eligibility questionnaire page.

For decoding a frontend url into ListingFilterParams, the url is expected to be in the form: {listings_urll}?page=1&filter1=val1&filter2=val2.

NOTE: this does not yet support multiple values per filter.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Prototype/POC (not to merge)
  • This change is a refactor/address technical debt
  • This change requires a documentation update
  • This change requires a SQL Script

How Can This Be Tested/Reviewed?

See added unit tests.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have reviewed the changes in a desktop view
  • I have reviewed the changes in a mobile view
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have assigned reviewers
  • I have updated the changelog to include a description of my changes

@abbiefarr abbiefarr added the epic: filtering Tickets related to Filtering label Jul 27, 2021
@abbiefarr abbiefarr marked this pull request as ready for review July 28, 2021 13:38
@abbiefarr abbiefarr added this to the M8 milestone Jul 28, 2021
@abbiefarr abbiefarr requested a review from avaleske July 28, 2021 13:39
@abbiefarr abbiefarr marked this pull request as draft July 28, 2021 15:04
@abbiefarr abbiefarr marked this pull request as ready for review July 28, 2021 17:12
@abbiefarr abbiefarr force-pushed the url-filtering-support branch from 3dc724d to d614726 Compare July 28, 2021 17:32
@abbiefarr abbiefarr linked an issue Jul 28, 2021 that may be closed by this pull request
Copy link

@avaleske avaleske left a comment

Choose a reason for hiding this comment

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

This is super great, thank you!

@abbiefarr abbiefarr merged commit fef3e6f into main Aug 2, 2021
@abbiefarr abbiefarr deleted the url-filtering-support branch August 2, 2021 14:31
seanmalbert pushed a commit that referenced this pull request Jun 23, 2022
* Consolidate filter definitions

* fix test

* Move filter keys to listing.dto and rename

* fix test

* Add url param support for filtering

* simplify state update

* address comments

* Add filter helpers

* encode and decode helpers for filtering

* Fix code style issues with Prettier

* encode and decode helpers for filtering

* Use filter helpers

* Fix code style issues with Prettier

* address comments

* Fix code style issues with Prettier

* fix lint errors

Co-authored-by: Lint Action <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic: filtering Tickets related to Filtering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add url support for filtering
3 participants