Add warnings if due dates can't be shifted when importing assignments - #1394
Open
oscarlevin wants to merge 1 commit into
Open
Add warnings if due dates can't be shifted when importing assignments#1394oscarlevin wants to merge 1 commit into
oscarlevin wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes assignment importing more resilient by allowing imports to proceed even when due-date shifting fails (e.g., because a course timezone is invalid), and surfaces warnings so instructors know to review due dates.
Changes:
- Update due-date shifting to return an optional warning instead of raising when a course timezone cannot be resolved.
- Propagate
duedate_warning/duedate_not_shiftedthrough backend import APIs and into the assignment builder UI. - Add coverage for invalid-course-timezone behavior in the assignment sharing/import tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/components/rsptx/db/test_assignment_sharing.py | Adds test ensuring imports succeed and return a warning when timezone resolution fails. |
| components/rsptx/db/crud/assignment.py | Implements warning-returning due-date shifting and threads warning/count through import flows. |
| bases/rsptx/assignment_server_api/routers/instructor.py | Adds warning/count fields to instructor import API responses. |
| bases/rsptx/assignment_server_api/assignment_builder/src/types/assignmentSharing.ts | Extends TS types to include duedate_warning and duedate_not_shifted. |
| bases/rsptx/assignment_server_api/assignment_builder/src/store/assignment/assignment.logic.api.ts | Displays informational toasts when due dates could not be adjusted. |
| bases/rsptx/assignment_server_api/assignment_builder/src/components/routes/AssignmentBuilder/components/importAssignment/ImportPreviewPanel.tsx | Shows an inline warning alert in the import preview when due date couldn’t be adjusted. |
| bases/rsptx/assignment_server_api/assignment_builder/src/components/routes/AssignmentBuilder/components/importAssignment/ImportAssignmentModal.spec.tsx | Updates preview mock to include duedate_warning. |
| bases/rsptx/admin_server_api/routers/instructor.py | Includes warning/count details in admin “copy assignment(s)” responses/messages. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+71
to
+75
| {preview.duedate_warning ? ( | ||
| <Alert variant="light" color="yellow" title="Due date not adjusted"> | ||
| {preview.duedate_warning} | ||
| </Alert> | ||
| ) : null} |
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.
Courtesy of my assistant, this makes importing assignments more robust: if a due date for an assignment cannot be shifted (for example because the course timezone is not supported), then the assignment is still imported, just not with a shifted due date.