Skip to content

Commit

Permalink
toggle opening, and status changeing onClick of Next
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev-KRedd committed Oct 24, 2024
1 parent cd7fac9 commit 455c0f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,6 @@ const CorrespondenceDetails = (props) => {

}, []);

const isTasksUnrelatedToAppealEmpty = () => {
if (props.tasksUnrelatedToAppealEmpty === true) {
return 'Completed';
}

return props.correspondence.status;
};

const correspondenceTasks = () => {
return (
<React.Fragment>
Expand Down Expand Up @@ -538,6 +530,7 @@ const CorrespondenceDetails = (props) => {
isOpen={isModalOpen}
handleClose={handleCloseModal}
correspondence={props.correspondence}
setIsTasksUnrelatedSectionExpanded= {setIsTasksUnrelatedSectionExpanded}
/>
</div>
<div className="toggleButton-plus-or-minus">
Expand Down Expand Up @@ -905,7 +898,7 @@ const CorrespondenceDetails = (props) => {
</div>
<p><a onClick={handleViewAllCorrespondence}>{viewDisplayText()}</a></p>
<div></div>
<p className="last-item"><b>Record status: </b>{isTasksUnrelatedToAppealEmpty()}</p>
<p className="last-item"><b>Record status: </b>{correspondenceInfo.status}</p>
</div>
<div style = {{ marginTop: '20px' }}>
{ allCorrespondencesList() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const AddTaskModalCorrespondenceDetails = ({
task,
displayRemoveCheck,
removeTask,
setIsTasksUnrelatedSectionExpanded
}) => {
const dispatch = useDispatch();

Expand Down Expand Up @@ -94,6 +95,7 @@ const AddTaskModalCorrespondenceDetails = ({
// Clear the TextAreaField and reset selection after successful submission
setTaskContent('');
setSelectedTaskType(null);
setIsTasksUnrelatedSectionExpanded(true);

// Close the modal only after the patch request has succeeded
handleClose();
Expand Down Expand Up @@ -181,6 +183,7 @@ AddTaskModalCorrespondenceDetails.propTypes = {
task: PropTypes.object.isRequired,
displayRemoveCheck: PropTypes.bool.isRequired,
removeTask: PropTypes.func.isRequired,
setIsTasksUnrelatedSectionExpanded: PropTypes.func.isRequired,
};

export default AddTaskModalCorrespondenceDetails;

0 comments on commit 455c0f3

Please sign in to comment.