From c1dbbad553a00d3d44b887ecbd76c3e7543c909b Mon Sep 17 00:00:00 2001 From: SilviaAmAm Date: Fri, 22 Nov 2024 12:23:38 +0100 Subject: [PATCH] :memo: [#498] Document that keys need to remain in sync --- backend/src/openarchiefbeheer/destruction/utils.py | 5 +++++ .../pages/destructionlist/review/DestructionListReview.tsx | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/backend/src/openarchiefbeheer/destruction/utils.py b/backend/src/openarchiefbeheer/destruction/utils.py index 66f6a4e3..cb9101a0 100644 --- a/backend/src/openarchiefbeheer/destruction/utils.py +++ b/backend/src/openarchiefbeheer/destruction/utils.py @@ -262,6 +262,11 @@ def attach_report_to_zaak( def get_selection_key_for_review( destruction_list: "DestructionList", context: str ) -> str: + """ + Warning! This key needs to remain in sync with the key created by the frontend, + since the frontend need to be able to retrieve the pre-populates selection + in the review page. See github issue #498 + """ return f"destruction-list-{context}-{destruction_list.uuid}-{ListStatus.ready_to_review}" diff --git a/frontend/src/pages/destructionlist/review/DestructionListReview.tsx b/frontend/src/pages/destructionlist/review/DestructionListReview.tsx index ae2f80b1..968099f1 100644 --- a/frontend/src/pages/destructionlist/review/DestructionListReview.tsx +++ b/frontend/src/pages/destructionlist/review/DestructionListReview.tsx @@ -32,6 +32,11 @@ import { ReviewDestructionListAction } from "./DestructionListReview.action"; import "./DestructionListReview.css"; import { DestructionListReviewContext } from "./DestructionListReview.loader"; +/** + * Warning! This key needs to remain in sync with the key created by the backend, + * since the backend can pre-populate the selection after a review is processed by + * the record manager. See github issue #498 + */ export const getDestructionListReviewKey = (id: string, status: string) => `destruction-list-review-${id}-${status}`;