-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[To Main] Feature/DESENG-445: engagement filtering by metadata (#2444)
- **Feature** Engagement filtering - Add filtering by taxon [🎟️DESENG-445](https://apps.itsm.gov.bc.ca/jira/browse/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. - (Out of scope, but related to UX work for this ticket) Fixed a display issue with the public engagements page where engagements would not take up the full width of their grid cell. --------- Co-authored-by: Ratheesh kumar R <[email protected]> Co-authored-by: VineetBala-AOT <[email protected]> Co-authored-by: Baelx <[email protected]>
- Loading branch information
1 parent
51d101f
commit bbbaddf
Showing
40 changed files
with
1,894 additions
and
374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
met-api/migrations/versions/f8bc8ce202f3_add_metadata_filters.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""Add metadata filters to the engagement metadata taxa table. | ||
Revision ID: f8bc8ce202f3 | ||
Revises: 734f160dd120 | ||
Create Date: 2024-03-21 13:02:12.680363 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'f8bc8ce202f3' | ||
down_revision = '734f160dd120' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('engagement_metadata_taxa', sa.Column( | ||
'filter_type', sa.String(length=64), nullable=True)) | ||
op.add_column('engagement_metadata_taxa', sa.Column( | ||
'include_freeform', sa.Boolean(), nullable=False, server_default='false')) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column('engagement_metadata_taxa', 'include_freeform') | ||
op.drop_column('engagement_metadata_taxa', 'filter_type') | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.