-
Notifications
You must be signed in to change notification settings - Fork 5
Combine Set Assignments & Schedule into Manage Assigned Work #2198
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
Open
jacbn
wants to merge
26
commits into
main
Choose a base branch
from
feature/manage-assignments
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,100
−129
Open
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
2015c0a
Copy assignment schedule as base for manage assignments
jacbn f537929
Migrate to sidebar layout
jacbn a93be00
Migrate from AssignmentListEntry to GameboardCard-based entries
jacbn 81745fb
Add stylised group progress link to assignment cards
jacbn c081e86
Curve lower corner of management card info
jacbn c49ada9
Add preview button to assignment card
jacbn ff7ae33
Remove unused schedule pieces from Manage Assignments
jacbn e4826b6
Include revamped Set Assignment flow at top of page
jacbn 1572a93
Move "set new" modal text to content
jacbn 8e8b9f5
Push rest of manage assignments behind a feature flag
jacbn a92b1ad
Include tests in assigned work; rename page
jacbn 2517a80
Implement TestCards for test management functionality
jacbn 7f23edb
Extract Set/Manage Tests logic into hook for reuse in Manage Assigned
jacbn 8895d29
Add work type filter
jacbn 689d8eb
Show "due date passed" indicator; fix display if passed
jacbn 4f99f40
Merge branch 'main' into feature/manage-assignments
jacbn 32101d8
Combine work set to same group into group list
jacbn badaf34
Include additional title and subject filters
jacbn c7e2ccc
Improve dark mode styling
jacbn c21699a
Add open-in-new icon to manage work cards
jacbn 66d5388
Merge branch 'main' into feature/manage-assignments
jacbn 833344c
Fix RoutesPhy after merge
jacbn d8a0bab
Merge branch main
barna-isaac 92e195c
fix eslint
barna-isaac 1a2fa67
re-introduce missing import
barna-isaac 018e3e2
Merge branch 'main' into feature/manage-assignments
barna-isaac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| import React from "react"; | ||
| import { Row, Col } from "reactstrap"; | ||
| import { AssignmentDTO, QuizAssignmentDTO } from "../../../IsaacApiTypes"; | ||
| import { isDefined, isOverdue, useManageQuizAssignments } from "../../services"; | ||
| import { useManageAssignment } from "../../services/setAssignment"; | ||
| import { GameboardCard, GameboardLinkLocation } from "./cards/GameboardCard"; | ||
| import { getFriendlyDaysUntil } from "./DateString"; | ||
| import { TestCard } from "./cards/TestCard"; | ||
|
|
||
| // this is similar to MyAssignmentsContents/AssignmentCard, but: | ||
| // - GameboardCard.usageDisplay is undefined, so no completion / group statistics are shown in the top right. | ||
| // - inside the card's children, does not highlight past deadlines. | ||
| // - GameboardCard.allowManaging is set | ||
| export const ManageAssignmentCard = ({assignment}: {assignment: AssignmentDTO}) => { | ||
| const assignmentStartDate = assignment.scheduledStartDate ?? assignment.creationDate; | ||
|
|
||
| const { openAssignModal, unassign } = useManageAssignment(assignment); | ||
|
|
||
| return <GameboardCard | ||
| className="mt-2" | ||
| gameboard={assignment.gameboard} | ||
| linkLocation={GameboardLinkLocation.Title} | ||
| assignment={assignment} | ||
| openAssignModal={openAssignModal} | ||
| usageDisplay={{type: "progressLink", assignment}} | ||
| unassign={unassign} | ||
| allowManaging | ||
| > | ||
| <Row className="w-100"> | ||
| <Col> | ||
| {isDefined(assignment.groupName) && | ||
| <p className="mb-0">Set to <strong>{assignment.groupName}</strong></p> | ||
| } | ||
| {isDefined(assignmentStartDate) && | ||
| <p className="mb-0" data-testid={"gameboard-assigned"}> | ||
| Assigned <strong>{getFriendlyDaysUntil(assignmentStartDate)}</strong> | ||
| </p> | ||
| } | ||
| {isDefined(assignment.dueDate) && isDefined(assignment.gameboard) && <p className="mb-0"> | ||
| Due <strong>{getFriendlyDaysUntil(assignment.dueDate)}</strong> | ||
| {isOverdue(assignment) && <span className="overdue ms-1">(passed)</span>} | ||
| </p>} | ||
| </Col> | ||
| </Row> | ||
|
|
||
| {assignment.notes && <p className="mb-0"><strong>Notes:</strong> {assignment.notes}</p>} | ||
| </GameboardCard>; | ||
| }; | ||
|
|
||
| export const ManageTestCard = ({quizAssignment}: {quizAssignment: QuizAssignmentDTO}) => { | ||
|
|
||
| const { cancel, openExtendDueDateModal, openAssignModal } = useManageQuizAssignments(); | ||
|
|
||
| return <TestCard | ||
| className="mt-2" | ||
| quizAssignment={quizAssignment} | ||
| linkLocation={!isOverdue(quizAssignment) ? GameboardLinkLocation.Title : undefined} | ||
| usageDisplay={{type: "progressLink"}} | ||
| openAssignModal={() => openAssignModal(quizAssignment)} | ||
| cancel={() => cancel(quizAssignment)} | ||
| extendDueDate={() => openExtendDueDateModal(quizAssignment)} | ||
| allowManaging | ||
| > | ||
| <Row className="w-100"> | ||
| <Col> | ||
| {/* // TODO groupName is not defined anywhere in the quiz summary – can we add this in the API? */} | ||
| {/* {isDefined(quizAssignment.quizSummary?.groupName) && | ||
| <p className="mb-0">Set to <strong>{quizAssignment.quizSummary?.groupName}</strong></p> | ||
| } */} | ||
| {isDefined(quizAssignment?.scheduledStartDate) || isDefined(quizAssignment?.creationDate) && | ||
| <p className="mb-0" data-testid={"gameboard-assigned"}> | ||
| Assigned <strong>{getFriendlyDaysUntil(quizAssignment.scheduledStartDate || quizAssignment.creationDate)}</strong> | ||
| </p> | ||
| } | ||
| {isDefined(quizAssignment?.dueDate) && <p className="mb-0"> | ||
| Due <strong>{getFriendlyDaysUntil(quizAssignment.dueDate)}</strong> | ||
| {isOverdue(quizAssignment) && <span className="overdue ms-1">(passed)</span>} | ||
| </p>} | ||
| </Col> | ||
| </Row> | ||
| </TestCard>; | ||
| }; |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.