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

Some improvements to Tables and OverviewPage #990

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
da36f84
Add missing footer to Election Report Page
Lionqueen94 Feb 7, 2025
79a57cb
Make sure table linkrow has separate column for the chevron with a se…
Lionqueen94 Feb 7, 2025
a6990f0
Show a message that no elections exist on overview page instead of a …
Lionqueen94 Feb 7, 2025
41ece77
Forgot UserListPage LinkRow change
Lionqueen94 Feb 7, 2025
f58f162
Corrected error logo color in Alert, ProgressList and StatusList and …
Lionqueen94 Feb 7, 2025
2c2435b
Merge branch 'main' into some_small_fixes
Lionqueen94 Feb 7, 2025
2d26841
Make sure there is no empty table when there are no polling stations …
Lionqueen94 Feb 8, 2025
ffba221
Adjusted no elections text, to be expanded in other epic
Lionqueen94 Feb 8, 2025
ce7cbca
Fix test
Lionqueen94 Feb 9, 2025
baf5ca6
Merge branch 'main' into some_small_fixes
Lionqueen94 Feb 10, 2025
9f9e9ea
Rename Table.Column to Table.HeaderCell and undid empty cell for chev…
Lionqueen94 Feb 10, 2025
558485a
Added Footer to OverviewLayout and removed from all child routes and …
Lionqueen94 Feb 10, 2025
5fe59c8
Merge branch 'main' into some_small_fixes
Lionqueen94 Feb 10, 2025
9d96510
Merge branch 'main' into some_small_fixes
Lionqueen94 Feb 11, 2025
e72177b
Added separate alert when all polling stations data entries have been…
Lionqueen94 Feb 11, 2025
eecd93d
Merge branch 'main' into some_small_fixes
Lionqueen94 Feb 12, 2025
a06a9ac
Re-added the Footer back to the pages instead of in the Layout, we sh…
Lionqueen94 Feb 12, 2025
20d7838
Moved footer to OverviewPage instead of OverviewLayout to be more con…
Lionqueen94 Feb 12, 2025
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
2 changes: 0 additions & 2 deletions frontend/app/module/data_entry/page/DataEntryHomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useEffect } from "react";
import { useLocation, useNavigate } from "react-router";

import { ElectionProgress } from "app/component/election/ElectionProgress";
import { Footer } from "app/component/footer/Footer";
import { PollingStationChoiceForm } from "app/component/form/data_entry/polling_station_choice/PollingStationChoiceForm";

import { DEFAULT_CANCEL_REASON, useElection, useElectionStatus } from "@kiesraad/api";
Expand Down Expand Up @@ -73,7 +72,6 @@ export function DataEntryHomePage() {
</article>
<ElectionProgress />
</main>
<Footer />
</>
);
}
3 changes: 3 additions & 0 deletions frontend/app/module/election/OverviewLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Outlet } from "react-router";

import { Footer } from "app/component/footer/Footer";
Lionqueen94 marked this conversation as resolved.
Show resolved Hide resolved

import { ElectionListProvider } from "@kiesraad/api";
import { AppLayout } from "@kiesraad/ui";

Expand All @@ -8,6 +10,7 @@ export function OverviewLayout() {
<ElectionListProvider>
<AppLayout>
<Outlet />
<Footer />
</AppLayout>
</ElectionListProvider>
);
Expand Down
3 changes: 0 additions & 3 deletions frontend/app/module/election/page/ElectionHomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Link } from "react-router";

import { Footer } from "app/component/footer/Footer";

import { useElection } from "@kiesraad/api";
import { t } from "@kiesraad/i18n";
import { PageTitle } from "@kiesraad/ui";
Expand Down Expand Up @@ -42,7 +40,6 @@ export function ElectionHomePage() {
</ul>
</article>
</main>
<Footer />
</>
);
}
3 changes: 0 additions & 3 deletions frontend/app/module/election/page/ElectionReportPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Footer } from "app/component/footer/Footer";

import { useElection, useElectionStatus } from "@kiesraad/api";
import { t, tx } from "@kiesraad/i18n";
import { Button, FormLayout, PageTitle } from "@kiesraad/ui";
Expand Down Expand Up @@ -84,7 +82,6 @@ export function ElectionReportPage() {
</FormLayout.Controls>
</article>
</main>
<Footer />
</>
);
}
2 changes: 0 additions & 2 deletions frontend/app/module/election/page/ElectionStatusPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useNavigate } from "react-router";

