From f0f7488e2440a36ec69366f5ca7a664436f14e60 Mon Sep 17 00:00:00 2001 From: Sven van de Scheur Date: Fri, 10 Jan 2025 09:59:04 +0100 Subject: [PATCH 01/17] :truck: #553 - refactor: alter directory structure --- .../destructionlist/detail/hooks/useSecondaryNavigation.tsx | 2 +- .../DestructionListEditPage.stories.tsx | 0 .../DestructionListEditPage.tsx | 0 .../detail/pages/{DestructionListEditPage => edit}/index.ts | 0 frontend/src/pages/destructionlist/detail/pages/index.ts | 4 ++-- .../DestructionListProcessReviewPage.stories.tsx | 0 .../DestructionListProcessReviewPage.tsx | 0 .../DestructionListProcessZaakReviewModal.tsx | 0 .../components/DestructionListProcessZaakReviewModal/index.ts | 0 .../components/index.ts | 0 .../index.ts | 0 11 files changed, 3 insertions(+), 3 deletions(-) rename frontend/src/pages/destructionlist/detail/pages/{DestructionListEditPage => edit}/DestructionListEditPage.stories.tsx (100%) rename frontend/src/pages/destructionlist/detail/pages/{DestructionListEditPage => edit}/DestructionListEditPage.tsx (100%) rename frontend/src/pages/destructionlist/detail/pages/{DestructionListEditPage => edit}/index.ts (100%) rename frontend/src/pages/destructionlist/detail/pages/{DestructionListProcessReviewPage => process-review}/DestructionListProcessReviewPage.stories.tsx (100%) rename frontend/src/pages/destructionlist/detail/pages/{DestructionListProcessReviewPage => process-review}/DestructionListProcessReviewPage.tsx (100%) rename frontend/src/pages/destructionlist/detail/pages/{DestructionListProcessReviewPage => process-review}/components/DestructionListProcessZaakReviewModal/DestructionListProcessZaakReviewModal.tsx (100%) rename frontend/src/pages/destructionlist/detail/pages/{DestructionListProcessReviewPage => process-review}/components/DestructionListProcessZaakReviewModal/index.ts (100%) rename frontend/src/pages/destructionlist/detail/pages/{DestructionListProcessReviewPage => process-review}/components/index.ts (100%) rename frontend/src/pages/destructionlist/detail/pages/{DestructionListProcessReviewPage => process-review}/index.ts (100%) diff --git a/frontend/src/pages/destructionlist/detail/hooks/useSecondaryNavigation.tsx b/frontend/src/pages/destructionlist/detail/hooks/useSecondaryNavigation.tsx index 8352142b..a3aac3df 100644 --- a/frontend/src/pages/destructionlist/detail/hooks/useSecondaryNavigation.tsx +++ b/frontend/src/pages/destructionlist/detail/hooks/useSecondaryNavigation.tsx @@ -29,7 +29,7 @@ import { UpdateDestructionListProcessReviewAction, } from "../DestructionListDetail.action"; import { DestructionListDetailContext } from "../DestructionListDetail.loader"; -import { ProcessReviewAction } from "../pages/DestructionListProcessReviewPage/components"; +import { ProcessReviewAction } from "../pages/process-review/components"; interface ProcessZaakReviewSelectionDetail { comment: string; diff --git a/frontend/src/pages/destructionlist/detail/pages/DestructionListEditPage/DestructionListEditPage.stories.tsx b/frontend/src/pages/destructionlist/detail/pages/edit/DestructionListEditPage.stories.tsx similarity index 100% rename from frontend/src/pages/destructionlist/detail/pages/DestructionListEditPage/DestructionListEditPage.stories.tsx rename to frontend/src/pages/destructionlist/detail/pages/edit/DestructionListEditPage.stories.tsx diff --git a/frontend/src/pages/destructionlist/detail/pages/DestructionListEditPage/DestructionListEditPage.tsx b/frontend/src/pages/destructionlist/detail/pages/edit/DestructionListEditPage.tsx similarity index 100% rename from frontend/src/pages/destructionlist/detail/pages/DestructionListEditPage/DestructionListEditPage.tsx rename to frontend/src/pages/destructionlist/detail/pages/edit/DestructionListEditPage.tsx diff --git a/frontend/src/pages/destructionlist/detail/pages/DestructionListEditPage/index.ts b/frontend/src/pages/destructionlist/detail/pages/edit/index.ts similarity index 100% rename from frontend/src/pages/destructionlist/detail/pages/DestructionListEditPage/index.ts rename to frontend/src/pages/destructionlist/detail/pages/edit/index.ts diff --git a/frontend/src/pages/destructionlist/detail/pages/index.ts b/frontend/src/pages/destructionlist/detail/pages/index.ts index 0f67c45a..e0b04fa1 100644 --- a/frontend/src/pages/destructionlist/detail/pages/index.ts +++ b/frontend/src/pages/destructionlist/detail/pages/index.ts @@ -1,2 +1,2 @@ -export * from "./DestructionListEditPage"; -export * from "./DestructionListProcessReviewPage"; +export * from "./edit"; +export * from "./process-review"; diff --git a/frontend/src/pages/destructionlist/detail/pages/DestructionListProcessReviewPage/DestructionListProcessReviewPage.stories.tsx b/frontend/src/pages/destructionlist/detail/pages/process-review/DestructionListProcessReviewPage.stories.tsx similarity index 100% rename from frontend/src/pages/destructionlist/detail/pages/DestructionListProcessReviewPage/DestructionListProcessReviewPage.stories.tsx rename to frontend/src/pages/destructionlist/detail/pages/process-review/DestructionListProcessReviewPage.stories.tsx diff --git a/frontend/src/pages/destructionlist/detail/pages/DestructionListProcessReviewPage/DestructionListProcessReviewPage.tsx b/frontend/src/pages/destructionlist/detail/pages/process-review/DestructionListProcessReviewPage.tsx similarity index 100% rename from frontend/src/pages/destructionlist/detail/pages/DestructionListProcessReviewPage/DestructionListProcessReviewPage.tsx rename to frontend/src/pages/destructionlist/detail/pages/process-review/DestructionListProcessReviewPage.tsx diff --git a/frontend/src/pages/destructionlist/detail/pages/DestructionListProcessReviewPage/components/DestructionListProcessZaakReviewModal/DestructionListProcessZaakReviewModal.tsx b/frontend/src/pages/destructionlist/detail/pages/process-review/components/DestructionListProcessZaakReviewModal/DestructionListProcessZaakReviewModal.tsx similarity index 100% rename from frontend/src/pages/destructionlist/detail/pages/DestructionListProcessReviewPage/components/DestructionListProcessZaakReviewModal/DestructionListProcessZaakReviewModal.tsx rename to frontend/src/pages/destructionlist/detail/pages/process-review/components/DestructionListProcessZaakReviewModal/DestructionListProcessZaakReviewModal.tsx diff --git a/frontend/src/pages/destructionlist/detail/pages/DestructionListProcessReviewPage/components/DestructionListProcessZaakReviewModal/index.ts b/frontend/src/pages/destructionlist/detail/pages/process-review/components/DestructionListProcessZaakReviewModal/index.ts similarity index 100% rename from frontend/src/pages/destructionlist/detail/pages/DestructionListProcessReviewPage/components/DestructionListProcessZaakReviewModal/index.ts rename to frontend/src/pages/destructionlist/detail/pages/process-review/components/DestructionListProcessZaakReviewModal/index.ts diff --git a/frontend/src/pages/destructionlist/detail/pages/DestructionListProcessReviewPage/components/index.ts b/frontend/src/pages/destructionlist/detail/pages/process-review/components/index.ts similarity index 100% rename from frontend/src/pages/destructionlist/detail/pages/DestructionListProcessReviewPage/components/index.ts rename to frontend/src/pages/destructionlist/detail/pages/process-review/components/index.ts diff --git a/frontend/src/pages/destructionlist/detail/pages/DestructionListProcessReviewPage/index.ts b/frontend/src/pages/destructionlist/detail/pages/process-review/index.ts similarity index 100% rename from frontend/src/pages/destructionlist/detail/pages/DestructionListProcessReviewPage/index.ts rename to frontend/src/pages/destructionlist/detail/pages/process-review/index.ts From 1ec59abb1033ac7eb795ef5d9212e12cc111f477 Mon Sep 17 00:00:00 2001 From: Sven van de Scheur Date: Fri, 10 Jan 2025 10:03:17 +0100 Subject: [PATCH 02/17] :recycle: #553 - refactor: rename SettingsPage to ShortProcedureSettingsPage --- frontend/src/index.tsx | 12 ++++++------ frontend/src/pages/settings/Settings.css | 3 --- ...ction.ts => ShortProcedureSettingsPage.action.ts} | 5 ++++- ...oader.ts => ShortProcedureSettingsPage.loader.ts} | 2 +- ...es.tsx => ShortProcedureSettingsPage.stories.tsx} | 6 +++--- .../{Settings.tsx => ShortProcedureSettingsPage.tsx} | 9 ++++----- frontend/src/pages/settings/index.ts | 6 +++--- 7 files changed, 21 insertions(+), 22 deletions(-) delete mode 100644 frontend/src/pages/settings/Settings.css rename frontend/src/pages/settings/{settings.action.ts => ShortProcedureSettingsPage.action.ts} (90%) rename frontend/src/pages/settings/{settings.loader.ts => ShortProcedureSettingsPage.loader.ts} (93%) rename frontend/src/pages/settings/{Settings.stories.tsx => ShortProcedureSettingsPage.stories.tsx} (81%) rename frontend/src/pages/settings/{Settings.tsx => ShortProcedureSettingsPage.tsx} (92%) diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index 095a45e9..5fff0523 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -19,7 +19,7 @@ import { DestructionListReviewPage, Landing, LoginPage, - SettingsPage, + ShortProcedureSettingsPage, destructionListCreateAction, destructionListCreateLoader, destructionListDetailLoader, @@ -29,8 +29,8 @@ import { landingLoader, loginAction, logoutLoader, - settingsAction, - settingsLoader, + shortProcedureSettingsPageAction, + shortProcedureSettingsPageLoader, } from "./pages"; const router = createBrowserRouter([ @@ -148,9 +148,9 @@ const router = createBrowserRouter([ }, { path: "/settings", - element: , - loader: settingsLoader, - action: settingsAction, + element: , + loader: shortProcedureSettingsPageLoader, + action: shortProcedureSettingsPageAction, }, { path: "/login", diff --git a/frontend/src/pages/settings/Settings.css b/frontend/src/pages/settings/Settings.css deleted file mode 100644 index 35241642..00000000 --- a/frontend/src/pages/settings/Settings.css +++ /dev/null @@ -1,3 +0,0 @@ -.SettingsPage { - /* Rules here. */ -} diff --git a/frontend/src/pages/settings/settings.action.ts b/frontend/src/pages/settings/ShortProcedureSettingsPage.action.ts similarity index 90% rename from frontend/src/pages/settings/settings.action.ts rename to frontend/src/pages/settings/ShortProcedureSettingsPage.action.ts index f58583eb..74d8261e 100644 --- a/frontend/src/pages/settings/settings.action.ts +++ b/frontend/src/pages/settings/ShortProcedureSettingsPage.action.ts @@ -14,7 +14,10 @@ export type UpdateSettingsAction = TypedAction< /** * React Router action. */ -export async function settingsAction({ request, params }: ActionFunctionArgs) { +export async function shortProcedureSettingsPageAction({ + request, + params, +}: ActionFunctionArgs) { const data = await request.clone().json(); const action = data as UpdateSettingsAction; diff --git a/frontend/src/pages/settings/settings.loader.ts b/frontend/src/pages/settings/ShortProcedureSettingsPage.loader.ts similarity index 93% rename from frontend/src/pages/settings/settings.loader.ts rename to frontend/src/pages/settings/ShortProcedureSettingsPage.loader.ts index 6618cf4e..9c575f62 100644 --- a/frontend/src/pages/settings/settings.loader.ts +++ b/frontend/src/pages/settings/ShortProcedureSettingsPage.loader.ts @@ -13,7 +13,7 @@ export type SettingsContext = { zaaktypeChoices: ZaaktypeChoice[]; }; -export const settingsLoader = loginRequired( +export const shortProcedureSettingsPageLoader = loginRequired( canViewAndEditSettingsRequired(async (): Promise => { const archiveConfigPromise = getArchiveConfiguration(); const zaaktypeChoicesPromise = listZaaktypeChoices(); diff --git a/frontend/src/pages/settings/Settings.stories.tsx b/frontend/src/pages/settings/ShortProcedureSettingsPage.stories.tsx similarity index 81% rename from frontend/src/pages/settings/Settings.stories.tsx rename to frontend/src/pages/settings/ShortProcedureSettingsPage.stories.tsx index ae2ebdf0..bb21406d 100644 --- a/frontend/src/pages/settings/Settings.stories.tsx +++ b/frontend/src/pages/settings/ShortProcedureSettingsPage.stories.tsx @@ -2,11 +2,11 @@ import type { Meta, StoryObj } from "@storybook/react"; import { ReactRouterDecorator } from "../../../.storybook/decorators"; import { assertCheckboxSelection } from "../../../.storybook/playFunctions"; -import { SettingsPage } from "./Settings"; +import { ShortProcedureSettingsPage } from "./ShortProcedureSettingsPage"; -const meta: Meta = { +const meta: Meta = { title: "Pages/Settings", - component: SettingsPage, + component: ShortProcedureSettingsPage, decorators: [ReactRouterDecorator], }; diff --git a/frontend/src/pages/settings/Settings.tsx b/frontend/src/pages/settings/ShortProcedureSettingsPage.tsx similarity index 92% rename from frontend/src/pages/settings/Settings.tsx rename to frontend/src/pages/settings/ShortProcedureSettingsPage.tsx index c5ff8dce..a6f91d62 100644 --- a/frontend/src/pages/settings/Settings.tsx +++ b/frontend/src/pages/settings/ShortProcedureSettingsPage.tsx @@ -3,9 +3,8 @@ import { useCallback, useMemo, useState } from "react"; import { useLoaderData } from "react-router-dom"; import { useSubmitAction } from "../../hooks"; -import "./Settings.css"; -import { UpdateSettingsAction } from "./settings.action"; -import { SettingsContext } from "./settings.loader"; +import { UpdateSettingsAction } from "./ShortProcedureSettingsPage.action"; +import { SettingsContext } from "./ShortProcedureSettingsPage.loader"; interface ShortProcedureSetting { zaaktype: string; @@ -14,9 +13,9 @@ interface ShortProcedureSetting { } /** - * Settings page + * Allows for configuring zaaktype eligible for the short procedure. */ -export function SettingsPage() { +export function ShortProcedureSettingsPage() { const { zaaktypesShortProcess, zaaktypeChoices } = useLoaderData() as SettingsContext; const submitAction = useSubmitAction(); diff --git a/frontend/src/pages/settings/index.ts b/frontend/src/pages/settings/index.ts index 59c8b99c..7a2cf6e0 100644 --- a/frontend/src/pages/settings/index.ts +++ b/frontend/src/pages/settings/index.ts @@ -1,3 +1,3 @@ -export * from "./Settings"; -export * from "./settings.action"; -export * from "./settings.loader"; +export * from "./ShortProcedureSettingsPage"; +export * from "./ShortProcedureSettingsPage.action"; +export * from "./ShortProcedureSettingsPage.loader"; From 641d2b782e03c21a01fb340218ac891e927968bd Mon Sep 17 00:00:00 2001 From: Sven van de Scheur Date: Fri, 10 Jan 2025 10:15:08 +0100 Subject: [PATCH 03/17] :children_crossing: #553 - style: improve short procedure settings page styling --- .../settings/ShortProcedureSettingsPage.tsx | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/settings/ShortProcedureSettingsPage.tsx b/frontend/src/pages/settings/ShortProcedureSettingsPage.tsx index a6f91d62..43c369d7 100644 --- a/frontend/src/pages/settings/ShortProcedureSettingsPage.tsx +++ b/frontend/src/pages/settings/ShortProcedureSettingsPage.tsx @@ -1,4 +1,11 @@ -import { Body, H2, ListTemplate, Solid, useAlert } from "@maykin-ui/admin-ui"; +import { + Body, + H2, + ListTemplate, + P, + Solid, + useAlert, +} from "@maykin-ui/admin-ui"; import { useCallback, useMemo, useState } from "react"; import { useLoaderData } from "react-router-dom"; @@ -108,13 +115,17 @@ export function ShortProcedureSettingsPage() { ), pad: "h", + variant: "primary", onClick: handleSave, }, ]} dataGridProps={{ boolProps: { explicit: true }, objectList, - fields: [{ name: "zaaktype", type: "string" }], + fields: [ + { name: "zaaktype", type: "string" }, + { name: "verkorteProcedure", type: "boolean", filterable: false }, + ], selectable: true, allowSelectAll: false, selected: selectedItems, @@ -126,7 +137,10 @@ export function ShortProcedureSettingsPage() { }} > -

