-
Notifications
You must be signed in to change notification settings - Fork 108
[MBL-19421][Parent] Filter out concluded courses in Inbox course picker #3338
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
Conversation
Fixed an issue where soft concluded courses (courses concluded by term dates) were showing up for observers when composing a message in the Parent Inbox. The Canvas API returns enrollment_state: "active" for soft concluded courses, so the app needs to check the course term/end dates on the client side to determine if a course is concluded. Changes: - Added include[]=term to CourseAPI.getCoursesByEnrollmentType() to fetch term information with courses - Added filtering in ParentInboxCoursePickerViewModel to exclude courses where isPastEnrolment() returns true - Added comprehensive test coverage for soft/hard concluded courses Test plan: - Manually tested with test account (inboxobs) that has multiple concluded enrollments - Verified only active courses appear in the course picker - All unit tests pass (6/6) refs: MBL-19421 affects: Parent release note: Fixed issue where concluded courses appeared when composing messages in Parent Inbox 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Code ReviewI've reviewed PR #3338 and have the following feedback: ✅ Strengths1. Well-Designed Solution
2. Comprehensive Test Coverage
3. Clean Code Architecture
🔍 Code Quality ObservationsParentInboxCoursePickerViewModel.kt:69-76 The two-stage filtering approach is clean and readable: val studentContextItems = enrollments
.filter { it.enrollmentState in listOf("active", "invited", "creation_pending") }
.mapNotNull { enrollment -> ... }
.filter { !it.course.isPastEnrolment() }Minor Consideration: The enrollment state strings are hardcoded. While this is consistent with the existing codebase pattern, consider if these should be constants in the Enrollment model for maintainability. However, this is outside the scope of this PR. 🎯 Potential IssuesNone identified. The implementation is solid. ⚡ Performance ConsiderationsPositive:
🔒 Security ConcernsNone. The changes don't introduce security vulnerabilities:
📝 Suggestions
✅ Final AssessmentThis is a high-quality PR that:
Recommendation: Approve pending the minor checklist items (A11y check, product approval) which are noted in the PR description. Great work on the thorough testing and clear problem/solution documentation! 🎉 |
📊 Code Coverage Report✅ Student
✅ Teacher
✅ Pandautils
📈 Overall Average
|
kdeakinstructure
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA 👍
Fixed an issue where soft concluded courses (courses concluded by term dates) were showing up for observers when composing a message in the Parent Inbox.
Problem
The Canvas API returns
enrollment_state: "active"for soft concluded courses, so the existing enrollment state filtering was insufficient. Soft concluded courses are those that have ended based on term/course dates but were not manually concluded.Solution
CourseAPI.getCoursesByEnrollmentType()to includeinclude[]=termparameter to fetch term informationParentInboxCoursePickerViewModelusingCourse.isPastEnrolment()to exclude:Test plan:
refs: MBL-19421
affects: Parent
release note: Fixed issue where concluded courses appeared when composing messages in Parent Inbox
Checklist
🤖 Generated with Claude Code