import { HeaderElectionStatusWithIcon } from "app/component/election/ElectionStatusWithIcon";
import { ElectionStatus } from "app/component/election/status/ElectionStatus";
import { Footer } from "app/component/footer/Footer";

import { useElection, useElectionStatus } from "@kiesraad/api";
import { t } from "@kiesraad/i18n";
Expand Down Expand Up @@ -49,7 +48,6 @@ export function ElectionStatusPage() {
navigate={(path) => void navigate(path)}
/>
</main>
<Footer />
</>
);
}
7 changes: 6 additions & 1 deletion frontend/app/module/election/page/OverviewPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ describe("OverviewPage", () => {
</ElectionListProvider>,
);

expect(await screen.findByText(/Nog geen verkiezingen ingesteld/)).toBeVisible();
expect(await screen.findByText(/Abacus is nog niet klaar voor gebruik/)).toBeVisible();
expect(
await screen.findByText(
/Je kan als invoerder nog niks doen. Wacht tot de coördinator het systeem openstelt voor het invoeren van telresultaten./,
),
).toBeVisible();
expect(screen.queryByRole("table")).toBeNull();
});
});
22 changes: 14 additions & 8 deletions frontend/app/module/election/page/OverviewPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { To, useLocation, useNavigate } from "react-router";

import { ElectionStatusWithIcon } from "app/component/election/ElectionStatusWithIcon";
import { Footer } from "app/component/footer/Footer";
import { NavBar } from "app/component/navbar/NavBar";

import { Election, useElectionList } from "@kiesraad/api";
Expand Down Expand Up @@ -49,10 +48,18 @@ export function OverviewPage() {
</Alert>
)}
<main>
{!electionList.length ? (
<h2>{t("election.no_elections_added")}</h2>
) : (
<article>
<article>
{!electionList.length ? (
!isAdminOrCoordinator ? (
<>
<h2 className="mb-lg">{t("election.not_ready_for_use")}</h2>
<p className="md form-paragraph">{t("election.please_wait_for_coordinator")}</p>
</>
) : (
<h2>{t("election.no_elections_added")}</h2>
// TODO: To be expanded in issue #888
)
) : (
<Table id="overview">
<Table.Header>
<Table.HeaderCell>{t("election.title.singular")}</Table.HeaderCell>
Expand All @@ -76,10 +83,9 @@ export function OverviewPage() {
))}
</Table.Body>
</Table>
</article>
)}
)}
</article>
</main>
<Footer />
</>
);
}
14 changes: 0 additions & 14 deletions frontend/app/module/polling_stations/PollingStationsLayout.tsx

This file was deleted.

1 change: 0 additions & 1 deletion frontend/app/module/polling_stations/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from "./PollingStationsLayout";
export * from "./page";
4 changes: 2 additions & 2 deletions frontend/app/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "app/module/election";
import { LogsHomePage } from "app/module/logs";
import { NotAvailableInMock } from "app/module/NotAvailableInMock";
import { PollingStationListPage, PollingStationsLayout } from "app/module/polling_stations";
import { PollingStationListPage } from "app/module/polling_stations";
import { UserListPage } from "app/module/users";
import { WorkstationsHomePage } from "app/module/workstations";

Expand Down Expand Up @@ -60,7 +60,7 @@ export const routes = createRoutesFromElements(
}
/>
<Route path="status" element={<ElectionStatusPage />} />
<Route path="polling-stations" element={<PollingStationsLayout />}>
<Route path="polling-stations" element={null}>
<Route index element={<PollingStationListPage />} />
<Route path="create" element={<PollingStationCreatePage />} />
<Route path=":pollingStationId/update" element={<PollingStationUpdatePage />} />
Expand Down
2 changes: 2 additions & 0 deletions frontend/lib/i18n/locales/nl/election.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"level_polling_station": "Niveau stembureau",
"location": "Gebied",
"no_elections_added": "Nog geen verkiezingen ingesteld",
"not_ready_for_use": "Abacus is nog niet klaar voor gebruik",
"please_wait_for_coordinator": "Je kan als invoerder nog niks doen. Wacht tot de coördinator het systeem openstelt voor het invoeren van telresultaten.",
"status": "Status",
"start_when_count_list_received": "Zodra je een tellijst van een stembureau hebt gekregen kan je beginnen met invoeren."
}