Instellingen

+

Verkorte procedure

+

+ Selecteer zaaktypen die in aanmerking komen voor de verkorte procedure +

); From 20d8eb5344bbf314eacf9d2cf7e1b225b698a786 Mon Sep 17 00:00:00 2001 From: Sven van de Scheur Date: Fri, 10 Jan 2025 10:24:37 +0100 Subject: [PATCH 04/17] :recycle: #553 - refactor: make settings page a nested route --- frontend/src/index.tsx | 13 ++++++++++--- frontend/src/pages/settings/Settings.tsx | 19 +++++++++++++++++++ frontend/src/pages/settings/index.ts | 4 +--- .../ShortProcedureSettingsPage.action.ts | 4 ++-- .../ShortProcedureSettingsPage.loader.ts | 6 +++--- .../ShortProcedureSettingsPage.stories.tsx | 4 ++-- .../ShortProcedureSettingsPage.tsx | 2 +- .../pages/settings/short-procedure/index.ts | 3 +++ 8 files changed, 41 insertions(+), 14 deletions(-) create mode 100644 frontend/src/pages/settings/Settings.tsx rename frontend/src/pages/settings/{ => short-procedure}/ShortProcedureSettingsPage.action.ts (91%) rename frontend/src/pages/settings/{ => short-procedure}/ShortProcedureSettingsPage.loader.ts (83%) rename frontend/src/pages/settings/{ => short-procedure}/ShortProcedureSettingsPage.stories.tsx (83%) rename frontend/src/pages/settings/{ => short-procedure}/ShortProcedureSettingsPage.tsx (98%) create mode 100644 frontend/src/pages/settings/short-procedure/index.ts diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index 5fff0523..cd30a15c 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -32,6 +32,7 @@ import { shortProcedureSettingsPageAction, shortProcedureSettingsPageLoader, } from "./pages"; +import { SettingsPage } from "./pages/settings/Settings"; const router = createBrowserRouter([ { @@ -148,9 +149,15 @@ const router = createBrowserRouter([ }, { path: "/settings", - element: , - loader: shortProcedureSettingsPageLoader, - action: shortProcedureSettingsPageAction, + element: , + children: [ + { + path: "short-procedure", + element: , + loader: shortProcedureSettingsPageLoader, + action: shortProcedureSettingsPageAction, + }, + ], }, { path: "/login", diff --git a/frontend/src/pages/settings/Settings.tsx b/frontend/src/pages/settings/Settings.tsx new file mode 100644 index 00000000..0036edd3 --- /dev/null +++ b/frontend/src/pages/settings/Settings.tsx @@ -0,0 +1,19 @@ +import { useEffect } from "react"; +import { Outlet, useNavigate, useOutlet } from "react-router-dom"; + +/** + * Destruction list detail page + */ +export function SettingsPage() { + const navigate = useNavigate(); + const outlet = useOutlet(); + + // Redirect + useEffect(() => { + if (!outlet) { + navigate("short-procedure"); + } + }, [outlet]); + + return ; +} diff --git a/frontend/src/pages/settings/index.ts b/frontend/src/pages/settings/index.ts index 7a2cf6e0..fe18c1e6 100644 --- a/frontend/src/pages/settings/index.ts +++ b/frontend/src/pages/settings/index.ts @@ -1,3 +1 @@ -export * from "./ShortProcedureSettingsPage"; -export * from "./ShortProcedureSettingsPage.action"; -export * from "./ShortProcedureSettingsPage.loader"; +export * from "./short-procedure"; diff --git a/frontend/src/pages/settings/ShortProcedureSettingsPage.action.ts b/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.action.ts similarity index 91% rename from frontend/src/pages/settings/ShortProcedureSettingsPage.action.ts rename to frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.action.ts index 74d8261e..4016992d 100644 --- a/frontend/src/pages/settings/ShortProcedureSettingsPage.action.ts +++ b/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.action.ts @@ -1,10 +1,10 @@ import { ActionFunctionArgs } from "react-router-dom"; -import { JsonValue, TypedAction } from "../../hooks"; +import { JsonValue, TypedAction } from "../../../hooks"; import { ArchiveConfiguration, patchArchiveConfiguration, -} from "../../lib/api/config"; +} from "../../../lib/api/config"; export type UpdateSettingsAction = TypedAction< "PATCH-ARCHIVE-CONFIG", diff --git a/frontend/src/pages/settings/ShortProcedureSettingsPage.loader.ts b/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.loader.ts similarity index 83% rename from frontend/src/pages/settings/ShortProcedureSettingsPage.loader.ts rename to frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.loader.ts index 9c575f62..834fa86d 100644 --- a/frontend/src/pages/settings/ShortProcedureSettingsPage.loader.ts +++ b/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.loader.ts @@ -1,12 +1,12 @@ import { ArchiveConfiguration, getArchiveConfiguration, -} from "../../lib/api/config"; -import { ZaaktypeChoice, listZaaktypeChoices } from "../../lib/api/private"; +} from "../../../lib/api/config"; +import { ZaaktypeChoice, listZaaktypeChoices } from "../../../lib/api/private"; import { canViewAndEditSettingsRequired, loginRequired, -} from "../../lib/auth/loaders"; +} from "../../../lib/auth/loaders"; export type SettingsContext = { zaaktypesShortProcess: ArchiveConfiguration["zaaktypesShortProcess"]; diff --git a/frontend/src/pages/settings/ShortProcedureSettingsPage.stories.tsx b/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.stories.tsx similarity index 83% rename from frontend/src/pages/settings/ShortProcedureSettingsPage.stories.tsx rename to frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.stories.tsx index bb21406d..f42602b3 100644 --- a/frontend/src/pages/settings/ShortProcedureSettingsPage.stories.tsx +++ b/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react"; -import { ReactRouterDecorator } from "../../../.storybook/decorators"; -import { assertCheckboxSelection } from "../../../.storybook/playFunctions"; +import { ReactRouterDecorator } from "../../../../.storybook/decorators"; +import { assertCheckboxSelection } from "../../../../.storybook/playFunctions"; import { ShortProcedureSettingsPage } from "./ShortProcedureSettingsPage"; const meta: Meta = { diff --git a/frontend/src/pages/settings/ShortProcedureSettingsPage.tsx b/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.tsx similarity index 98% rename from frontend/src/pages/settings/ShortProcedureSettingsPage.tsx rename to frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.tsx index 43c369d7..ea0962a4 100644 --- a/frontend/src/pages/settings/ShortProcedureSettingsPage.tsx +++ b/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.tsx @@ -9,7 +9,7 @@ import { import { useCallback, useMemo, useState } from "react"; import { useLoaderData } from "react-router-dom"; -import { useSubmitAction } from "../../hooks"; +import { useSubmitAction } from "../../../hooks"; import { UpdateSettingsAction } from "./ShortProcedureSettingsPage.action"; import { SettingsContext } from "./ShortProcedureSettingsPage.loader"; diff --git a/frontend/src/pages/settings/short-procedure/index.ts b/frontend/src/pages/settings/short-procedure/index.ts new file mode 100644 index 00000000..7a2cf6e0 --- /dev/null +++ b/frontend/src/pages/settings/short-procedure/index.ts @@ -0,0 +1,3 @@ +export * from "./ShortProcedureSettingsPage"; +export * from "./ShortProcedureSettingsPage.action"; +export * from "./ShortProcedureSettingsPage.loader"; From 8b455b650f94c0b9f70183c4b5adf8857b40ab4d Mon Sep 17 00:00:00 2001 From: Sven van de Scheur Date: Fri, 10 Jan 2025 10:39:14 +0100 Subject: [PATCH 05/17] :recycle: #553 - refactor: add BaseSettingsView --- .../settings/abstract/BaseSettingsView.tsx | 25 +++++++++++++++++++ .../ShortProcedureSettingsPage.tsx | 14 +++-------- 2 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 frontend/src/pages/settings/abstract/BaseSettingsView.tsx diff --git a/frontend/src/pages/settings/abstract/BaseSettingsView.tsx b/frontend/src/pages/settings/abstract/BaseSettingsView.tsx new file mode 100644 index 00000000..770d0bab --- /dev/null +++ b/frontend/src/pages/settings/abstract/BaseSettingsView.tsx @@ -0,0 +1,25 @@ +import { DataGridProps, ListTemplate, ToolbarItem } from "@maykin-ui/admin-ui"; +import React from "react"; + +export type BaseSettingsPageProps = React.PropsWithChildren<{ + dataGridProps: DataGridProps; + secondaryNavigationItems: ToolbarItem[]; +}>; + +/** + * Base view for settings pages. + */ +export function BaseSettingsView({ + children, + dataGridProps, + secondaryNavigationItems, +}: BaseSettingsPageProps) { + return ( + + secondaryNavigationItems={secondaryNavigationItems} + dataGridProps={dataGridProps} + > + {children} + + ); +} diff --git a/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.tsx b/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.tsx index ea0962a4..aab53581 100644 --- a/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.tsx +++ b/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.tsx @@ -1,15 +1,9 @@ -import { - Body, - H2, - ListTemplate, - P, - Solid, - useAlert, -} from "@maykin-ui/admin-ui"; +import { Body, H2, P, Solid, useAlert } from "@maykin-ui/admin-ui"; import { useCallback, useMemo, useState } from "react"; import { useLoaderData } from "react-router-dom"; import { useSubmitAction } from "../../../hooks"; +import { BaseSettingsView } from "../abstract/BaseSettingsView"; import { UpdateSettingsAction } from "./ShortProcedureSettingsPage.action"; import { SettingsContext } from "./ShortProcedureSettingsPage.loader"; @@ -105,7 +99,7 @@ export function ShortProcedureSettingsPage() { ); return ( - + secondaryNavigationItems={[ { children: ( @@ -142,6 +136,6 @@ export function ShortProcedureSettingsPage() { Selecteer zaaktypen die in aanmerking komen voor de verkorte procedure

