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

[To Main] Feature/DESENG-445: engagement filtering by metadata #2444

Merged
merged 43 commits into from
Apr 5, 2024

Conversation

NatSquared
Copy link
Contributor

Issue #: 🎟️DESENG-445

  • Added properties to metadata taxa to allow them to be marked as filterable.
  • Added a new file filter_types.py where additional filters can be added as subquery factory functions.
  • Added a new endpoint to the API to retrieve filterable taxa.
  • Modified the search endpoint to allow filtering by metadata.
  • Added schemas, data validation and unit tests for the new functionality.
  • Updated the Metadata Management UI to allow taxa to be marked as filterable.
    • Currently, the only two filter types are chips_any and chips_all.
    • chips_any: Displays as a series of toggleable buttons ("chips"), uses the list_match_any subquery returning engagements with any of the selected values.
    • chips_all: Similar to chips_any; uses the list_match_all subquery to get only engagements with ALL of the selected values.
  • If multiple filterable taxa are selected, all the taxon filters must be met for an engagement to be returned.
  • Updated the public-facing engagement list to allow filtering by metadata taxa. This makes use of the new API endpoint to retrieve filterable taxa.
  • Added a new filter "drawer" to the listing page to hold these and any future filter types.
  • Fixed a display issue with the public engagements page where engagements would not take up the full width of their grid cell.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the met-public license (Apache 2.0).

NatSquared and others added 30 commits February 9, 2024 12:27
* DESENG-452 : Applying pending migrations

* Updating unit test

* Updated changelog

* Fixed lint issue
* DESENG-484: Adding max age for cors (#2377)
@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 73.52941% with 72 lines in your changes are missing coverage. Please review.

Project coverage is 75.58%. Comparing base (1a92863) to head (57824ab).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2444      +/-   ##
==========================================
- Coverage   75.66%   75.58%   -0.08%     
==========================================
  Files         577      583       +6     
  Lines       20563    20770     +207     
  Branches     1494     1526      +32     
==========================================
+ Hits        15558    15699     +141     
- Misses       4771     4835      +64     
- Partials      234      236       +2     
Flag Coverage Δ
metapi 87.75% <94.50%> (+0.07%) ⬆️
metweb 63.69% <62.98%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
met-api/src/met_api/models/engagement_metadata.py 81.06% <100.00%> (+0.74%) ⬆️
met-api/src/met_api/resources/engagement.py 100.00% <100.00%> (ø)
met-api/src/met_api/schemas/engagement_metadata.py 84.21% <100.00%> (+2.21%) ⬆️
...api/src/met_api/services/metadata_taxon_service.py 95.00% <100.00%> (+1.15%) ⬆️
met-api/src/met_api/utils/filter_types.py 100.00% <100.00%> (ø)
met-web/src/apiManager/endpoints/index.ts 100.00% <ø> (ø)
...b/src/components/engagement/form/ActionContext.tsx 61.90% <100.00%> (ø)
...gagementFormTabs/EngagementContent/ContentTabs.tsx 75.94% <ø> (ø)
.../form/EngagementFormTabs/EngagementTabsContext.tsx 68.89% <100.00%> (-0.48%) ⬇️
...et-web/src/components/landing/LandingComponent.tsx 100.00% <100.00%> (+5.88%) ⬆️
... and 14 more

@NatSquared NatSquared marked this pull request as ready for review April 5, 2024 18:12
@NatSquared NatSquared changed the title [TO MAIN] Feature/DESENG-445: engagement filtering by metadata [To Main] Feature/DESENG-445: engagement filtering by metadata Apr 5, 2024
Copy link
Collaborator

@ratheesh-aot ratheesh-aot left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

sonarqubecloud bot commented Apr 5, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
2 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@NatSquared NatSquared merged commit bbbaddf into main Apr 5, 2024
15 checks passed
@NatSquared NatSquared deleted the feature/DESENG-445-engagement-filtering-by-metadata branch April 22, 2024 17:29
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.

4 participants