Skip to content

Commit

Permalink
Merge pull request #18991 from department-of-veterans-affairs/feature…
Browse files Browse the repository at this point in the history
…/APPEALS-9414

feature/APPEALS-4011: Tracking Branch
  • Loading branch information
ThorntonMatthew authored Jul 13, 2023
2 parents 9a6b420 + c301f8a commit b9462c0
Show file tree
Hide file tree
Showing 10 changed files with 727 additions and 123 deletions.
3 changes: 2 additions & 1 deletion app/views/queue/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
split_appeal_workflow: FeatureToggle.enabled?(:split_appeal_workflow, user: current_user),
cavc_remand_granted_substitute_appellant: FeatureToggle.enabled?(:cavc_remand_granted_substitute_appellant, user: current_user),
cavc_dashboard_workflow: FeatureToggle.enabled?(:cavc_dashboard_workflow, user: current_user),
cc_appeal_workflow: FeatureToggle.enabled?(:cc_appeal_workflow, user: current_user)
cc_appeal_workflow: FeatureToggle.enabled?(:cc_appeal_workflow, user: current_user),
cc_vacatur_visibility: FeatureToggle.enabled?(:cc_vacatur_visibility, user: current_user)
}
}) %>
<% end %>
6 changes: 6 additions & 0 deletions client/COPY.json
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,12 @@
"MTV_CHECKOUT_RETURN_TO_JUDGE_MODAL_INSTRUCTIONS_LABEL": "Provide instructions and context for this action",
"MTV_CHECKOUT_RETURN_TO_JUDGE_SUCCESS_TITLE": "%s's Motion to Vacate has been returned to %s",
"MTV_CHECKOUT_RETURN_TO_JUDGE_SUCCESS_DETAILS": "If you made a mistake, please email your judge to resolve the issue.",

"MTV_TASK_INSTRUCTIONS": "**Motion To Vacate:** \n",
"MTV_TASK_INSTRUCTIONS_TYPE": "**Type:** ",
"MTV_TASK_INSTRUCTIONS_DETAIL": "**Detail:** ",
"MTV_TASK_INSTRUCTIONS_HYPERLINK": "**Hyperlink:** ",

