Repository navigation
Added data entry started alert - #4234
Lionqueen94 wants to merge 3 commits into
Conversation
jschuurk-kr
left a comment
There was a problem hiding this comment.
The alert is not showing for me when it should.
Steps to reproduce:
- Generate a test election without input.
- Click "Start Invoer".
- You end up on the election status page (
/elections/15/status) but no alert is shown. - Refresh the page.
- The alert is now shown.
|
@jorisleker Should we not show this alert for a next session? Because now the coordinator gets the following messages about what to do next:
|
Not sure what you mean here. Do you suggest to hide the alert in a next session / only show in the first? Or is it not shown and do you suggest that we should? (inferring the latter from your previous comment about the alert not showing up). |
|
Apologies for the confusing phrasing of my "Should we not..."-question.
Correct, I think we should not show it in a next session.
Also correct! In a first session it's only shown after a manual refresh of the status page. (In a next session you have to navigate to the status page after starting data entry, so there it does show up as soon as you land on the status page.) |
Agreed. There have been enough indications of what needs to happen before you end up on the status page.
Then we are on the same page :-) Must be shown on status page for first session, should not be shown on status page for next session. |
Fixed in the last commit. The useState was set before the refetch, so it didn't realise the status had changed to data_entry. This has been changed now. Also only showing the alert for the first committee session. |
|
Tested the changes. Alert is displayed when coordinator starts data entry. Alert disappears once typist claims data entry and status is refetched. Alert re-appears when typist deletes their data entry, so they're all in "Werkvoorraad". Closing the alert and reloading the page results in the alert re-appearing. Don't think that's a big issue, but would this not happen if we pushed the alert as a message? (Or I misunderstand our message pushing implemenation.) (add comment on the relevant code as well) Alert does not show for GSB next session. Alert does show for first session GSB and for CSB. |
| <Alert type="notify" onClose={hideDataEntryStartedAlert}> | ||
| <strong className="heading-md">{t("election_status.data_entry_started")}</strong> | ||
| <p>{t("election_status.data_entry_started_explanation")}</p> | ||
| </Alert> |
There was a problem hiding this comment.
Closing the alert and reloading the page results in the alert re-appearing. Don't think that's a big issue, but would this not happen if we pushed the alert as a message? (Or I misunderstand our message pushing implemenation.)
There was a problem hiding this comment.
Pushing the alert as a message makes it disappear when you reload the page, which is not what we want
There was a problem hiding this comment.
I'm not sure, because the issue says "Show it only directly after the state of the session is set to DataEntry." @jorisleker What do you think? Does the "directly" mean we show it only once, i.e. until the coordinator refreshes the page or closes the alert or pauses data entry or until a typist claims a data entry?
| vi.useRealTimers(); | ||
| }); | ||
|
|
||
| test("Finish input alert not visible when data entry has completed for administrator", async () => { |
There was a problem hiding this comment.
Nitpick: the name of this test no longer matches what it covers.
| expect(screen.queryByRole("button", { name: "Invoer hervatten" })).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| test("Finish input alert visible when data entry has completed and data entry is paused for coordinator", async () => { |
There was a problem hiding this comment.
Nitpick: the name of this test no longer matches what it covers.
| expect(screen.queryByRole("button", { name: "Invoer hervatten" })).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| test("Finish input alert visible when data entry has completed for coordinator", async () => { |
There was a problem hiding this comment.
Nitpick: the name of this test no longer matches what it covers.
The purpose of the alert is to inform the coordinator what to do after they started data entry. I think it's unlikely an admin goes to the status page at that moment. And even when they do, telling them what to tell the coordinator what should happen next, seems odd to me. |



Closes #4164
What & why
How to test
Reviewer notes