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

Search for projects by exact mapping type #3904

Merged
merged 2 commits into from
Dec 1, 2020

Conversation

d-rita
Copy link
Contributor

@d-rita d-rita commented Nov 20, 2020

What does this PR do?
Give the user the option of searching for projects matching the exact mapping type or get all projects that contain the mapping type.

Steps Taken:

  • Add mappingTypesExact search param
  • Return only projects of the given mapping type if mappingTypesExact is True.
  • Return all projects containing the mapping type(s) if mappingTypesExact is False.

Related issues:
#3852

Test:

  • Using Postman with the GET method, test for projects of different mapping types using: http://127.0.0.1:5000/api/v2/projects/?mappingTypes=<string:mapping_type>&mappingTypesExact=true
  • For example: http://127.0.0.1:5000/api/v2/projects/?mappingTypes=ROADS&mappingTypesExact=true

backend/api/projects/resources.py Show resolved Hide resolved
backend/services/project_search_service.py Outdated Show resolved Hide resolved
@d-rita d-rita force-pushed the refactor/project-search-mapping-type branch from fad3fff to 5bdb9e6 Compare November 23, 2020 08:47
@d-rita d-rita changed the title Search for projects by exact mapping type [WIP] Search for projects by exact mapping type Nov 23, 2020
@d-rita d-rita changed the title [WIP] Search for projects by exact mapping type Search for projects by exact mapping type Nov 24, 2020
- Add mappingTypesExact search param
- Add new query to return only projects matching the requested types if mappingTypesExact is true
- Add query to return all projects with any of the mapping types for mappingTypesExact is false
- Add mappingTypesExact param to docstrings
@d-rita d-rita force-pushed the refactor/project-search-mapping-type branch from 8a8b594 to 2141fae Compare November 24, 2020 10:34
Copy link
Contributor

@willemarcel willemarcel left a comment

Choose a reason for hiding this comment

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

Fantastic solution!!!

@willemarcel willemarcel added this to the 4.2.2 milestone Nov 26, 2020
@willemarcel
Copy link
Contributor

@d-rita I added the field on the frontend. Could you test it?

@willemarcel willemarcel linked an issue Nov 30, 2020 that may be closed by this pull request
@willemarcel willemarcel merged commit 94840cd into develop Dec 1, 2020
@willemarcel willemarcel deleted the refactor/project-search-mapping-type branch December 10, 2020 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new search param to refine mapping type filter
2 participants