feat(activity): ✨ adding activity tags (UI, routes, persistence) #45#136
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces activity tags across the MyTraL stack: parsing + persistence on the backend, form handling/routes, and display/filtering in the UI. It also reuses the same CSV tag parsing logic for exercise type tags to keep tag input behavior consistent.
Changes:
- Added a shared
utils.parse_tags_csv()helper and used it in activity + exercise-type tag handling. - Extended activity create/update + list/search routes to store, filter, and search by tags.
- Updated templates to edit and render tags (badges) and added a tag filter on the year activity list; added tests covering parsing + persistence behavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_activity_tags.py | New tests for tag CSV parsing, ActivityEntity tag round-trips, and dataset persistence/search predicates. |
| mytral/utils.py | Adds parse_tags_csv() helper for normalized tag parsing. |
| mytral/templates/macros/activity_list_table.html | Renders activity tags as badges in the list table (and links them when year is available). |
| mytral/templates/activity-update.html | Adds tags field to the activity update UI. |
| mytral/templates/activity-update-all.html | Adds tags field to the bulk update UI. |
| mytral/templates/activity-list-year.html | Adds tag filtering UI + renders tag badges in the year feed/list view. |
| mytral/templates/activity-get.html | Renders tags on activity detail page and links to year list filtered by tag. |
| mytral/templates/activity-create.html | Adds tags field to the activity create UI. |
| mytral/routes.py | Populates the tags form field on edit; adds tag filter in year list and tag matching in search. |
| mytral/forms.py | Adds tags field to activity form and persists tags via from_activity_form(). |
| mytral/blueprints/exercise_types_crud.py | Reuses utils.parse_tags_csv() for exercise type tags to avoid duplicated parsing logic. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR brings activity tags.
Related: