Skip to content

Commit

Permalink
#553 - feat: implement destruction report settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvandescheur committed Jan 10, 2025
1 parent bdab0f8 commit 6755647
Show file tree
Hide file tree
Showing 25 changed files with 655 additions and 101 deletions.
12 changes: 5 additions & 7 deletions frontend/.storybook/mockData.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions frontend/.storybook/playFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,9 @@ export const fillForm: PlayFunction<ReactRenderer> = 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;
Expand Down Expand Up @@ -251,6 +252,7 @@ export const fillForm: PlayFunction<ReactRenderer> = 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 });
}
}
Expand Down
17 changes: 17 additions & 0 deletions frontend/src/fixtures/index.ts
Original file line number Diff line number Diff line change
@@ -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";

Check failure on line 17 in frontend/src/fixtures/index.ts

View workflow job for this annotation

GitHub Actions / Build frontend

Unable to resolve path to module './zaaktypeChoices'
64 changes: 64 additions & 0 deletions frontend/src/fixtures/informatieObjectTypeChoices.ts
Original file line number Diff line number Diff line change
@@ -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<string, string>
>(FIXTURE_INFORMATIE_OBJECTTYPE_CHOICES[0]);

export const informatieObjectTypeChoicesFactory = createArrayFactory<
Option<string, string>
>(FIXTURE_INFORMATIE_OBJECTTYPE_CHOICES);
64 changes: 64 additions & 0 deletions frontend/src/fixtures/resultaatTypeChoices.ts
Original file line number Diff line number Diff line change
@@ -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<string, string>
>(FIXTURE_RESULTAATTYPE_CHOICES[0]);

export const resultaatTypeChoicesFactory = createArrayFactory<
Option<string, string>
>(FIXTURE_RESULTAATTYPE_CHOICES);
64 changes: 64 additions & 0 deletions frontend/src/fixtures/statusTypeChoices.ts
Original file line number Diff line number Diff line change
@@ -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<string, string>
>(FIXTURE_STATUSTYPE_CHOICES[0]);

export const statusTypeChoicesFactory = createArrayFactory<
Option<string, string>
>(FIXTURE_STATUSTYPE_CHOICES);
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -8,44 +9,50 @@ 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: "",
},
];

const zaaktypeChoiceFactory = createArrayFactory<Option>(
FIXTURE_ZAAKTYPE_CHOICES,
);

const zaaktypeChoicesFactory = createArrayFactory<Option>(
const zaaktypeChoicesFactory = createArrayFactory<ZaaktypeChoice>(
FIXTURE_ZAAKTYPE_CHOICES,
);

Expand Down
6 changes: 3 additions & 3 deletions frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
landingLoader,
loginAction,
logoutLoader,
shortProcedureSettingsPageAction,
settingsAction,
shortProcedureSettingsPageLoader,
} from "./pages";
import { SettingsPage } from "./pages/settings/Settings";
Expand Down Expand Up @@ -157,13 +157,13 @@ const router = createBrowserRouter([
path: "short-procedure",
element: <ShortProcedureSettingsPage />,
loader: shortProcedureSettingsPageLoader,
action: shortProcedureSettingsPageAction,
action: settingsAction,
},
{
path: "destruction-report",
element: <DestructionReportSettingsPage />,
loader: destructionReportSettingsPageLoader,
action: shortProcedureSettingsPageAction,
action: settingsAction,
},
],
},
Expand Down
39 changes: 39 additions & 0 deletions frontend/src/lib/api/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,47 @@
import { request } from "./request";

export type ArchiveConfiguration = {
/**
* If a destruction list only contains cases with types present in this
* field, this list will have a shortened review process. This means that no
* archivist will have to approve this list before it is deleted.
*/
zaaktypesShortProcess: string[]; // List of zaaktypes that should use the short process

/** Source organisation RSIN */
bronorganisatie: string;

/**
* The case type URL to use when creating the case for the destruction list
* deletion.
*/
zaaktype: string;

/**
* The status type URL to use when creating the case for the destruction list
* deletion.
*/
statustype: string;

/**
* The result type URL to use when creating the case for the destruction list
* deletion.
*/
resultaattype: string;

/**
* The selectielijstklasse URL to use when creating the case for the
* destruction list deletion.
*/
informatieobjecttype: string;

/**
* The selectielijstklasse URL to use when creating the case for the
* destruction list deletion.
*/
selectielijstklasse: string;
};

/**
* API call to get the archive configuration
* @returns {Promise<ArchiveConfiguration>} The archive configuration
Expand Down
Loading

0 comments on commit 6755647

Please sign in to comment.