From ff0d660ca86593b7e8e8d9f51e5dd782afbb381c Mon Sep 17 00:00:00 2001 From: Sven van de Scheur Date: Tue, 14 May 2024 11:36:39 +0200 Subject: [PATCH] :construction: Start workin on destruction list create page --- frontend/src/index.tsx | 14 +- .../destructionlist/DestructionListCreate.css | 3 + .../DestructionListCreate.stories.tsx | 571 ++++++++++++++++++ .../destructionlist/DestructionListCreate.tsx | 93 +++ frontend/src/pages/destructionlist/index.ts | 1 + frontend/src/pages/index.ts | 1 + .../src/pages/landing/Landing.stories.tsx | 23 - frontend/src/pages/landing/Landing.tsx | 25 +- 8 files changed, 685 insertions(+), 46 deletions(-) create mode 100644 frontend/src/pages/destructionlist/DestructionListCreate.css create mode 100644 frontend/src/pages/destructionlist/DestructionListCreate.stories.tsx create mode 100644 frontend/src/pages/destructionlist/DestructionListCreate.tsx create mode 100644 frontend/src/pages/destructionlist/index.ts delete mode 100644 frontend/src/pages/landing/Landing.stories.tsx diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index bc7d059c..4737cf3b 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -5,7 +5,14 @@ import { RouterProvider, createBrowserRouter } from "react-router-dom"; import App from "./App"; import "./index.css"; -import { LoginPage, landingLoader, loginAction, logoutLoader } from "./pages"; +import { + DestructionListCreatePage, + LoginPage, + destructionListCreateLoader, + landingLoader, + loginAction, + logoutLoader, +} from "./pages"; const router = createBrowserRouter([ { @@ -16,6 +23,11 @@ const router = createBrowserRouter([ path: "/", loader: landingLoader, }, + { + path: "/destruction-lists/create", + element: , + loader: destructionListCreateLoader, + }, { path: "/login", element: , diff --git a/frontend/src/pages/destructionlist/DestructionListCreate.css b/frontend/src/pages/destructionlist/DestructionListCreate.css new file mode 100644 index 00000000..83aa2a8e --- /dev/null +++ b/frontend/src/pages/destructionlist/DestructionListCreate.css @@ -0,0 +1,3 @@ +.DestructionListCreatePage { + /* Rules here. */ +} diff --git a/frontend/src/pages/destructionlist/DestructionListCreate.stories.tsx b/frontend/src/pages/destructionlist/DestructionListCreate.stories.tsx new file mode 100644 index 00000000..f33edc65 --- /dev/null +++ b/frontend/src/pages/destructionlist/DestructionListCreate.stories.tsx @@ -0,0 +1,571 @@ +import type { Meta, StoryObj } from "@storybook/react"; + +import { ReactRouterDecorator } from "../../../.storybook/decorators"; +import { DestructionListCreatePage } from "./DestructionListCreate"; + +const meta: Meta = { + title: "Pages/DestructionList/DestructionListCreatePage", + component: DestructionListCreatePage, + decorators: [ReactRouterDecorator], +}; + +export default meta; +type Story = StoryObj; + +const FIXTURE = { + count: 10, + next: null, + previous: null, + results: [ + { + uuid: "87691e74-1b0b-491a-aa63-0a396bbb1e3e", + url: "http://localhost:8000/zaken/api/v1/zaken/87691e74-1b0b-491a-aa63-0a396bbb1e3e", + rollen: [], + status: + "http://localhost:8000/zaken/api/v1/statussen/0ca07132-62fe-4ba9-9735-71268e7dff7a", + zaaktype: + "http://localhost:8000/catalogi/api/v1/zaaktypen/64c98539-076e-4fbf-8fec-fa86c560fb24", + deelzaken: [], + einddatum: "2024-03-24", + hoofdzaak: null, + kenmerken: [], + resultaat: null, + startdatum: "2021-01-01", + verlenging: null, + opschorting: { + reden: "", + indicatie: false, + }, + toelichting: "", + omschrijving: "Test zaak SHNB25", + zaakobjecten: [], + archiefstatus: "nog_te_archiveren", + eigenschappen: [], + identificatie: "ZAAK-2021-0000000008", + processobject: { + objecttype: "", + registratie: "", + datumkenmerk: "", + identificatie: "", + }, + zaakgeometrie: null, + bronorganisatie: "376924512", + publicatiedatum: null, + archiefnominatie: "vernietigen", + einddatumGepland: null, + registratiedatum: "2024-03-25", + archiefactiedatum: "2021-01-01", + processobjectaard: "", + betalingsindicatie: "", + communicatiekanaal: "", + laatsteBetaaldatum: null, + productenOfDiensten: [], + selectielijstklasse: "", + relevanteAndereZaken: [], + zaakinformatieobjecten: [ + "http://localhost:8000/zaken/api/v1/zaakinformatieobjecten/8582e4bf-2b81-4425-b403-149d12d90c54", + ], + startdatumBewaartermijn: null, + betalingsindicatieWeergave: "", + opdrachtgevendeOrganisatie: "", + vertrouwelijkheidaanduiding: "geheim", + uiterlijkeEinddatumAfdoening: null, + verantwoordelijkeOrganisatie: "104567387", + }, + { + uuid: "3038cc8e-003b-411c-b6ef-7dc5ddc5a3ee", + url: "http://localhost:8000/zaken/api/v1/zaken/3038cc8e-003b-411c-b6ef-7dc5ddc5a3ee", + rollen: [], + status: null, + zaaktype: + "http://localhost:8000/catalogi/api/v1/zaaktypen/64c98539-076e-4fbf-8fec-fa86c560fb24", + deelzaken: [], + einddatum: null, + hoofdzaak: null, + kenmerken: [], + resultaat: null, + startdatum: "2019-01-01", + verlenging: null, + opschorting: { + reden: "", + indicatie: false, + }, + toelichting: "", + omschrijving: "Test zaak CKERQQ", + zaakobjecten: [], + archiefstatus: "nog_te_archiveren", + eigenschappen: [], + identificatie: "ZAAK-2019-0000000002", + processobject: { + objecttype: "", + registratie: "", + datumkenmerk: "", + identificatie: "", + }, + zaakgeometrie: null, + bronorganisatie: "517439943", + publicatiedatum: null, + archiefnominatie: "vernietigen", + einddatumGepland: null, + registratiedatum: "2024-03-25", + archiefactiedatum: "2021-01-01", + processobjectaard: "", + betalingsindicatie: "", + communicatiekanaal: "", + laatsteBetaaldatum: null, + productenOfDiensten: [], + selectielijstklasse: "", + relevanteAndereZaken: [], + zaakinformatieobjecten: [ + "http://localhost:8000/zaken/api/v1/zaakinformatieobjecten/9feb00c0-1c79-40e3-aa59-96d8999de624", + ], + startdatumBewaartermijn: null, + betalingsindicatieWeergave: "", + opdrachtgevendeOrganisatie: "", + vertrouwelijkheidaanduiding: "openbaar", + uiterlijkeEinddatumAfdoening: null, + verantwoordelijkeOrganisatie: "104567387", + }, + { + uuid: "78b6dd10-261b-4a40-99e2-1eea3e38bc99", + url: "http://localhost:8000/zaken/api/v1/zaken/78b6dd10-261b-4a40-99e2-1eea3e38bc99", + rollen: [], + status: null, + zaaktype: + "http://localhost:8000/catalogi/api/v1/zaaktypen/927eb71c-d99b-4c5d-b3e2-94a07ce85923", + deelzaken: [], + einddatum: null, + hoofdzaak: null, + kenmerken: [], + resultaat: null, + startdatum: "2021-02-01", + verlenging: null, + opschorting: { + reden: "", + indicatie: false, + }, + toelichting: "", + omschrijving: "Test zaak CI0GFH", + zaakobjecten: [], + archiefstatus: "nog_te_archiveren", + eigenschappen: [], + identificatie: "ZAAK-2021-0000000007", + processobject: { + objecttype: "", + registratie: "", + datumkenmerk: "", + identificatie: "", + }, + zaakgeometrie: null, + bronorganisatie: "517439943", + publicatiedatum: null, + archiefnominatie: "vernietigen", + einddatumGepland: null, + registratiedatum: "2024-03-25", + archiefactiedatum: "2021-01-01", + processobjectaard: "", + betalingsindicatie: "", + communicatiekanaal: "", + laatsteBetaaldatum: null, + productenOfDiensten: [], + selectielijstklasse: "", + relevanteAndereZaken: [], + zaakinformatieobjecten: [ + "http://localhost:8000/zaken/api/v1/zaakinformatieobjecten/d2217461-6b9d-414c-b7ce-ba306f38fc2d", + ], + startdatumBewaartermijn: null, + betalingsindicatieWeergave: "", + opdrachtgevendeOrganisatie: "", + vertrouwelijkheidaanduiding: "geheim", + uiterlijkeEinddatumAfdoening: null, + verantwoordelijkeOrganisatie: "104567387", + }, + { + uuid: "64bec25d-5752-48a9-b2f9-6c27085a469f", + url: "http://localhost:8000/zaken/api/v1/zaken/64bec25d-5752-48a9-b2f9-6c27085a469f", + rollen: [], + status: null, + zaaktype: + "http://localhost:8000/catalogi/api/v1/zaaktypen/927eb71c-d99b-4c5d-b3e2-94a07ce85923", + deelzaken: [], + einddatum: null, + hoofdzaak: null, + kenmerken: [], + resultaat: null, + startdatum: "2021-05-01", + verlenging: null, + opschorting: { + reden: "", + indicatie: false, + }, + toelichting: "", + omschrijving: "Test zaak 5EQDCS", + zaakobjecten: [], + archiefstatus: "nog_te_archiveren", + eigenschappen: [], + identificatie: "ZAAK-2021-0000000006", + processobject: { + objecttype: "", + registratie: "", + datumkenmerk: "", + identificatie: "", + }, + zaakgeometrie: null, + bronorganisatie: "095847261", + publicatiedatum: null, + archiefnominatie: "vernietigen", + einddatumGepland: null, + registratiedatum: "2024-03-25", + archiefactiedatum: "2024-02-01", + processobjectaard: "", + betalingsindicatie: "", + communicatiekanaal: "", + laatsteBetaaldatum: null, + productenOfDiensten: [], + selectielijstklasse: "", + relevanteAndereZaken: [], + zaakinformatieobjecten: [ + "http://localhost:8000/zaken/api/v1/zaakinformatieobjecten/7c263c14-e3ae-4f2b-bc5f-a5a5052ee016", + ], + startdatumBewaartermijn: null, + betalingsindicatieWeergave: "", + opdrachtgevendeOrganisatie: "", + vertrouwelijkheidaanduiding: "openbaar", + uiterlijkeEinddatumAfdoening: null, + verantwoordelijkeOrganisatie: "104567387", + }, + { + uuid: "409a291a-9cf0-4c40-9f31-25e9452a8e79", + url: "http://localhost:8000/zaken/api/v1/zaken/409a291a-9cf0-4c40-9f31-25e9452a8e79", + rollen: [], + status: null, + zaaktype: + "http://localhost:8000/catalogi/api/v1/zaaktypen/684b9c68-a36f-4c72-b044-fa9cdcb17ec9", + deelzaken: [], + einddatum: null, + hoofdzaak: null, + kenmerken: [], + resultaat: null, + startdatum: "2019-01-01", + verlenging: null, + opschorting: { + reden: "", + indicatie: false, + }, + toelichting: "", + omschrijving: "Test zaak JQG084", + zaakobjecten: [], + archiefstatus: "nog_te_archiveren", + eigenschappen: [], + identificatie: "ZAAK-2019-0000000001", + processobject: { + objecttype: "", + registratie: "", + datumkenmerk: "", + identificatie: "", + }, + zaakgeometrie: null, + bronorganisatie: "517439943", + publicatiedatum: null, + archiefnominatie: "vernietigen", + einddatumGepland: null, + registratiedatum: "2024-03-25", + archiefactiedatum: "2021-01-01", + processobjectaard: "", + betalingsindicatie: "", + communicatiekanaal: "", + laatsteBetaaldatum: null, + productenOfDiensten: [], + selectielijstklasse: "", + relevanteAndereZaken: [], + zaakinformatieobjecten: [], + startdatumBewaartermijn: null, + betalingsindicatieWeergave: "", + opdrachtgevendeOrganisatie: "", + vertrouwelijkheidaanduiding: "openbaar", + uiterlijkeEinddatumAfdoening: null, + verantwoordelijkeOrganisatie: "104567387", + }, + { + uuid: "1188687c-392b-439e-9d5f-4d17bac822bf", + url: "http://localhost:8000/zaken/api/v1/zaken/1188687c-392b-439e-9d5f-4d17bac822bf", + rollen: [], + status: null, + zaaktype: + "http://localhost:8000/catalogi/api/v1/zaaktypen/e4f2a6b0-9377-400a-b0ce-ed66c0a315da", + deelzaken: [], + einddatum: null, + hoofdzaak: null, + kenmerken: [], + resultaat: null, + startdatum: "2021-02-01", + verlenging: null, + opschorting: { + reden: "", + indicatie: false, + }, + toelichting: "", + omschrijving: "Test zaak P7VDXB", + zaakobjecten: [], + archiefstatus: "nog_te_archiveren", + eigenschappen: [], + identificatie: "ZAAK-2021-0000000005", + processobject: { + objecttype: "", + registratie: "", + datumkenmerk: "", + identificatie: "", + }, + zaakgeometrie: null, + bronorganisatie: "517439943", + publicatiedatum: null, + archiefnominatie: "vernietigen", + einddatumGepland: null, + registratiedatum: "2024-03-25", + archiefactiedatum: "2021-01-01", + processobjectaard: "", + betalingsindicatie: "", + communicatiekanaal: "", + laatsteBetaaldatum: null, + productenOfDiensten: [], + selectielijstklasse: "", + relevanteAndereZaken: [], + zaakinformatieobjecten: [ + "http://localhost:8000/zaken/api/v1/zaakinformatieobjecten/a9158b2a-304f-4a6e-bc3d-9f73c83e26b1", + ], + startdatumBewaartermijn: null, + betalingsindicatieWeergave: "", + opdrachtgevendeOrganisatie: "", + vertrouwelijkheidaanduiding: "geheim", + uiterlijkeEinddatumAfdoening: null, + verantwoordelijkeOrganisatie: "104567387", + }, + { + uuid: "5d816422-7f1c-42b4-9a4c-715d2e07aca3", + url: "http://localhost:8000/zaken/api/v1/zaken/5d816422-7f1c-42b4-9a4c-715d2e07aca3", + rollen: [], + status: null, + zaaktype: + "http://localhost:8000/catalogi/api/v1/zaaktypen/e4f2a6b0-9377-400a-b0ce-ed66c0a315da", + deelzaken: [], + einddatum: null, + hoofdzaak: null, + kenmerken: [], + resultaat: null, + startdatum: "2021-05-01", + verlenging: null, + opschorting: { + reden: "", + indicatie: false, + }, + toelichting: "", + omschrijving: "Test zaak KVD4YL", + zaakobjecten: [], + archiefstatus: "nog_te_archiveren", + eigenschappen: [], + identificatie: "ZAAK-2021-0000000004", + processobject: { + objecttype: "", + registratie: "", + datumkenmerk: "", + identificatie: "", + }, + zaakgeometrie: null, + bronorganisatie: "095847261", + publicatiedatum: null, + archiefnominatie: "vernietigen", + einddatumGepland: null, + registratiedatum: "2024-03-25", + archiefactiedatum: "2021-02-01", + processobjectaard: "", + betalingsindicatie: "", + communicatiekanaal: "", + laatsteBetaaldatum: null, + productenOfDiensten: [], + selectielijstklasse: "", + relevanteAndereZaken: [], + zaakinformatieobjecten: [ + "http://localhost:8000/zaken/api/v1/zaakinformatieobjecten/9e3ff7a9-90db-45e2-ab0a-1129ec026243", + ], + startdatumBewaartermijn: null, + betalingsindicatieWeergave: "", + opdrachtgevendeOrganisatie: "", + vertrouwelijkheidaanduiding: "openbaar", + uiterlijkeEinddatumAfdoening: null, + verantwoordelijkeOrganisatie: "104567387", + }, + { + uuid: "2e803c71-49c4-4dc0-bfd1-42f2a3da99f9", + url: "http://localhost:8000/zaken/api/v1/zaken/2e803c71-49c4-4dc0-bfd1-42f2a3da99f9", + rollen: [], + status: null, + zaaktype: + "http://localhost:8000/catalogi/api/v1/zaaktypen/3206d651-d0f2-4690-933d-cc690444184f", + deelzaken: [], + einddatum: null, + hoofdzaak: null, + kenmerken: [], + resultaat: null, + startdatum: "2021-02-01", + verlenging: null, + opschorting: { + reden: "", + indicatie: false, + }, + toelichting: "", + omschrijving: "Test zaak D8JVVN", + zaakobjecten: [], + archiefstatus: "nog_te_archiveren", + eigenschappen: [], + identificatie: "ZAAK-2021-0000000003", + processobject: { + objecttype: "", + registratie: "", + datumkenmerk: "", + identificatie: "", + }, + zaakgeometrie: null, + bronorganisatie: "517439943", + publicatiedatum: null, + archiefnominatie: "vernietigen", + einddatumGepland: null, + registratiedatum: "2024-03-25", + archiefactiedatum: "2021-01-01", + processobjectaard: "", + betalingsindicatie: "", + communicatiekanaal: "", + laatsteBetaaldatum: null, + productenOfDiensten: [], + selectielijstklasse: "", + relevanteAndereZaken: [], + zaakinformatieobjecten: [ + "http://localhost:8000/zaken/api/v1/zaakinformatieobjecten/26a87623-aa50-48fd-861d-61d8f3456d36", + ], + startdatumBewaartermijn: null, + betalingsindicatieWeergave: "", + opdrachtgevendeOrganisatie: "", + vertrouwelijkheidaanduiding: "geheim", + uiterlijkeEinddatumAfdoening: null, + verantwoordelijkeOrganisatie: "104567387", + }, + { + uuid: "bd6cdd85-d578-47fa-9ddb-846354088a47", + url: "http://localhost:8000/zaken/api/v1/zaken/bd6cdd85-d578-47fa-9ddb-846354088a47", + rollen: [], + status: null, + zaaktype: + "http://localhost:8000/catalogi/api/v1/zaaktypen/3206d651-d0f2-4690-933d-cc690444184f", + deelzaken: [], + einddatum: null, + hoofdzaak: null, + kenmerken: [], + resultaat: null, + startdatum: "2021-05-01", + verlenging: null, + opschorting: { + reden: "", + indicatie: false, + }, + toelichting: "", + omschrijving: "Test zaak MJ3N0F", + zaakobjecten: [], + archiefstatus: "nog_te_archiveren", + eigenschappen: [], + identificatie: "ZAAK-2021-0000000002", + processobject: { + objecttype: "", + registratie: "", + datumkenmerk: "", + identificatie: "", + }, + zaakgeometrie: null, + bronorganisatie: "095847261", + publicatiedatum: null, + archiefnominatie: "vernietigen", + einddatumGepland: null, + registratiedatum: "2024-03-25", + archiefactiedatum: "2021-02-01", + processobjectaard: "", + betalingsindicatie: "", + communicatiekanaal: "", + laatsteBetaaldatum: null, + productenOfDiensten: [], + selectielijstklasse: "", + relevanteAndereZaken: [], + zaakinformatieobjecten: [ + "http://localhost:8000/zaken/api/v1/zaakinformatieobjecten/99fa414b-7fc5-4eef-bf8f-3920333df7b4", + ], + startdatumBewaartermijn: null, + betalingsindicatieWeergave: "", + opdrachtgevendeOrganisatie: "", + vertrouwelijkheidaanduiding: "openbaar", + uiterlijkeEinddatumAfdoening: null, + verantwoordelijkeOrganisatie: "104567387", + }, + { + uuid: "2ca5f28c-397b-4cc6-ac76-4ef6cab19f59", + url: "http://localhost:8000/zaken/api/v1/zaken/2ca5f28c-397b-4cc6-ac76-4ef6cab19f59", + rollen: [], + status: null, + zaaktype: + "http://localhost:8000/catalogi/api/v1/zaaktypen/773b6b77-486a-4b6c-be3e-cf13f4387cf3", + deelzaken: [], + einddatum: null, + hoofdzaak: null, + kenmerken: [], + resultaat: null, + startdatum: "2021-05-01", + verlenging: null, + opschorting: { + reden: "", + indicatie: false, + }, + toelichting: "", + omschrijving: "Test zaak S75OKU", + zaakobjecten: [], + archiefstatus: "nog_te_archiveren", + eigenschappen: [], + identificatie: "ZAAK-2021-0000000001", + processobject: { + objecttype: "", + registratie: "", + datumkenmerk: "", + identificatie: "", + }, + zaakgeometrie: null, + bronorganisatie: "095847261", + publicatiedatum: null, + archiefnominatie: "vernietigen", + einddatumGepland: null, + registratiedatum: "2024-03-25", + archiefactiedatum: "2021-02-01", + processobjectaard: "", + betalingsindicatie: "", + communicatiekanaal: "", + laatsteBetaaldatum: null, + productenOfDiensten: [], + selectielijstklasse: "", + relevanteAndereZaken: [], + zaakinformatieobjecten: [], + startdatumBewaartermijn: null, + betalingsindicatieWeergave: "", + opdrachtgevendeOrganisatie: "", + vertrouwelijkheidaanduiding: "openbaar", + uiterlijkeEinddatumAfdoening: null, + verantwoordelijkeOrganisatie: "104567387", + }, + ], +}; + +export const destructionListCreatePage: Story = { + args: { + children: "The quick brown fox jumps over the lazy dog.", + }, + parameters: { + reactRouterDecorator: { + route: { + loader: async () => FIXTURE, + }, + }, + }, +}; diff --git a/frontend/src/pages/destructionlist/DestructionListCreate.tsx b/frontend/src/pages/destructionlist/DestructionListCreate.tsx new file mode 100644 index 00000000..1e8b83e4 --- /dev/null +++ b/frontend/src/pages/destructionlist/DestructionListCreate.tsx @@ -0,0 +1,93 @@ +import { + AttributeData, + DataGridProps, + List, + TypedField, +} from "@maykin-ui/admin-ui"; +import React from "react"; +import { useLoaderData } from "react-router-dom"; + +import { loginRequired } from "../../lib/api/loginRequired"; +import { PaginatedZaken, listZaken } from "../../lib/api/zaken"; +import { Zaak } from "../../types"; +import "./DestructionListCreate.css"; + +/** + * React Router loader. + * @param request + * TOOD: Requires destruction list lists endpoint. + */ +export const destructionListCreateLoader = loginRequired(listZaken); + +export type DestructionListCreateProps = Omit< + React.ComponentProps<"main">, + "onChange" | "onSelect" +>; + +/** + * Destruction list creation page + */ +export function DestructionListCreatePage({ + ...props +}: DestructionListCreateProps) { + const { count, results } = useLoaderData() as PaginatedZaken; + const objectList = transformZakenForPresentation(results); + + console.log(results, objectList); + + const fields: TypedField[] = [ + { name: "identificatie", type: "string" }, + { name: "zaaktype", type: "string" }, + { name: "omschrijving", type: "string" }, + { name: "looptijd", type: "string" }, + { name: "resultaattype", type: "string" }, + { name: "bewaartermijn", type: "string" }, + { name: "vcs", type: "string" }, + { name: "relaties", type: "boolean" }, + ]; + + return ( + + ); +} + +export function transformZakenForPresentation(zaken: Zaak[]) { + return zaken.map((zaak) => { + const startDate = new Date(zaak.startdatum); + const endDate = zaak.einddatum ? new Date(zaak.einddatum) : new Date(); + const dayDelta = + (endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24); + + return { + identificatie: zaak.identificatie || "", + zaaktype: zaak.zaaktype, + omschrijving: zaak.omschrijving || "", + looptijd: String(dayDelta), + resultaattype: "TODO", + bewaartermijn: "TODO", + vcs: "TODO", + relaties: Boolean(zaak?.relevanteAndereZaken?.length || 0), + }; + }); +} diff --git a/frontend/src/pages/destructionlist/index.ts b/frontend/src/pages/destructionlist/index.ts new file mode 100644 index 00000000..067420cf --- /dev/null +++ b/frontend/src/pages/destructionlist/index.ts @@ -0,0 +1 @@ +export * from "./DestructionListCreate"; diff --git a/frontend/src/pages/index.ts b/frontend/src/pages/index.ts index da477bd9..fe8cff31 100644 --- a/frontend/src/pages/index.ts +++ b/frontend/src/pages/index.ts @@ -1,4 +1,5 @@ // Auto-generated file. Do not modify manually. +export * from "./destructionlist"; export * from "./landing"; export * from "./login"; export * from "./logout"; diff --git a/frontend/src/pages/landing/Landing.stories.tsx b/frontend/src/pages/landing/Landing.stories.tsx deleted file mode 100644 index b9ccd915..00000000 --- a/frontend/src/pages/landing/Landing.stories.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import type { Meta, StoryObj } from "@storybook/react"; - -import { ReactRouterDecorator } from "../../../.storybook/decorators"; -import { LandingPage, landingLoader } from "./Landing"; - -const meta: Meta = { - title: "Pages/Landing", - component: LandingPage, - decorators: [ReactRouterDecorator], - parameters: { - layout: "fullscreen", - loader: landingLoader, - }, -}; - -export default meta; -type Story = StoryObj; - -export const landingPage: Story = { - args: { - children: "The quick brown fox jumps over the lazy dog.", - }, -}; diff --git a/frontend/src/pages/landing/Landing.tsx b/frontend/src/pages/landing/Landing.tsx index f6dfb3c5..1fdede13 100644 --- a/frontend/src/pages/landing/Landing.tsx +++ b/frontend/src/pages/landing/Landing.tsx @@ -1,29 +1,10 @@ -import React from "react"; -import { useLoaderData } from "react-router-dom"; +import { redirect } from "react-router-dom"; -import { loginRequired } from "../../lib/api/loginRequired"; -import { listReviewers } from "../../lib/api/reviewers"; import "./Landing.css"; /** * React Router loader. * @param request + * TOOD: Requires destruction list lists endpoint. */ -export const landingLoader = loginRequired(listReviewers); - -export type LandingProps = React.ComponentProps<"main"> & { - // Props here. -}; - -/** - * Landing page - */ -export function LandingPage({ children, ...props }: LandingProps) { - const items = useLoaderData(); - - return ( -
- {JSON.stringify(items)} -
- ); -} +export const landingLoader = () => redirect("/destruction-lists/create");