Skip to content

Add warnings if due dates can't be shifted when importing assignments - #1394

Open
oscarlevin wants to merge 1 commit into
RunestoneInteractive:mainfrom
oscarlevin:import-tz
Open

Add warnings if due dates can't be shifted when importing assignments#1394
oscarlevin wants to merge 1 commit into
RunestoneInteractive:mainfrom
oscarlevin:import-tz

Conversation

@oscarlevin

Copy link
Copy Markdown
Collaborator

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.

@oscarlevin
oscarlevin requested a review from bnmnetp as a code owner August 18, 2026 20:20
Copilot AI lite review requested due to automatic review settings August 18, 2026 20:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_shifted through 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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants