Skip to content

Commit

Permalink
fix: issue with closing validation message in Prevention (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
Scarlett-Truong authored Jun 25, 2024
1 parent a5cbba7 commit 49508bc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ export const HWCRComplaintAssessment: FC = () => {

dispatch(upsertAssessment(id, updatedAssessmentData));
setEditable(false);
dispatch(setIsInEdit({ showSectionErrors: false }));
} else {
handleFormErrors();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ export const HWCRComplaintPrevention: FC = () => {
const { personGuid } = useAppSelector(selectComplaintHeader(complaintType));
const assigned = useAppSelector(selectComplaintAssignedBy);
const cases = useAppSelector((state) => state.cases);
const assessmentRelatedError =
Object.keys(cases.prevention).length === 0 &&
cases.assessment.action_required === "Yes" &&
cases.isInEdit.showSectionErrors;
const showSectionErrors = (editable || !showContent) && cases.isInEdit.showSectionErrors;

useEffect(() => {
Expand Down Expand Up @@ -255,15 +251,6 @@ export const HWCRComplaintPrevention: FC = () => {
</div>
)}
</div>
{assessmentRelatedError && (
<div
className="section-error-message"
style={{ marginBottom: "8px" }}
>
<BsExclamationCircleFill />
<span>Complete section before closing the complaint.</span>
</div>
)}
{!showContent ? (
<div className="comp-outcome-report-button">
<Button
Expand All @@ -281,7 +268,7 @@ export const HWCRComplaintPrevention: FC = () => {
) : (
<Card border={showSectionErrors ? "danger" : "default"}>
<Card.Body>
{showSectionErrors && !assessmentRelatedError && (
{showSectionErrors && (
<div className="section-error-message">
<BsExclamationCircleFill />
<span>Save section before closing the complaint.</span>
Expand Down

0 comments on commit 49508bc

Please sign in to comment.