Skip to content

Update election status page for CSB#2945

Open
lama-d3v wants to merge 3 commits intomainfrom
2933-update-election-status-page-for-csb
Open

Update election status page for CSB#2945
lama-d3v wants to merge 3 commits intomainfrom
2933-update-election-status-page-for-csb

Conversation

@lama-d3v
Copy link
Contributor

Fixes #2933

@lama-d3v lama-d3v self-assigned this Feb 25, 2026
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

Sigrid maintainability feedback

✅ You wrote maintainable code and achieved your objective of 3.5 stars.

Show details

Sigrid compared your code against the baseline of 2026-02-26.

👍 What went well?

You fixed or improved 1 refactoring candidates.

Risk System property Location
🟠 Unit Size
(Fixed)
frontend/src/features/data_entry/components/DataEntrySection.tsx
DataEntrySection.tsx.DataEntrySection()

👎 What could be better?

Unfortunately, 6 refactoring candidates were introduced or got worse.

Risk System property Location
🟠 Unit Size
(Worsened)
frontend/src/features/election_management/components/ElectionInformationTable.tsx
ElectionInformationTable.tsx.ElectionInformationTable(ElectionInformationTableProps)
🟠 Unit Size
(Introduced)
frontend/src/features/data_entry/components/DataEntrySection.tsx
DataEntrySection.tsx.DataEntrySection(DataEntryProps)
🟡 Unit Size
(Worsened)
frontend/src/components/navbar/NavBarLinks.tsx
NavBarLinks.tsx.ElectionManagementLinks(NavBarLinksProps)
🟡 Unit Complexity
(Worsened)
frontend/src/features/election_management/components/ElectionInformationTable.tsx
ElectionInformationTable.tsx.ElectionInformationTable(ElectionInformationTableProps)
🟡 Unit Interfacing
(Introduced)
frontend/src/components/committee_session/CommitteeSessionStatus.tsx
CommitteeSessionStatus.tsx.CommitteeSessionStatusLabel(ElectionRole,CommitteeSessionStatus,any)
🟡 Unit Interfacing
(Introduced)
frontend/src/utils/committeeSession.ts
committeeSession.ts.committeeSessionLabel(ElectionRole,number,any)

📚 Remaining technical debt

14 refactoring candidates didn't get better or worse, but are still present in the code you touched.

View this system in Sigrid to explore your technical debt

⭐️ Sigrid ratings

System property System on 2026-02-26 Before changes New/changed code
Volume 3.4 N/A N/A
Duplication 3.7 5.5 5.5
Unit Size 2.2 2.1 2.1
Unit Complexity 3.3 1.7 1.7
Unit Interfacing 2.9 5.5 5.1
Module Coupling 3.2 5.5 5.5
Component Independence 5.5 N/A N/A
Component Entanglement N/A N/A N/A
Maintainability 3.5 3.8 3.8

💬 Did you find this feedback helpful?

We would like to know your thoughts to make Sigrid better.
Your username will remain confidential throughout the process.


View this system in Sigrid

const [errorAlert, setErrorAlert] = useState<string | null>(null);
const redirectToReportPage = location.hash === "#redirect-to-report";
const sessionLabel = committeeSessionLabel(currentCommitteeSession.number, true).toLowerCase();
const sessionLabel = committeeSessionLabel(election.role, currentCommitteeSession.number, true).toLowerCase();
Copy link
Contributor

Choose a reason for hiding this comment

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

This results in a lower-case "CSB": "Details van zitting csb".

@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.88%. Comparing base (59630ab) to head (bb6a3ed).

Files with missing lines Patch % Lines
...lection_management/components/ElectionHomePage.tsx 44.44% 5 Missing ⚠️
...c/features/data_entry/components/DataEntryPage.tsx 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2945      +/-   ##
==========================================
- Coverage   91.89%   91.88%   -0.01%     
==========================================
  Files         393      393              
  Lines       19040    19050      +10     
  Branches     2094     2102       +8     
==========================================
+ Hits        17497    17505       +8     
- Misses       1440     1442       +2     
  Partials      103      103              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link

PDF Diff Summary

Comparing against base branch: main

File Status
model-n-10-2.pdf ✅ No changes
model-na-14-2-bijlage1.pdf ✅ No changes
model-na-14-2.pdf ✅ No changes
model-na-31-2-bijlage1.pdf ✅ No changes
model-na-31-2-inlegvel.pdf ✅ No changes
model-na-31-2.pdf ✅ No changes
model-p-2a.pdf ✅ No changes

render(<CommitteeSessionStatusWithIcon status={state} userRole={role} />);
expect(screen.getByText(label)).toBeVisible();
expect(screen.getByRole("img", { hidden: true })).toHaveAttribute("data-icon", icon);
electionRoleValues.forEach((electionRole) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This re-renders within the same DOM, i.e. the additional render is appended to the document body without clearing the previous render.

Use parameterised tests with test.each/test.for instead.

Comment on lines +78 to +96
{election.role === "GSB" && (
<Table.Row key={election.id} to="polling-stations">
<Table.HeaderCell scope="row" className="normal">
{t("polling_station.title.plural")}
</Table.HeaderCell>
<Table.Cell className="underlined">
{numberOfPollingStations}{" "}
{t(`polling_station.title.${numberOfPollingStations === 1 ? "singular" : "plural"}`).toLowerCase()}
</Table.Cell>
</Table.Row>
)}
{election.role === "GSB" && (
<Table.Row>
<Table.HeaderCell scope="row" className="normal">
{t("counting_method_type")}
</Table.HeaderCell>
<Table.Cell>{t(election.counting_method)}</Table.Cell>
</Table.Row>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

These can be merged into a single {election.role === "GSB" && (...)} block

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frontend: Update election status page for CSB

4 participants