Skip to content

Added data entry started alert - #4234

Open
Lionqueen94 wants to merge 3 commits into
mainfrom
4164-add-alert-to-electionstatuspage
Open

Lionqueen94 wants to merge 3 commits into
mainfrom
4164-add-alert-to-electionstatuspage

Conversation

@Lionqueen94

@Lionqueen94 Lionqueen94 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #4164

What & why

  • Added data entry started alert shown only to coordinators and only for the first committee session
  • Clicking the close button closes the alert, but when you navigate away from the status page and then come back to the page when no data entries have started, the alert is shown again

How to test

  • Create an election and start the data entry phase. Navigate to the status page as a coordinator and check that the alert shows.
  • Use a typist user to start a data entry and save
  • Refresh the status page as a coordinator (or wait 30 seconds for the automatic refetch) to see the alert disappear

Reviewer notes

  • Do we want to show this alert to administrators as well?
  • Does the alert need to stay closed even after navigating away from the page?

@Lionqueen94 Lionqueen94 self-assigned this Nov 2, 2026
@Lionqueen94 Lionqueen94 linked an issue Nov 2, 2026 that may be closed by this pull request
@Lionqueen94
Lionqueen94 marked this pull request as ready for review November 2, 2026 13:45
@Lionqueen94
Lionqueen94 requested a review from a team as a code owner November 2, 2026 13:45
@Lionqueen94 Lionqueen94 added the frontend Issues or pull requests that relate to the frontend label Nov 2, 2026

@jschuurk-kr jschuurk-kr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alert is not showing for me when it should.

Steps to reproduce:

  1. Generate a test election without input.
  2. Click "Start Invoer".
  3. You end up on the election status page (/elections/15/status) but no alert is shown.
  4. Refresh the page.
  5. The alert is now shown.

@jschuurk-kr

Copy link
Copy Markdown
Contributor

@jorisleker Should we not show this alert for a next session? Because now the coordinator gets the following messages about what to do next:

image image image

@jorisleker

Copy link
Copy Markdown
Contributor

@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).

@jschuurk-kr

Copy link
Copy Markdown
Contributor

Apologies for the confusing phrasing of my "Should we not..."-question.

@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?

Correct, I think we should not show it in a next session.

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).

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.)

@jorisleker

Copy link
Copy Markdown
Contributor

Not sure what you mean here. Do you suggest to hide the alert in a next session / only show in the first?

Correct, I think we should not show it in a next session.

Agreed. There have been enough indications of what needs to happen before you end up on the status page.

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).

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.)

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.

@Lionqueen94

Copy link
Copy Markdown
Contributor Author

The alert is not showing for me when it should.

Steps to reproduce:

1. Generate a test election without input.

2. Click "Start Invoer".

3. You end up on the election status page (`/elections/15/status`) but no alert is shown.

4. Refresh the page.

5. The alert is now shown.

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.

@jschuurk-kr

Copy link
Copy Markdown
Contributor

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.

Comment on lines +147 to +150
<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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushing the alert as a message makes it disappear when you reload the page, which is not what we want

@jschuurk-kr jschuurk-kr Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: the name of this test no longer matches what it covers.

@jschuurk-kr

Copy link
Copy Markdown
Contributor

Do we want to show this alert to administrators as well?

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.

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Issues or pull requests that relate to the frontend needs-backport/1.2 Needs backporting to the 1.2 release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add alert to ElectionStatusPage

3 participants