From c3b082027ad31f29b86834b0391bda612a18a77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilia=20M=C3=A4kel=C3=A4?= Date: Wed, 12 Jun 2024 10:11:30 +0300 Subject: [PATCH] feat: extend access to handler sidebar notes (#3084) (HL-1343) - Notes can now be added even if the application has been handled - The sidebar is now available in the alteration handling view --- .../handler/public/locales/en/common.json | 2 +- .../handler/public/locales/fi/common.json | 2 +- .../handler/public/locales/sv/common.json | 2 +- .../AlterationHandlingForm.tsx | 33 ++++++++++++++++++- .../HandlingApplicationActions.tsx | 10 +++--- .../HandlingApplicationActionsAhjo.tsx | 10 +++--- .../useHandlingApplicationActions.ts | 6 ++-- .../src/components/sidebar/ChangeList.tsx | 11 +++---- .../src/components/sidebar/Sidebar.tsx | 12 ++++--- .../src/components/sidebar/useSidebar.ts | 5 +-- 10 files changed, 61 insertions(+), 32 deletions(-) diff --git a/frontend/benefit/handler/public/locales/en/common.json b/frontend/benefit/handler/public/locales/en/common.json index 2d2b197721..f588f1c23d 100644 --- a/frontend/benefit/handler/public/locales/en/common.json +++ b/frontend/benefit/handler/public/locales/en/common.json @@ -40,7 +40,7 @@ "note": "" }, "showEveryone": "Nämä viestit näkyvät hakijalle", - "showToHanlderOnly": "Näkyy vain käsittelijöille", + "showToHandlerOnly": "Näkyy vain käsittelijöille", "compose": "Kirjoita viesti", "composeNote": "Kirjoita sisäinen muistiinpano", "send": "Lähetä", diff --git a/frontend/benefit/handler/public/locales/fi/common.json b/frontend/benefit/handler/public/locales/fi/common.json index daefb765d6..bb03c3f6fe 100644 --- a/frontend/benefit/handler/public/locales/fi/common.json +++ b/frontend/benefit/handler/public/locales/fi/common.json @@ -40,7 +40,7 @@ "note": "" }, "showEveryone": "Nämä viestit näkyvät hakijalle", - "showToHanlderOnly": "Näkyy vain käsittelijöille", + "showToHandlerOnly": "Näkyy vain käsittelijöille", "compose": "Kirjoita viesti", "composeNote": "Kirjoita sisäinen muistiinpano", "send": "Lähetä", diff --git a/frontend/benefit/handler/public/locales/sv/common.json b/frontend/benefit/handler/public/locales/sv/common.json index 2d2b197721..f588f1c23d 100644 --- a/frontend/benefit/handler/public/locales/sv/common.json +++ b/frontend/benefit/handler/public/locales/sv/common.json @@ -40,7 +40,7 @@ "note": "" }, "showEveryone": "Nämä viestit näkyvät hakijalle", - "showToHanlderOnly": "Näkyy vain käsittelijöille", + "showToHandlerOnly": "Näkyy vain käsittelijöille", "compose": "Kirjoita viesti", "composeNote": "Kirjoita sisäinen muistiinpano", "send": "Lähetä", diff --git a/frontend/benefit/handler/src/components/alterationHandling/AlterationHandlingForm.tsx b/frontend/benefit/handler/src/components/alterationHandling/AlterationHandlingForm.tsx index e9c0a27e21..6a1f8c382c 100644 --- a/frontend/benefit/handler/src/components/alterationHandling/AlterationHandlingForm.tsx +++ b/frontend/benefit/handler/src/components/alterationHandling/AlterationHandlingForm.tsx @@ -12,7 +12,11 @@ import AlterationHandlingConfirmationModal from 'benefit/handler/components/alte import AlterationHandlingSection from 'benefit/handler/components/alterationHandling/AlterationHandlingSection'; import AlterationSummary from 'benefit/handler/components/alterationHandling/AlterationSummary'; import useAlterationHandlingForm from 'benefit/handler/components/alterationHandling/useAlterationHandlingForm'; -import { DEFAULT_MINIMUM_RECOVERY_AMOUNT } from 'benefit/handler/constants'; +import { $CustomNotesActions } from 'benefit/handler/components/applicationReview/actions/handlingApplicationActions/HandlingApplicationActions.sc'; +import Sidebar from 'benefit/handler/components/sidebar/Sidebar'; +import { + DEFAULT_MINIMUM_RECOVERY_AMOUNT, +} from 'benefit/handler/constants'; import { Application, ApplicationAlteration, @@ -22,6 +26,8 @@ import { Button, IconAlertCircleFill, IconCheck, + IconLock, + IconPen, Notification, RadioButton, SelectionGroup, @@ -72,6 +78,9 @@ const AlterationHandlingForm = ({ const [isConfirmationModalOpen, setConfirmationModalOpen] = useState(false); + const [isMessagesDrawerVisible, toggleMessagesDrawerVisibility] = + useState(false); + const getErrorMessage = (fieldName: string): string | undefined => getErrorText(formik.errors, formik.touched, fieldName, t, isSubmitted); @@ -239,6 +248,16 @@ const AlterationHandlingForm = ({ + <$StickyBarColumn> {hasErrors && isSubmitted && ( @@ -279,6 +298,18 @@ const AlterationHandlingForm = ({ isWorking={isSubmitting} values={formik.values} /> + toggleMessagesDrawerVisibility(false)} + customItemsNotes={ + <$CustomNotesActions> + +

{t('common:messenger.showToHandlerOnly')}

+ + } + /> ); }; diff --git a/frontend/benefit/handler/src/components/applicationReview/actions/handlingApplicationActions/HandlingApplicationActions.tsx b/frontend/benefit/handler/src/components/applicationReview/actions/handlingApplicationActions/HandlingApplicationActions.tsx index 306837992d..969ab53b46 100644 --- a/frontend/benefit/handler/src/components/applicationReview/actions/handlingApplicationActions/HandlingApplicationActions.tsx +++ b/frontend/benefit/handler/src/components/applicationReview/actions/handlingApplicationActions/HandlingApplicationActions.tsx @@ -40,7 +40,7 @@ const HandlingApplicationActions: React.FC = ({ onDoneConfirmation, onBackToHandling, onSaveAndClose, - toggleMessagesDrawerVisiblity, + toggleMessagesDrawerVisibility, openDialog, closeDialog, closeDoneDialog, @@ -90,7 +90,7 @@ const HandlingApplicationActions: React.FC = ({ )}