From 8fae8dd1f0352c3539bf0281935321d9affe4e46 Mon Sep 17 00:00:00 2001 From: R Ranathunga Date: Wed, 8 Jan 2025 10:25:19 -0800 Subject: [PATCH 1/2] fix: remove unwanted unsaved change modal --- .../ClosePendingRequestModal.tsx | 1 + .../PendingChangeRequest.tsx | 16 +++++++++++++++- .../PendingChangeRequestModal.tsx | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/components/Analyst/PendingChangeRequest/ClosePendingRequestModal.tsx b/app/components/Analyst/PendingChangeRequest/ClosePendingRequestModal.tsx index d5b53549d5..69ceae8f50 100644 --- a/app/components/Analyst/PendingChangeRequest/ClosePendingRequestModal.tsx +++ b/app/components/Analyst/PendingChangeRequest/ClosePendingRequestModal.tsx @@ -56,6 +56,7 @@ const ClosePendingRequestModal: React.FC = ({ schema={pendingChangeRequestCancel} uiSchema={pendingChangeRequestCancelUiSchema} formData={formData} + formContext={{ skipUnsavedWarning: true }} onChange={(e) => setFormData(e.formData)} // Pass children to hide submit button // eslint-disable-next-line react/no-children-prop diff --git a/app/components/Analyst/PendingChangeRequest/PendingChangeRequest.tsx b/app/components/Analyst/PendingChangeRequest/PendingChangeRequest.tsx index d3f33497a8..f9333d4023 100644 --- a/app/components/Analyst/PendingChangeRequest/PendingChangeRequest.tsx +++ b/app/components/Analyst/PendingChangeRequest/PendingChangeRequest.tsx @@ -35,6 +35,7 @@ const PendingChangeRequest = ({ orderBy: CREATED_AT_DESC first: 1 ) { + __id nodes { comment isPending @@ -49,6 +50,7 @@ const PendingChangeRequest = ({ orderBy: CREATED_AT_DESC first: 1 ) { + __id nodes { comment isPending @@ -68,7 +70,7 @@ const PendingChangeRequest = ({ const [isPending, setIsPending] = useState( pendingRequests?.nodes?.[0]?.isPending || false ); - + const connectionId = pendingRequests?.__id; const [comment, setComment] = useState( isPending ? pendingRequests?.nodes?.[0]?.comment : null ); @@ -105,6 +107,18 @@ const PendingChangeRequest = ({ input: input as CreateCbcPendingChangeRequestInput & CreatePendingChangeRequestInput, }, + updater: (store) => { + const payload = store.getRootField( + isCbc ? 'createCbcPendingChangeRequest' : 'createPendingChangeRequest' + ); + const newEdge = payload.getLinkedRecord( + isCbc + ? 'cbcApplicationPendingChangeRequest' + : 'applicationPendingChangeRequest' + ); + const connection = store.get(connectionId); + if (connection) connection.setLinkedRecords([newEdge], 'nodes'); + }, onCompleted: () => { setIsPending(isPendingRequest); setComment(isPendingRequest ? reasonForChange : null); diff --git a/app/components/Analyst/PendingChangeRequest/PendingChangeRequestModal.tsx b/app/components/Analyst/PendingChangeRequest/PendingChangeRequestModal.tsx index a7c8348043..ce26013e71 100644 --- a/app/components/Analyst/PendingChangeRequest/PendingChangeRequestModal.tsx +++ b/app/components/Analyst/PendingChangeRequest/PendingChangeRequestModal.tsx @@ -60,6 +60,7 @@ const PendingChangeRequestModal: React.FC = ({ schema={pendingChangeRequestComment} uiSchema={pendingChangeRequestCommentUiSchema} formData={formData} + formContext={{ skipUnsavedWarning: true }} onChange={(e) => setFormData(e.formData)} disabled={!isHeaderEditable} // Pass children to hide submit button From 5f1216b1c5133f19ac4bfc076f745c39ce0a7632 Mon Sep 17 00:00:00 2001 From: CCBC Service Account <116113628+ccbc-service-account@users.noreply.github.com> Date: Tue, 14 Jan 2025 23:37:55 +0000 Subject: [PATCH 2/2] chore: release v1.223.1 --- CHANGELOG.md | 6 ++++++ db/sqitch.plan | 1 + package.json | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bae8d4ae2..22d7fd3fe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.223.1](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.223.0...v1.223.1) (2025-01-14) + +### Bug Fixes + +- remove unwanted unsaved change modal ([e46153c](https://github.com/bcgov/CONN-CCBC-portal/commit/e46153c01d42261f9d240fb55ce842b340499cb1)) + # [1.223.0](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.222.0...v1.223.0) (2025-01-14) ### Features diff --git a/db/sqitch.plan b/db/sqitch.plan index 0b3b1e40c7..5dbe33fb08 100644 --- a/db/sqitch.plan +++ b/db/sqitch.plan @@ -780,3 +780,4 @@ mutations/create_assessment_form [mutations/create_assessment_form@1.217.0] 2024 @1.221.4 2025-01-06T22:46:18Z CCBC Service Account # release v1.221.4 @1.222.0 2025-01-10T16:34:19Z CCBC Service Account # release v1.222.0 @1.223.0 2025-01-14T21:14:14Z CCBC Service Account # release v1.223.0 +@1.223.1 2025-01-14T23:37:53Z CCBC Service Account # release v1.223.1 diff --git a/package.json b/package.json index b0499ced00..2a57189300 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "CONN-CCBC-portal", - "version": "1.223.0", + "version": "1.223.1", "main": "index.js", "repository": "https://github.com/bcgov/CONN-CCBC-portal.git", "author": "Romer, Meherzad CITZ:EX ",