-
Notifications
You must be signed in to change notification settings - Fork 7
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
Save voter session on ballot spoil #4465
Conversation
render BallotInvalidatedPage outside ballot context because ballot context is no longer needed
Previously only a cardless voter session could render LoadPaperPage. We now also want to render it when poll worker auth is active, as will be the case when a poll worker has removed a ballot to spoil and needs to load a new sheet
Updates to tests in this PR require finer control of the mock state machine, so we don't want to always set the state machine state when setting expectations
bf7d9e0
to
9adeae4
Compare
@@ -90,7 +90,7 @@ type PaperHandlerStatusEvent = | |||
| { type: 'VOTER_INITIATED_PRINT'; pdfData: Buffer } | |||
| { type: 'PAPER_IN_OUTPUT' } | |||
| { type: 'PAPER_IN_INPUT' } | |||
| { type: 'VOTER_CONFIRMED_INVALIDATED_BALLOT' } | |||
| { type: 'POLLWORKER_CONFIRMED_INVALIDATED_BALLOT' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a misnomer; the voter is not actually the one who confirms the ballot is has been invalidated
on: { | ||
POLLWORKER_CONFIRMED_INVALIDATED_BALLOT: 'done', | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copy changes based on whether paper is present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paper_nowhere is a little confusing. Maybe no_paper or paper_absent?
@@ -33,7 +33,7 @@ beforeEach(() => { | |||
apiMock = createApiMock(); | |||
kiosk = fakeKiosk(); | |||
window.kiosk = kiosk; | |||
apiMock.setPaperHandlerState('waiting_for_ballot_data'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These e2e tests "incorrectly" mocked paper handler state; the old mocking seen here was simpler but a less accurate representation of states at various points of the e2e test. It wasn't an issue before now because of the order we rendered LoadPaperPage
in (ie. it used to be lower priority)
paperPresent={ | ||
stateMachineState === | ||
'waiting_for_invalidated_ballot_confirmation.paper_present' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seemed clearer to pass this prop down rather than query for state in the lower components, but open to feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems fine to me!
ballotContextProviderChild = ( | ||
<BallotInvalidatedPage authStatus={authStatus} /> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are no longer restarting the voting session, we don't need access to BallotContext
onSuccess() { | ||
setSelectedCardlessVoterPrecinctId(precinct.id); | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was redundant with another call to setAcceptingPaperStateMutation.mutate
that happens after ballot style selection
const history = useHistory(); | ||
useEffect(() => { | ||
history.push('/ready-to-review'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed before, not ideal to use react-router routing here. Should be simplified in #3985
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clear PR!
on: { | ||
POLLWORKER_CONFIRMED_INVALIDATED_BALLOT: 'done', | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paper_nowhere is a little confusing. Maybe no_paper or paper_absent?
paperPresent={ | ||
stateMachineState === | ||
'waiting_for_invalidated_ballot_confirmation.paper_present' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems fine to me!
return ( | ||
<AskPollWorkerPage | ||
authStatus={authStatus} | ||
pollWorkerPage={<RemoveInvalidatedBallotPage />} | ||
pollWorkerPage={ | ||
<RemoveInvalidatedBallotPage paperPresent={paperPresent} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed in the video that the "Ask a Poll Worker for Help" text wraps awkwardly to two lines. I think we should look into moving the left-aligned text. Also, the "Voting Session in Progress" screen could use some more horizontal padding - it's butting right up against the sides. But these are minor issues that can be addressed in a future UI polish pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "Ask a Poll Worker for Help" screen uses the CenteredPageLayout
component, which is used by a lot of the app. Agree we should do a design pass on that component and make sure we update all callers at once for consistency.
"Voting Session in Progress" padding was a one-off fix though:
Before
After
It has the same wrapping awkwardness with padding, but at least it's consistent so IMO it's the lesser of two evils. We can fix this and other screens in https://github.com/orgs/votingworks/projects/23/views/75?pane=issue&itemId=49471078
Overview
#3909
Improves the flow for spoiling a ballot in post-print ballot validation
Demo Video or Screenshot
Happy path
IMG_4641.mov
Lightly stress testing pulling paper early and repeated auth changes
IMG_4642.mov
Testing Plan
Checklist