Skip to content

Commit

Permalink
Add tooltip for assessments that are not fully attempted (#3028)
Browse files Browse the repository at this point in the history
* Add tooltip for assessments that are not fully attempted

* Update test snaphots

---------

Co-authored-by: Richard Dominick <[email protected]>
  • Loading branch information
josh1248 and RichDom2185 authored Sep 1, 2024
1 parent 19bb06d commit b203ae8
Show file tree
Hide file tree
Showing 2 changed files with 265 additions and 197 deletions.
28 changes: 17 additions & 11 deletions src/commons/assessment/Assessment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,24 @@ const Assessment: React.FC = () => {
const sortAssessments = (assessments: AssessmentOverview[]) => sortBy(assessments, [a => -a.id]);

const makeSubmissionButton = (overview: AssessmentOverview, index: number) => (
<Button
disabled={overview.status !== AssessmentStatuses.attempted}
icon={IconNames.CONFIRM}
intent={overview.status === AssessmentStatuses.attempted ? Intent.DANGER : Intent.NONE}
minimal={true}
// intentional: each listing renders its own version of onClick
// tslint:disable-next-line:jsx-no-lambda
onClick={() => setBetchaAssessment(overview)}
<Tooltip
disabled={overview.status === AssessmentStatuses.attempted}
content={'You can finalize after saving an answer for each question!'}
position={Position.RIGHT}
>
<span>Finalize</span>
<span className="custom-hidden-xxs"> Submission</span>
</Button>
<Button
disabled={overview.status !== AssessmentStatuses.attempted}
icon={IconNames.CONFIRM}
intent={overview.status === AssessmentStatuses.attempted ? Intent.DANGER : Intent.NONE}
minimal={true}
// intentional: each listing renders its own version of onClick
// tslint:disable-next-line:jsx-no-lambda
onClick={() => setBetchaAssessment(overview)}
>
<span>Finalize</span>
<span className="custom-hidden-xxs"> Submission</span>
</Button>
</Tooltip>
);

const makeAssessmentInteractButton = (overview: AssessmentOverview) => {
Expand Down
Loading

0 comments on commit b203ae8

Please sign in to comment.