diff --git a/CHANGELOG.md b/CHANGELOG.md index e1026f65..7bcb03ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,10 @@ The **need for configuration updates** is **marked bold**. * Updated open API ([#929](https://github.com/eclipse-tractusx/puris/pull/929)) * Updated dependencies to resolve high and critical security vulnerabilities ([#932](https://github.com/eclipse-tractusx/puris/pull/932)) +### Fixes + +* Fixed notification resolution validation issue ([#952](https://github.com/eclipse-tractusx/puris/pull/952)) + ## v3.2.0 The following Changelog lists the changes. Please refer to the [documentation](docs/README.md) for configuration needs and understanding the concept changes. diff --git a/frontend/src/features/notifications/components/NotificationInformationModal.tsx b/frontend/src/features/notifications/components/NotificationInformationModal.tsx index 53eba291..bac240f7 100644 --- a/frontend/src/features/notifications/components/NotificationInformationModal.tsx +++ b/frontend/src/features/notifications/components/NotificationInformationModal.tsx @@ -179,7 +179,8 @@ export const DemandCapacityNotificationInformationModal = ({ }, [open, demandCapacityNotification, forwardData]); const handleSaveClick = () => { - if (!isValidDemandCapacityNotification(temporaryDemandCapacityNotification)) { + if (!isValidDemandCapacityNotification(temporaryDemandCapacityNotification) || + !temporaryDemandCapacityNotification.text?.trim()) { setFormError(true); return; } @@ -436,8 +437,8 @@ export const DemandCapacityNotificationInformationModal = ({ text: event.target.value, }) } - error={formError && !temporaryDemandCapacityNotification?.text} - className={formError && !temporaryDemandCapacityNotification?.text ? 'error-textarea' : ''} + error={formError && !temporaryDemandCapacityNotification?.text?.trim()} + className={formError && !temporaryDemandCapacityNotification?.text?.trim() ? 'error-textarea' : ''} /> These notes will be shared with the selected partner. Please do not include sensitive data of third parties. diff --git a/frontend/src/features/notifications/components/NotificationResolutionMessageModal.tsx b/frontend/src/features/notifications/components/NotificationResolutionMessageModal.tsx index be67ffc2..bea1b9e6 100644 --- a/frontend/src/features/notifications/components/NotificationResolutionMessageModal.tsx +++ b/frontend/src/features/notifications/components/NotificationResolutionMessageModal.tsx @@ -55,7 +55,7 @@ export const DemandCapacityNotificationResolutionModal = ({ }, [open]); const handleSaveClick = () => { - if (resolutionMessage === '') { + if (resolutionMessage === '' || !resolutionMessage?.trim()) { setFormError(true); return; } @@ -69,7 +69,7 @@ export const DemandCapacityNotificationResolutionModal = ({ affectedSitesBpnsRecipient: [], affectedSitesBpnsSender: [], affectedMaterialNumbers: [], - text: '' + text: null }; putDemandAndCapacityNotification(updatedNotification) @@ -115,8 +115,8 @@ export const DemandCapacityNotificationResolutionModal = ({ id="resolvingMeasureDescription" value={resolutionMessage} onChange={(event) => setResolutionMessage(event.target.value)} - error={formError && !resolutionMessage} - className={formError && !resolutionMessage ? 'error-textarea' : ''} + error={formError && !resolutionMessage?.trim()} + className={formError && !resolutionMessage?.trim() ? 'error-textarea' : ''} placeholder="Your message" /> diff --git a/frontend/src/models/types/data/demand-capacity-notification.ts b/frontend/src/models/types/data/demand-capacity-notification.ts index 28d3761e..5c399525 100644 --- a/frontend/src/models/types/data/demand-capacity-notification.ts +++ b/frontend/src/models/types/data/demand-capacity-notification.ts @@ -28,7 +28,7 @@ export type DemandCapacityNotification = { uuid: string, notificationId: string, sourceDisruptionId: string, - text: string, + text: string | null, partnerBpnl: BPNL, affectedMaterialNumbers: string[], leadingRootCause: LeadingRootCauseType,