Add instance as member of timeline#50
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds the ability to associate scheduled activity instances and timings with specific schedule timelines through a new member_of_timeline field. This enables filtering and organizing instances by their parent timeline.
Key changes:
- Added
member_of_timelinecolumn to the instances table via database migration - Updated instance and timing export functions to support optional timeline filtering
- Added UI dropdown for selecting timeline membership when creating/editing instances
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/usdm/generate_study_timings.py | Added optional member_of_timeline parameter to filter timings by timeline |
| src/usdm/generate_scheduled_activity_instances.py | Added optional member_of_timeline parameter to filter instances by timeline |
| src/usdm/generate_schedule_timelines.py | New file that builds USDM schedule timeline objects with associated timings and instances |
| src/soa_builder/web/templates/instances.html | Added "Member of Timeline" dropdown to instance creation and editing forms |
| src/soa_builder/web/schemas.py | Added member_of_timeline field to InstanceUpdate and InstanceCreate schemas |
| src/soa_builder/web/routers/instances.py | Updated instance CRUD operations to handle the new member_of_timeline field |
| src/soa_builder/web/migrate_database.py | Added migration function to add member_of_timeline column to instances table |
| src/soa_builder/web/app.py | Registered the new instances migration function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
spelling Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
spelling Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
spelling Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #!/usr/bin/env python3 | ||
| # Prefer absolute import; fallback to adding src/ to sys.path when run directly | ||
| from typing import Optional, List, Dict, Any, Tuple | ||
| from typing import Optional, List, Dict, Any |
There was a problem hiding this comment.
The Tuple import was removed but this may break code if it's used elsewhere in the file. Verify that Tuple is not needed in this file.
| from typing import Optional, List, Dict, Any | |
| from typing import Optional, List, Dict, Any, Tuple |
Added code to select timeline for an instance to be member
Added select dropdown to instances.html
Added instances export to generate_scheduled_activity_instances.py
Database migrate function to add member_of_timeline column to the instances table