Skip to content

Commit

Permalink
Merge branch 'feature/APPEALS-60433' into Ki/APPEALS-54280
Browse files Browse the repository at this point in the history
  • Loading branch information
KiMauVA authored Oct 24, 2024
2 parents dfdc733 + 605bf7c commit 5d17481
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 16 deletions.
51 changes: 39 additions & 12 deletions client/app/queue/correspondence/details/CorrespondenceDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import React, { useState, useEffect } from 'react';
import { useDispatch, connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { useHistory } from 'react-router';
import AppSegment from '@department-of-veterans-affairs/caseflow-frontend-toolkit/components/AppSegment';
import PropTypes from 'prop-types';
import TabWindow from '../../../components/TabWindow';
Expand Down Expand Up @@ -29,6 +30,7 @@ import CorrespondenceAppealTasks from '../CorrespondenceAppealTasks';

const CorrespondenceDetails = (props) => {
const dispatch = useDispatch();
const history = useHistory();
const correspondence = props.correspondence;
const correspondenceInfo = props.correspondenceInfo;
const expandedLinkedAppeals = props.expandedLinkedAppeals;
Expand Down Expand Up @@ -59,6 +61,8 @@ const CorrespondenceDetails = (props) => {
const [isExpanded, setIsExpanded] = useState(false);
const [isTasksUnrelatedSectionExpanded, setIsTasksUnrelatedSectionExpanded] = useState(false);
const [appealTaskKey, setAppealTaskKey] = useState(0);
const [showModal, setShowModal] = useState(false);
const [isReturnToQueue, setIsReturnToQueue] = useState(false);

// Initialize checkbox states
useEffect(() => {
Expand Down Expand Up @@ -849,6 +853,20 @@ const CorrespondenceDetails = (props) => {
}
];

const handleModalClose = () => {
if (isReturnToQueue) {
setShowModal(!showModal);
} else {
if (props.isInboundOpsSuperuser || props.isInboundOpsSupervisor) {
window.location.href = '/queue/correspondence/team';
} else if (props.isInboundOpsUser) {
window.location.href = '/queue/correspondence/team';
} else {
window.location.href = '/queue';
}
}
};

const saveChanges = () => {
if (isAdminNotLoggedIn() === false) {
handlepriorMailUpdate();
Expand Down Expand Up @@ -947,19 +965,28 @@ const CorrespondenceDetails = (props) => {
tabs={tabList}
/>
</AppSegment>
{
// eslint-disable-next-line max-len
(props.isInboundOpsUser || props.isInboundOpsSuperuser || props.isInboundOpsSupervisor) && <div className="margin-top-for-add-task-view">
<Button
type="button"
onClick={() => saveChanges()}
disabled={disableSubmitButton}
name="save-changes"
classNames={['cf-right-side']}>
Save changes
</Button>
<div className="margin-top-for-add-task-view">
<div className="cf-push-left">
<Button
name="Return to queue"
classNames={['cf-btn-link']}
onClick={handleModalClose}
/>
</div>
}
{
// eslint-disable-next-line max-len
(props.isInboundOpsUser || props.isInboundOpsSuperuser || props.isInboundOpsSupervisor) && <div>
<Button
type="button"
onClick={() => saveChanges()}
disabled={disableSubmitButton}
name="save-changes"
classNames={['cf-right-side']}>
Save changes
</Button>
</div>
}
</div>
</>
);
};
Expand Down
6 changes: 3 additions & 3 deletions client/app/styles/queue/_correspondence.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1673,12 +1673,12 @@ $color-bg-hsl-a: hsl(0, 0%, 80%);
}

.tasks-added-details {
margin-left: 40px;
margin-left: 1%;
}

.tasks-added-waive-banner-alert {
margin-left: 40px;
width: 95%;
margin-left: 1%;
width: 98%;
}

.waive-banner-alert .usa-alert.usa-alert-slim {
Expand Down
2 changes: 1 addition & 1 deletion client/constants/CORRESPONDENCE_DETAILS_BANNERS.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},

"evidenceWindowBanner": {
"message": "The waive evidence window request has been removed from the \"Evidence submission window\" task",
"message": "The waive evidence window request has been removed from the \"Evidence submission window\" task.",
"type": "success"
}
}

0 comments on commit 5d17481

Please sign in to comment.