"VACATE_AND_DE_NOVO_TASK_LABEL": "Vacate and De Novo",
"VACATE_AND_READJUDICATION_TASK_LABEL": "Vacate and Readjudication",
"STRAIGHT_VACATE_TASK_LABEL": "Straight Vacate",
Expand Down
4 changes: 4 additions & 0 deletions client/app/queue/mtv/AddressMotionToVacateView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export const AddressMotionToVacateView = () => {

const task = useSelector((state) => taskById(state, { taskId }));
const appeal = useSelector((state) => appealWithDetailSelector(state, { appealId }));
const vacateTypeFeatureToggle = useSelector(
(state) => state.ui.featureToggles.cc_vacatur_visibility
);

const { selected, options } = taskActionData({ task,
match });
Expand All @@ -42,6 +45,7 @@ export const AddressMotionToVacateView = () => {
task={task}
attorneys={attyOptions}
selectedAttorney={selected}
vacateTypeFeatureToggle = {vacateTypeFeatureToggle}
appeal={appeal}
onSubmit={handleSubmit}
returnToLitSupportLink={`${match.url}/${JUDGE_RETURN_TO_LIT_SUPPORT.value}`}
Expand Down
44 changes: 34 additions & 10 deletions client/app/queue/mtv/MTVJudgeDisposition.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ import {
JUDGE_ADDRESS_MTV_VACATE_TYPE_LABEL,
JUDGE_ADDRESS_MTV_HYPERLINK_LABEL,
JUDGE_ADDRESS_MTV_DISPOSITION_NOTES_LABEL,
JUDGE_ADDRESS_MTV_ASSIGN_ATTORNEY_LABEL
JUDGE_ADDRESS_MTV_ASSIGN_ATTORNEY_LABEL,
MTV_TASK_INSTRUCTIONS,
MTV_TASK_INSTRUCTIONS_TYPE,
MTV_TASK_INSTRUCTIONS_DETAIL,
MTV_TASK_INSTRUCTIONS_HYPERLINK
} from '../../../COPY';
import { DISPOSITION_TEXT, VACATE_TYPE_OPTIONS } from '../../../constants/MOTION_TO_VACATE';
import { DISPOSITION_TIMELINE_TEXT, VACATE_TYPE_OPTIONS } from '../../../constants/MOTION_TO_VACATE';
import { JUDGE_RETURN_TO_LIT_SUPPORT } from '../../../constants/TASK_ACTIONS';
import SearchableDropdown from '../../components/SearchableDropdown';
import AppSegment from '@department-of-veterans-affairs/caseflow-frontend-toolkit/components/AppSegment';
Expand All @@ -28,26 +32,41 @@ import StringUtil from '../../util/StringUtil';
import { ReturnToLitSupportAlert } from './ReturnToLitSupportAlert';
import { grantTypes, dispositionStrings } from './mtvConstants';
import { sprintf } from 'sprintf-js';
import { isEmpty } from 'lodash';

const vacateTypeText = (val) => {
const opt = VACATE_TYPE_OPTIONS.find((i) => i.value === val);

return opt && opt.displayText;
};

const formatInstructions = ({ disposition, vacateType, hyperlink, instructions }) => {
const parts = [`I am proceeding with a ${DISPOSITION_TEXT[disposition]}.`];
const formatInstructions = ({ vacateTypeFeatureToggle, disposition, vacateType, hyperlink, instructions }) => {
const parts = [`${MTV_TASK_INSTRUCTIONS}${DISPOSITION_TIMELINE_TEXT[disposition]}\n`];

switch (disposition) {
case 'granted':
case 'partially_granted':
parts.push(`This will be a ${vacateTypeText(vacateType)}`);
parts.push(instructions);
if (!vacateTypeFeatureToggle) {
parts.push(MTV_TASK_INSTRUCTIONS_TYPE);
parts.push(`${vacateTypeText(vacateType)}\n`);

}
if (isEmpty(instructions) === false) {
parts.push(MTV_TASK_INSTRUCTIONS_DETAIL);
parts.push(`${instructions}\n`);
}
break;
case 'denied':
case 'dismissed':
default:
parts.push(instructions);
parts.push('\nHere is the hyperlink to the signed denial document');
parts.push(hyperlink);
if (isEmpty(instructions) === false) {
parts.push(MTV_TASK_INSTRUCTIONS_DETAIL);
parts.push(`${instructions}\n`);
}
if (hyperlink !== null) {
parts.push(MTV_TASK_INSTRUCTIONS_HYPERLINK);
parts.push(`${hyperlink}\n`);
}
break;
}

Expand All @@ -62,10 +81,12 @@ const styles = {
};

export const MTVJudgeDisposition = ({

attorneys,
selectedAttorney,
task,
appeal,
vacateTypeFeatureToggle,
onSubmit = () => null,
submitting = false,
returnToLitSupportLink = JUDGE_RETURN_TO_LIT_SUPPORT.value
Expand All @@ -81,6 +102,7 @@ export const MTVJudgeDisposition = ({

const handleSubmit = () => {
const formattedInstructions = formatInstructions({
vacateTypeFeatureToggle,
disposition,
vacateType,
hyperlink,
Expand Down Expand Up @@ -180,7 +202,8 @@ export const MTVJudgeDisposition = ({

<TextareaField
name="instructions"
label={sprintf(JUDGE_ADDRESS_MTV_DISPOSITION_NOTES_LABEL, disposition || 'granted')}
label={sprintf(JUDGE_ADDRESS_MTV_DISPOSITION_NOTES_LABEL,
disposition === 'partially_granted' ? 'partially granted' : disposition || 'granted')}
onChange={(val) => setInstructions(val)}
value={instructions}
className={['mtv-decision-instructions']}
Expand Down Expand Up @@ -227,6 +250,7 @@ MTVJudgeDisposition.propTypes = {
onSubmit: PropTypes.func.isRequired,
submitting: PropTypes.bool,
task: PropTypes.object.isRequired,
vacateTypeFeatureToggle: PropTypes.bool,
appeal: PropTypes.object.isRequired,
attorneys: PropTypes.array.isRequired,
selectedAttorney: PropTypes.object,
Expand Down
8 changes: 8 additions & 0 deletions client/constants/MOTION_TO_VACATE.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
"denied": "denial of all issues for vacatur",
"dismissed": "dismissal"
},

"DISPOSITION_TIMELINE_TEXT": {
"granted": "Full vacatur",
"partially_granted": "Partial vacatur",
"denied": "Deny all issues for vacatur",
"dismissed": "Dismiss all issues for vacatur"
},

"DISPOSITION_RECOMMENDATIONS": {
"granted": "I recommend granting a vacatur.",
"partially_granted": "I recommend granting a partial vacatur.",
Expand Down
Loading

0 comments on commit b9462c0

Please sign in to comment.