Skip to content
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

92 client UI for irv audit ballots review #224

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions client/screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,17 @@ th.rla-county-contest-info {
grid-template-columns: 2fr 1fr;
}

.contest-choice-review-grid-irv {
display: grid;
grid-column-gap: 1rem;
grid-template-columns: 5fr 1fr;
}

.contest-choice-review-grid-irv > .contest-choice-selection {
/* Disable hover and cursor changes for review page */
pointer-events: none;
}

.contest-choice-review {
display: grid;
grid-column-gap: 1rem;
Expand Down
23 changes: 21 additions & 2 deletions client/src/component/County/Audit/Wizard/ReviewStage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as _ from 'lodash';

import { Button, Icon, Intent } from '@blueprintjs/core';

import IrvChoiceForm from 'corla/component/County/Audit/Wizard/IrvChoiceForm';
import SubmittingACVR from './SubmittingACVR';

interface EditButtonProps {
Expand Down Expand Up @@ -75,7 +76,7 @@ interface BallotContestReviewProps {
const BallotContestReview = (props: BallotContestReviewProps) => {
const { back, contest, marks } = props;
const { comments, noConsensus } = marks;
const { votesAllowed } = contest;
const { votesAllowed, description } = contest;

const markedChoices: County.ACVRChoices = _.pickBy(marks.choices);
const votesMarked = _.size(markedChoices);
Expand Down Expand Up @@ -121,6 +122,24 @@ const BallotContestReview = (props: BallotContestReviewProps) => {
);
}

if (description === 'IRV') {
// convert props to ChoicesProps for IRV Display
const irvChoicesProps: ChoicesProps = {
choices: contest.choices,
description,
marks,
noConsensus,
// null OnClick for review stage since clicking should not change markings
updateBallotMarks: () => null,
};

return (
<div className='contest-choice-selection'>
{ IrvChoiceForm(irvChoicesProps) }
</div>
);
}

return (
<div className='contest-choice-selection contest-choice-review'>
{ markedChoiceDivs.length ? markedChoiceDivs : noMarksDiv }
Expand All @@ -134,7 +153,7 @@ const BallotContestReview = (props: BallotContestReviewProps) => {
<strong><div className='contest-name'>{ contest.name }</div></strong>
<strong><div>{ contest.description }</div></strong>
</div>
<div className='contest-choice-review-grid'>
<div className={'contest-choice-review-grid' + (description === 'IRV' ? '-irv' : '')}>
{ noConsensus ? noConsensusDiv : renderMarkedChoices() }
<div className='edit-button'>
<EditButton back={ back } />
Expand Down