Improve Request#Show page for instructors with review information - #455
Open
cycomachead wants to merge 3 commits into
Open
Improve Request#Show page for instructors with review information#455cycomachead wants to merge 3 commits into
cycomachead wants to merge 3 commits into
Conversation
Contributor
Author
|
This is good. Will merge after we add student notes and display those. |
20 tasks
Contributor
Author
|
@copilot resolve the merge conflicts in this pull request |
Contributor
Resolved in 5262d4e. The merge brought in all changes from
|
Adds a RequestReviewPresenter and a view partial that surface the context an instructor needs when reviewing an extension request before deciding: - student email and an "extended requests allowed" badge - submission time with a before/after original-deadline badge - a direct link to the assignment in the LMS - the late due date that would be applied on approval - the student's extension history in the course (status counts + table) - who processed the request, and (for approved requests) confirmation the extension was actually provisioned in the LMS (external_extension_id) The presenter is built in RequestsController#show only for course staff, and also supplies @student_enrollment (reused for the Staff Notes section), avoiding a duplicate enrollment lookup. Synced onto main: the earlier staff_user?/role-check migration and the spec-factory canvas_uid fix from this branch are now upstream (main added Course#staff_user? and renamed UserToCourse -> Enrollment), so this commit carries only the review-context feature, adapted to those APIs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Introduce RequestReviewPresenter to aggregate student enrollment and history - Add student extension history partial with email, badges, and LMS links - Integrate review context into RequestsController#show within staff guards - Add disabled placeholder for LMS provisioning status to avoid inconsistency - Update specs for new enrollment schema and presenter logic Co-authored-by: Claude Code <noreply@anthropic.com>
superconductor-for-github
Bot
force-pushed
the
cycomachead/151-improve-request-show-instructor/1
branch
from
August 6, 2026 01:58
5262d4e to
cd7f24e
Compare
…tor/1 * main: Tidy the footer a bit Reorganize the sync buttons on the assignments page Update cron job times to 4:00PM feat: add hourly email notifications and enable GoodJob cron
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.
Improve Request#Show Page for Instructors with Review Information
Surfaces the context an instructor needs to make an informed approval/denial decision on an extension request, and cleans up the underlying role-checking pattern across the app.
Changes
New instructor review context on
Request#Show:RequestReviewPresenter(app/presenters/request_review_presenter.rb) — encapsulates all the review-context data computation (student history, status counts, enrollment, projected dates) so the controller stays thin and the view reads from a single@reviewobject._student_extension_historypartial — the history table extracted into its own partial for clarity.staff_user?helper — replaces every@role == 'instructor'permission check across controllers and views with a semantic, memoized predicate that delegates toCourse#course_staff?. Available in both controllers and views viahelper_method.Security fix in
AssignmentsController#toggle_enabled— previously trusted a client-suppliedroleparam to determine authorization. Now uses the server-sidestaff_user?check exclusively.Testing
spec/presenters/request_review_presenter_spec.rb(8 examples) covering all presenter methods including edge cases (no enrollment, submitted after deadline, status counts excluding current request).showaction asserting template rendering and correct@reviewpresenter assignment.AssignmentsControllerignores a client-suppliedrole: 'instructor'param.#staff_user?specs covering staff-true, student-false, nil guards, and memoization correctness.usersfactory generated bare numericcanvas_uidsequences ("1","2", …) that would eventually collide with hardcoded UIDs in specs. Prefixed the sequence ("canvas-uid-#{n}") to prevent collisions across full suite runs.course_settings_controller_specenrollments that used a fictitiousrole: 'instructor'(not a real DB role); switched torole: 'teacher'.Full suite: 446 examples, 0 failures.
Documentation
No additional documentation required.
Checklist
Superconductor Ticket Implementation | App Preview | Guided Review