- + ); } From 0e89173abcc332500e8d8b9207aa26e4db1d2108 Mon Sep 17 00:00:00 2001 From: Sven van de Scheur Date: Fri, 10 Jan 2025 10:46:06 +0100 Subject: [PATCH 06/17] :sparkles: #553 - feat: add sidebar to BaseSettingsView --- .../pages/settings/abstract/BaseSettingsView.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frontend/src/pages/settings/abstract/BaseSettingsView.tsx b/frontend/src/pages/settings/abstract/BaseSettingsView.tsx index 770d0bab..3d4a34e1 100644 --- a/frontend/src/pages/settings/abstract/BaseSettingsView.tsx +++ b/frontend/src/pages/settings/abstract/BaseSettingsView.tsx @@ -1,5 +1,6 @@ import { DataGridProps, ListTemplate, ToolbarItem } from "@maykin-ui/admin-ui"; import React from "react"; +import { useMatches, useNavigate } from "react-router-dom"; export type BaseSettingsPageProps = React.PropsWithChildren<{ dataGridProps: DataGridProps; @@ -14,9 +15,21 @@ export function BaseSettingsView({ dataGridProps, secondaryNavigationItems, }: BaseSettingsPageProps) { + const navigate = useNavigate(); + const currentMatch = [...useMatches()].pop(); // Explicit clone. + const currentPathName = currentMatch?.pathname; + return ( secondaryNavigationItems={secondaryNavigationItems} + sidebarItems={[ + { + children: "Verkorte procedure", + align: "start", + onClick: () => navigate("/settings/short-procedure"), + active: currentPathName === "/settings/short-procedure", + }, + ]} dataGridProps={dataGridProps} > {children} From bdab0f8d37b6e26e950c8bf46771a3370bdd9e39 Mon Sep 17 00:00:00 2001 From: Sven van de Scheur Date: Fri, 10 Jan 2025 11:21:14 +0100 Subject: [PATCH 07/17] :sparkles: #553 - feat: add destruction report settings page route --- frontend/src/index.tsx | 8 ++++++ .../settings/abstract/BaseSettingsView.tsx | 6 ++++ .../DestructionReportSettingsPage.loader.ts | 9 ++++++ .../DestructionReportSettingsPage.stories.tsx | 13 +++++++++ .../DestructionReportSettingsPage.tsx | 25 +++++++++++++++++ .../settings/destruction-report/index.ts | 2 ++ frontend/src/pages/settings/index.ts | 1 + .../ShortProcedureSettingsPage.loader.ts | 28 ++++++++++--------- .../ShortProcedureSettingsPage.tsx | 4 +-- 9 files changed, 81 insertions(+), 15 deletions(-) create mode 100644 frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.loader.ts create mode 100644 frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.stories.tsx create mode 100644 frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.tsx create mode 100644 frontend/src/pages/settings/destruction-report/index.ts diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index cd30a15c..46b9031d 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -17,6 +17,7 @@ import { DestructionListEditPage, DestructionListProcessReviewPage, DestructionListReviewPage, + DestructionReportSettingsPage, Landing, LoginPage, ShortProcedureSettingsPage, @@ -26,6 +27,7 @@ import { destructionListReviewAction, destructionListReviewLoader, destructionListUpdateAction, + destructionReportSettingsPageLoader, landingLoader, loginAction, logoutLoader, @@ -157,6 +159,12 @@ const router = createBrowserRouter([ loader: shortProcedureSettingsPageLoader, action: shortProcedureSettingsPageAction, }, + { + path: "destruction-report", + element: , + loader: destructionReportSettingsPageLoader, + action: shortProcedureSettingsPageAction, + }, ], }, { diff --git a/frontend/src/pages/settings/abstract/BaseSettingsView.tsx b/frontend/src/pages/settings/abstract/BaseSettingsView.tsx index 3d4a34e1..514e37fd 100644 --- a/frontend/src/pages/settings/abstract/BaseSettingsView.tsx +++ b/frontend/src/pages/settings/abstract/BaseSettingsView.tsx @@ -29,6 +29,12 @@ export function BaseSettingsView({ onClick: () => navigate("/settings/short-procedure"), active: currentPathName === "/settings/short-procedure", }, + { + children: "Vernietigingsrapport", + align: "start", + onClick: () => navigate("/settings/destruction-report"), + active: currentPathName === "/settings/destruction-report", + }, ]} dataGridProps={dataGridProps} > diff --git a/frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.loader.ts b/frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.loader.ts new file mode 100644 index 00000000..ee328b3f --- /dev/null +++ b/frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.loader.ts @@ -0,0 +1,9 @@ +import { loginRequired } from "../../../lib/auth/loaders"; + +export type DestructionReportSettingsPageContext = object; + +export const destructionReportSettingsPageLoader = loginRequired( + async (): Promise => { + return {}; + }, +); diff --git a/frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.stories.tsx b/frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.stories.tsx new file mode 100644 index 00000000..79e87943 --- /dev/null +++ b/frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.stories.tsx @@ -0,0 +1,13 @@ +import type { Meta, StoryObj } from "@storybook/react"; + +import { DestructionReportSettingsPage } from "./DestructionReportSettingsPage"; + +const meta: Meta = { + title: "Pages/Settings", + component: DestructionReportSettingsPage, +}; + +export default meta; +type Story = StoryObj; + +export const SettingsPageStory: Story = {}; diff --git a/frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.tsx b/frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.tsx new file mode 100644 index 00000000..afa8b3c4 --- /dev/null +++ b/frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.tsx @@ -0,0 +1,25 @@ +import { useMemo } from "react"; + +import { BaseSettingsView } from "../abstract/BaseSettingsView"; + +interface DestructionReportSetting { + zaaktype: string; + value: string | number; + verkorteProcedure: boolean; +} + +/** + * Allows for configuring zaaktype eligible for the short procedure. + */ +export function DestructionReportSettingsPage() { + const objectList = useMemo(() => [], []); + + return ( + + secondaryNavigationItems={[]} + dataGridProps={{ + objectList, + }} + > + ); +} diff --git a/frontend/src/pages/settings/destruction-report/index.ts b/frontend/src/pages/settings/destruction-report/index.ts new file mode 100644 index 00000000..0529a759 --- /dev/null +++ b/frontend/src/pages/settings/destruction-report/index.ts @@ -0,0 +1,2 @@ +export * from "./DestructionReportSettingsPage"; +export * from "./DestructionReportSettingsPage.loader"; diff --git a/frontend/src/pages/settings/index.ts b/frontend/src/pages/settings/index.ts index fe18c1e6..7b33a0bd 100644 --- a/frontend/src/pages/settings/index.ts +++ b/frontend/src/pages/settings/index.ts @@ -1 +1,2 @@ +export * from "./destruction-report"; export * from "./short-procedure"; diff --git a/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.loader.ts b/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.loader.ts index 834fa86d..6b47cacf 100644 --- a/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.loader.ts +++ b/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.loader.ts @@ -8,24 +8,26 @@ import { loginRequired, } from "../../../lib/auth/loaders"; -export type SettingsContext = { +export type ShortProcedureSettingsPageContext = { zaaktypesShortProcess: ArchiveConfiguration["zaaktypesShortProcess"]; zaaktypeChoices: ZaaktypeChoice[]; }; export const shortProcedureSettingsPageLoader = loginRequired( - canViewAndEditSettingsRequired(async (): Promise => { - const archiveConfigPromise = getArchiveConfiguration(); - const zaaktypeChoicesPromise = listZaaktypeChoices(); + canViewAndEditSettingsRequired( + async (): Promise => { + const archiveConfigPromise = getArchiveConfiguration(); + const zaaktypeChoicesPromise = listZaaktypeChoices(); - const [archiveConfig, zaaktypeChoices] = await Promise.all([ - archiveConfigPromise, - zaaktypeChoicesPromise, - ]); + const [archiveConfig, zaaktypeChoices] = await Promise.all([ + archiveConfigPromise, + zaaktypeChoicesPromise, + ]); - return { - zaaktypesShortProcess: archiveConfig.zaaktypesShortProcess, - zaaktypeChoices, - }; - }), + return { + zaaktypesShortProcess: archiveConfig.zaaktypesShortProcess, + zaaktypeChoices, + }; + }, + ), ); diff --git a/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.tsx b/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.tsx index aab53581..0acbcb3f 100644 --- a/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.tsx +++ b/frontend/src/pages/settings/short-procedure/ShortProcedureSettingsPage.tsx @@ -5,7 +5,7 @@ import { useLoaderData } from "react-router-dom"; import { useSubmitAction } from "../../../hooks"; import { BaseSettingsView } from "../abstract/BaseSettingsView"; import { UpdateSettingsAction } from "./ShortProcedureSettingsPage.action"; -import { SettingsContext } from "./ShortProcedureSettingsPage.loader"; +import { ShortProcedureSettingsPageContext } from "./ShortProcedureSettingsPage.loader"; interface ShortProcedureSetting { zaaktype: string; @@ -18,7 +18,7 @@ interface ShortProcedureSetting { */ export function ShortProcedureSettingsPage() { const { zaaktypesShortProcess, zaaktypeChoices } = - useLoaderData() as SettingsContext; + useLoaderData() as ShortProcedureSettingsPageContext; const submitAction = useSubmitAction(); const alert = useAlert(); From 344b296535616545ec167b56a96d935b9dd4c745 Mon Sep 17 00:00:00 2001 From: Sven van de Scheur Date: Fri, 10 Jan 2025 15:49:02 +0100 Subject: [PATCH 08/17] :sparkles: #553 - feat: implement destruction report settings page --- frontend/.storybook/mockData.ts | 12 +- frontend/.storybook/playFunctions.ts | 6 +- frontend/src/fixtures/index.ts | 17 ++ .../fixtures/informatieObjectTypeChoices.ts | 64 ++++++++ frontend/src/fixtures/resultaatTypeChoices.ts | 64 ++++++++ frontend/src/fixtures/statusTypeChoices.ts | 64 ++++++++ ...{zaaktypeChoices.ts => zaakTypeChoices.ts} | 11 +- frontend/src/index.tsx | 6 +- frontend/src/lib/api/config.ts | 39 +++++ frontend/src/lib/api/private.ts | 53 ++++++- ...tingsPage.action.ts => Settings.action.ts} | 9 +- .../settings/abstract/BaseSettingsView.tsx | 58 ++++--- .../DestructionReportSettingsPage.loader.ts | 9 -- .../DestructionReportSettingsPage.stories.tsx | 13 -- .../DestructionReportSettingsPage.tsx | 25 --- frontend/src/pages/settings/index.ts | 4 +- .../DestructionReportSettingsPage.loader.ts | 58 +++++++ .../DestructionReportSettingsPage.stories.tsx | 68 ++++++++ .../DestructionReportSettingsPage.tsx | 149 ++++++++++++++++++ .../{ => pages}/destruction-report/index.ts | 0 frontend/src/pages/settings/pages/index.ts | 2 + .../ShortProcedureSettingsPage.loader.ts | 9 +- .../ShortProcedureSettingsPage.stories.tsx | 6 +- .../ShortProcedureSettingsPage.tsx | 9 +- .../{ => pages}/short-procedure/index.ts | 1 - 25 files changed, 655 insertions(+), 101 deletions(-) create mode 100644 frontend/src/fixtures/index.ts create mode 100644 frontend/src/fixtures/informatieObjectTypeChoices.ts create mode 100644 frontend/src/fixtures/resultaatTypeChoices.ts create mode 100644 frontend/src/fixtures/statusTypeChoices.ts rename frontend/src/fixtures/{zaaktypeChoices.ts => zaakTypeChoices.ts} (84%) rename frontend/src/pages/settings/{short-procedure/ShortProcedureSettingsPage.action.ts => Settings.action.ts} (82%) delete mode 100644 frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.loader.ts delete mode 100644 frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.stories.tsx delete mode 100644 frontend/src/pages/settings/destruction-report/DestructionReportSettingsPage.tsx create mode 100644 frontend/src/pages/settings/pages/destruction-report/DestructionReportSettingsPage.loader.ts create mode 100644 frontend/src/pages/settings/pages/destruction-report/DestructionReportSettingsPage.stories.tsx create mode 100644 frontend/src/pages/settings/pages/destruction-report/DestructionReportSettingsPage.tsx rename frontend/src/pages/settings/{ => pages}/destruction-report/index.ts (100%) create mode 100644 frontend/src/pages/settings/pages/index.ts rename frontend/src/pages/settings/{ => pages}/short-procedure/ShortProcedureSettingsPage.loader.ts (83%) rename frontend/src/pages/settings/{ => pages}/short-procedure/ShortProcedureSettingsPage.stories.tsx (77%) rename frontend/src/pages/settings/{ => pages}/short-procedure/ShortProcedureSettingsPage.tsx (94%) rename frontend/src/pages/settings/{ => pages}/short-procedure/index.ts (65%) diff --git a/frontend/.storybook/mockData.ts b/frontend/.storybook/mockData.ts index 3fcae104..6da5d5eb 100644 --- a/frontend/.storybook/mockData.ts +++ b/frontend/.storybook/mockData.ts @@ -1,17 +1,15 @@ -import { auditLogFactory } from "../src/fixtures/auditLog"; -import { coReviewsFactory } from "../src/fixtures/coReview"; import { FIXTURE_DESTRUCTION_LIST, + FIXTURE_SELECTIELIJSTKLASSE_CHOICES, + auditLogFactory, + coReviewsFactory, destructionListAssigneesFactory, destructionListFactory, -} from "../src/fixtures/destructionList"; -import { FIXTURE_SELECTIELIJSTKLASSE_CHOICES } from "../src/fixtures/selectieLijstKlasseChoices"; -import { recordManagerFactory, userFactory, usersFactory, -} from "../src/fixtures/user"; -import { zaaktypeChoicesFactory } from "../src/fixtures/zaaktypeChoices"; + zaaktypeChoicesFactory, +} from "../src/fixtures"; export const MOCKS = { // READS diff --git a/frontend/.storybook/playFunctions.ts b/frontend/.storybook/playFunctions.ts index 1bde8713..9103c466 100644 --- a/frontend/.storybook/playFunctions.ts +++ b/frontend/.storybook/playFunctions.ts @@ -218,8 +218,9 @@ export const fillForm: PlayFunction = async (context) => { const canvas = within(context.canvasElement); const { - form = (await canvas.queryByRole("form")) || - (await canvas.findByRole("dialog")), // Fixme + form = await canvas + .findByRole("form") + .catch(async () => await canvas.findByRole("dialog")), // FIXME formValues = {}, submitForm = true, } = context.parameters.fillForm as FillFormParameters; @@ -251,6 +252,7 @@ export const fillForm: PlayFunction = async (context) => { await userEvent.click(option, { delay: 100 }); } else { const input = field as HTMLInputElement; + await userEvent.clear(input); await userEvent.type(input, value, { delay: 10, skipClick: false }); } } diff --git a/frontend/src/fixtures/index.ts b/frontend/src/fixtures/index.ts new file mode 100644 index 00000000..b9e20097 --- /dev/null +++ b/frontend/src/fixtures/index.ts @@ -0,0 +1,17 @@ +export * from "./auditLog"; +export * from "./coReview"; +export * from "./destructionList"; +export * from "./destructionListItem"; +export * from "./factory"; +export * from "./informatieObjectTypeChoices"; +export * from "./paginatedZaken"; +export * from "./response"; +export * from "./resultaatTypeChoices"; +export * from "./review"; +export * from "./reviewItem"; +export * from "./reviewers"; +export * from "./selectieLijstKlasseChoices"; +export * from "./statusTypeChoices"; +export * from "./user"; +export * from "./zaak"; +export * from "./zaakTypeChoices"; diff --git a/frontend/src/fixtures/informatieObjectTypeChoices.ts b/frontend/src/fixtures/informatieObjectTypeChoices.ts new file mode 100644 index 00000000..65c40c7a --- /dev/null +++ b/frontend/src/fixtures/informatieObjectTypeChoices.ts @@ -0,0 +1,64 @@ +import { Option } from "@maykin-ui/admin-ui"; + +import { createArrayFactory, createObjectFactory } from "./factory"; + +export const FIXTURE_INFORMATIE_OBJECTTYPE_CHOICES = [ + { + label: "Informatie object type 1", + value: + "http://zaken.nl/catalogi/api/v1/informatieobjecttypen/b0b28783-052d-414a-867d-81cf52725506", + }, + { + label: "Informatie object type 2", + value: + "http://zaken.nl/catalogi/api/v1/informatieobjecttypen/3007e984-c529-4a07-b32e-555b4c882ce5", + }, + { + label: "Informatie object type 3", + value: + "http://zaken.nl/catalogi/api/v1/informatieobjecttypen/b25201a6-2d1e-42ca-bff6-417ce5b4cb4a", + }, + { + label: "Informatie object type 4", + value: + "http://zaken.nl/catalogi/api/v1/informatieobjecttypen/4ff5a190-8dc8-4ee7-b018-92ae90f564bf", + }, + { + label: "Informatie object type 5", + value: + "http://zaken.nl/catalogi/api/v1/informatieobjecttypen/d2dc7b42-a3d6-42b8-90c5-d54342c02357", + }, + { + label: "Informatie object type 6", + value: + "http://zaken.nl/catalogi/api/v1/informatieobjecttypen/c91c1e80-78e9-417a-b828-4f5dbcfd12a7", + }, + { + label: "Informatie object type 7", + value: + "http://zaken.nl/catalogi/api/v1/informatieobjecttypen/5cff5507-bf01-4d02-9a60-292b254974f6", + }, + { + label: "Informatie object type 8", + value: + "http://zaken.nl/catalogi/api/v1/informatieobjecttypen/4616eb79-112f-4575-bd3a-2faa5fef31ab", + }, + { + label: "Informatie object type 9", + value: + "http://zaken.nl/catalogi/api/v1/informatieobjecttypen/bece20a5-8e01-4bc5-9ba0-7c853cff46a0", + }, + { + label: "Informatie object type 10", + value: + "http://zaken.nl/catalogi/api/v1/informatieobjecttypen/09428c24-12e5-4c3a-a75c-e9e0d448a93b", + }, +]; + +export const informatieObjectTypeChoiceFactory = createObjectFactory< + Option +>(FIXTURE_INFORMATIE_OBJECTTYPE_CHOICES[0]); + +export const informatieObjectTypeChoicesFactory = createArrayFactory< + Option +>(FIXTURE_INFORMATIE_OBJECTTYPE_CHOICES); diff --git a/frontend/src/fixtures/resultaatTypeChoices.ts b/frontend/src/fixtures/resultaatTypeChoices.ts new file mode 100644 index 00000000..0136b069 --- /dev/null +++ b/frontend/src/fixtures/resultaatTypeChoices.ts @@ -0,0 +1,64 @@ +import { Option } from "@maykin-ui/admin-ui"; + +import { createArrayFactory, createObjectFactory } from "./factory"; + +export const FIXTURE_RESULTAATTYPE_CHOICES = [ + { + label: "resultaattype 1", + value: + "http://zaken.nl/catalogi/api/v1/resultaattypen/73c8a575-c75c-4c97-ba1f-42c3180ced04", + }, + { + label: "resultaattype 2", + value: + "http://zaken.nl/catalogi/api/v1/resultaattypen/2af00ef7-d865-4166-9efc-19ab95fed618", + }, + { + label: "resultaattype 3", + value: + "http://zaken.nl/catalogi/api/v1/resultaattypen/6436c0b9-156a-4e71-8aab-0e03cca85cc6", + }, + { + label: "resultaattype 4", + value: + "http://zaken.nl/catalogi/api/v1/resultaattypen/ecf89355-866d-4d26-983d-48b9d3883441", + }, + { + label: "resultaattype 5", + value: + "http://zaken.nl/catalogi/api/v1/resultaattypen/95ffea1c-0e11-4484-9352-cc60bf8c0ae1", + }, + { + label: "resultaattype 6", + value: + "http://zaken.nl/catalogi/api/v1/resultaattypen/ee3f3076-c818-4176-ba5f-8e1a02cd5eaf", + }, + { + label: "resultaattype 7", + value: + "http://zaken.nl/catalogi/api/v1/resultaattypen/36367e96-bfb0-4765-a4ef-735da326a9fc", + }, + { + label: "resultaattype 8", + value: + "http://zaken.nl/catalogi/api/v1/resultaattypen/1a810166-a7cd-421d-b3b8-52e59d6b5957", + }, + { + label: "resultaattype 9", + value: + "http://zaken.nl/catalogi/api/v1/resultaattypen/1ac42262-dbb8-49bd-a059-3e54752bdb74", + }, + { + label: "resultaattype 10", + value: + "http://zaken.nl/catalogi/api/v1/resultaattypen/4d453f16-04e7-4832-9e90-e59fda7e198d", + }, +]; + +export const resultaatTypeChoiceFactory = createObjectFactory< + Option +>(FIXTURE_RESULTAATTYPE_CHOICES[0]); + +export const resultaatTypeChoicesFactory = createArrayFactory< + Option +>(FIXTURE_RESULTAATTYPE_CHOICES); diff --git a/frontend/src/fixtures/statusTypeChoices.ts b/frontend/src/fixtures/statusTypeChoices.ts new file mode 100644 index 00000000..64db54df --- /dev/null +++ b/frontend/src/fixtures/statusTypeChoices.ts @@ -0,0 +1,64 @@ +import { Option } from "@maykin-ui/admin-ui"; + +import { createArrayFactory, createObjectFactory } from "./factory"; + +export const FIXTURE_STATUSTYPE_CHOICES = [ + { + label: "Statustype 1", + value: + "http://zaken.nl/catalogi/api/v1/statustypen/feedf256-ef74-4d5f-8fc9-6891f58a0d1e", + }, + { + label: "Statustype 2", + value: + "http://zaken.nl/catalogi/api/v1/statustypen/0b016f1a-e10a-4dad-9090-c06bac6ef7e7", + }, + { + label: "Statustype 3", + value: + "http://zaken.nl/catalogi/api/v1/statustypen/155d0b58-c97d-4451-ab0c-a1fdbe65317c", + }, + { + label: "Statustype 4", + value: + "http://zaken.nl/catalogi/api/v1/statustypen/2621072e-3d25-49fa-8e4c-e0797b1bebe9", + }, + { + label: "Statustype 5", + value: + "http://zaken.nl/catalogi/api/v1/statustypen/e8f32e98-802b-4370-9f6b-dffbec588bb8", + }, + { + label: "Statustype 6", + value: + "http://zaken.nl/catalogi/api/v1/statustypen/86f5402e-1b5b-4470-9d95-ed2f798deb03", + }, + { + label: "Statustype 7", + value: + "http://zaken.nl/catalogi/api/v1/statustypen/6c875571-6ef1-4307-a1b6-c5a455fe647a", + }, + { + label: "Statustype 8", + value: + "http://zaken.nl/catalogi/api/v1/statustypen/a318ed24-80ad-4da0-b95f-69913aef994f", + }, + { + label: "Statustype 9", + value: + "http://zaken.nl/catalogi/api/v1/statustypen/56df165f-c657-44b1-a498-ea440e749b05", + }, + { + label: "Statustype 10", + value: + "http://zaken.nl/catalogi/api/v1/statustypen/03003779-800e-4951-844d-7478691cfd13", + }, +]; + +export const statusTypeChoiceFactory = createObjectFactory< + Option +>(FIXTURE_STATUSTYPE_CHOICES[0]); + +export const statusTypeChoicesFactory = createArrayFactory< + Option +>(FIXTURE_STATUSTYPE_CHOICES); diff --git a/frontend/src/fixtures/zaaktypeChoices.ts b/frontend/src/fixtures/zaakTypeChoices.ts similarity index 84% rename from frontend/src/fixtures/zaaktypeChoices.ts rename to frontend/src/fixtures/zaakTypeChoices.ts index 2b6d0e59..35f9904f 100644 --- a/frontend/src/fixtures/zaaktypeChoices.ts +++ b/frontend/src/fixtures/zaakTypeChoices.ts @@ -1,5 +1,6 @@ import { Option } from "@maykin-ui/admin-ui"; +import { ZaaktypeChoice } from "../lib/api/private"; import { createArrayFactory } from "./factory"; const FIXTURE_ZAAKTYPE_CHOICE: Option = { @@ -8,36 +9,42 @@ const FIXTURE_ZAAKTYPE_CHOICE: Option = { "http://localhost:8000/catalogi/api/v1/zaaktypen/64c98539-076e-4fbf-8fec-fa86c560fb24", }; -const FIXTURE_ZAAKTYPE_CHOICES: Option[] = [ +const FIXTURE_ZAAKTYPE_CHOICES: ZaaktypeChoice[] = [ { label: "Aangifte behandelen 1", value: "http://localhost:8000/catalogi/api/v1/zaaktypen/64c98539-076e-4fbf-8fec-fa86c560fb24", + extra: "", }, { label: "Aangifte behandelen 2", value: "http://localhost:8000/catalogi/api/v1/zaaktypen/927eb71c-d99b-4c5d-b3e2-94a07ce85923", + extra: "", }, { label: "Aangifte behandelen 3", value: "http://localhost:8000/catalogi/api/v1/zaaktypen/684b9c68-a36f-4c72-b044-fa9cdcb17ec9", + extra: "", }, { label: "Aangifte behandelen 4", value: "http://localhost:8000/catalogi/api/v1/zaaktypen/e4f2a6b0-9377-400a-b0ce-ed66c0a315da", + extra: "", }, { label: "Aangifte behandelen 5", value: "http://localhost:8000/catalogi/api/v1/zaaktypen/3206d651-d0f2-4690-933d-cc690444184f", + extra: "", }, { label: "Aangifte behandelen 6", value: "http://localhost:8000/catalogi/api/v1/zaaktypen/773b6b77-486a-4b6c-be3e-cf13f4387cf3", + extra: "", }, ]; @@ -45,7 +52,7 @@ const zaaktypeChoiceFactory = createArrayFactory