Skip to content

Commit

Permalink
VACMS-16937: DUW Step 1 component (#31398)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskim2311 authored Sep 11, 2024
1 parent d0e1b6e commit 9ff1cb8
Show file tree
Hide file tree
Showing 4 changed files with 259 additions and 11 deletions.
10 changes: 8 additions & 2 deletions src/applications/discharge-wizard/components/v2/ResultsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ResultsSummary from './resultsComponents/ResultsSummary';
import CarefulConsiderationStatement from './resultsComponents/CarefulConsiderationStatement';
import Warnings from './resultsComponents/Warnings';
import OptionalStep from './resultsComponents/OptionalStep';
import StepOne from './resultsComponents/StepOne';

const ResultsPage = ({ formResponses, router, viewedIntroPage }) => {
const H1 = 'Your Steps for Upgrading Your Discharge';
Expand All @@ -32,12 +33,17 @@ const ResultsPage = ({ formResponses, router, viewedIntroPage }) => {
return (
<article className="dw-guidance" data-testid="duw-results">
<h1>{H1}</h1>
<div className="medium-8">
<>
<ResultsSummary formResponses={formResponses} />
<CarefulConsiderationStatement formResponses={formResponses} />
<Warnings formResponses={formResponses} />
<OptionalStep formResponses={formResponses} />
</div>
<section>
<va-process-list>
<StepOne formResponses={formResponses} />
</va-process-list>
</section>
</>
</article>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ const CarefulConsiderationStatement = ({ formResponses }) => {
status="info"
content={
<>
<h4 className="usa-alert-heading">
<h2 className="usa-alert-heading">
You can apply for VA benefits using your honorable
characterization.
</h4>
</h2>
<p>
Because you served honorably in one period of service, you can
apply for VA benefits using that honorable characterization.
Expand All @@ -124,10 +124,10 @@ const CarefulConsiderationStatement = ({ formResponses }) => {
status="info"
content={
<>
<h4 className="usa-alert-heading">
<h2 className="usa-alert-heading">
You can apply for VA benefits using your honorable
characterization.
</h4>
</h2>
<div className="vads-u-font-size--base">
<p className="vads-u-margin-top--2">
Because you served honorably in one period of service, you
Expand Down Expand Up @@ -169,7 +169,7 @@ const CarefulConsiderationStatement = ({ formResponses }) => {
return (
<>
{reasonStatement()}
{priorServiceStatement()}
<div className="vads-u-padding-bottom--2">{priorServiceStatement()}</div>
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
import React from 'react';
import PropTypes from 'prop-types';
import AlertMessage from './AlertMessage';
import { determineBoardObj, determineFormData } from '../../../helpers';

import {
SHORT_NAME_MAP,
RESPONSES,
} from '../../../constants/question-data-map';
import { DRB } from '../../../constants';

const StepOne = ({ formResponses }) => {
const reason = formResponses[SHORT_NAME_MAP.REASON];
const specialReason = [
RESPONSES.REASON_PTSD,
RESPONSES.REASON_TBI,
RESPONSES.REASON_SEXUAL_ASSAULT,
].includes(reason);
const boardToSubmit = determineBoardObj(formResponses);

const reasonsObj = {
[RESPONSES.REASON_PTSD]: {
name: 'PTSD or other mental health conditions',
type: 'condition',
},
[RESPONSES.REASON_TBI]: {
name: 'TBI',
type: 'condition',
},
[RESPONSES.REASON_SEXUAL_ASSAULT]: {
name: 'sexual assault',
type: 'experience',
},
};

const strongCaseTips = () => {
if (specialReason) {
const { name, type } = reasonsObj[reason];
return (
<>
<p>
For discharges related to {name}, be sure to answer these questions
to make the strongest case:
</p>
<ul>
<li>
Did you have {type === 'experience' ? 'an' : 'a'} {type} that may
explain or contribute to the discharge?
</li>
<li>
Did that {type}{' '}
{reason === RESPONSES.REASON_SEXUAL_ASSAULT
? 'happen'
: 'start or get worse'}{' '}
during your military service?
</li>
<li>
Why does the {type} directly explain or contribute to the
discharge?
</li>
<li>
Why does the {type} carry more weight than any other reasons you
may have been discharged for?
</li>
</ul>
</>
);
}
return null;
};

const dd214Tips = formResponses[SHORT_NAME_MAP.SERVICE_BRANCH] !==
RESPONSES.AIR_FORCE && (
<ul>
<li>
Pay special attention to item 6, which asks for the reason for your
change. Here you should explain why you need a new DD214, including any
problems you face when you have to show both the DD214 and the DD215.
You may want to consider attaching additional pages to fully answer this
question.
</li>
</ul>
);

const nonDd2014Tips = (
<ul>
{formResponses[SHORT_NAME_MAP.SERVICE_BRANCH] !== RESPONSES.AIR_FORCE && (
<li>
Pay special attention to item 6, which asks for the reason for your
change. Most Veterans attach additional pages to answer this question.{' '}
{strongCaseTips()}
</li>
)}
{[
RESPONSES.PREV_APPLICATION_BCMR,
RESPONSES.PREV_APPLICATION_BCNR,
].includes(formResponses[SHORT_NAME_MAP.PREV_APPLICATION_TYPE]) && (
<li>
Because you’re applying for reconsideration of a previous application,
you’ll need to enter the previous application number in Item 6b.{' '}
<strong>Note:</strong> You’re generally only eligible for
reconsideration if you have new evidence to present that wasn’t
available when you applied last time. Make sure you’re clear about
exactly what that new evidence is. Additionally, changes in DoD
policy, like the new consideration guidelines for PTSD, TBI, and
sexual assault or harassment, can qualify you for reconsideration.
</li>
)}
{formResponses[SHORT_NAME_MAP.REASON] ===
RESPONSES.REASON_SEXUAL_ASSAULT && (
<li>
Note: For upgrades related to sexual assault or harassment, you do not
need to prove the original assault or harassment occurred—meaning if
you didn’t file charges or report the incident, you can still apply
for an upgrade. The important part of your application is where you
explain the impact of the incident on your service. For example,
detail how the incident caused a decrease in your productivity, or was
the reason for PTSD.
</li>
)}
{boardToSubmit.abbr !== DRB &&
formResponses[SHORT_NAME_MAP.SERVICE_BRANCH] !==
RESPONSES.AIR_FORCE && (
<li>
Item 8 asks for the date when you discovered the error or injustice
you’re asking the Board to address. If it’s been more than 3 years
since you found this error or injustice, you’ll need to include a
reason why the Board should consider your application. Examples of
good reasons include new evidence you’ve found to support your
claim, or recent changes in policy (like liberal consideration for
PTSD, TBI, or military sexual assault or harassment). These kinds of
reasons will make it more likely for the Board to decide in your
favor. The 3-year time limit isn’t a strict rule, so don’t let it
keep you from applying if you think you have a strong case.
</li>
)}
{boardToSubmit.abbr !== DRB && (
<li>
Item 17 asks if you’re willing to appear in person before the Board in
Washington, DC. The Board rarely asks Veterans to appear in person,
but if you say you’re willing to do so, it may help show how serious
you are about your case.
</li>
)}
{boardToSubmit.abbr === DRB &&
formResponses[SHORT_NAME_MAP.PREV_APPLICATION_TYPE] !==
RESPONSES.PREV_APPLICATION_DRB_DOCUMENTARY && (
<li>
You can request either a Documentary Review or Personal Appearance
Review from the Discharge Review Board (DRB). If your case is
especially complicated and requires detailed explanation, you{' '}
<strong>may</strong> have more success with a Personal Appearance
Review. Note that you’ll have to pay your travel costs if you make a
personal appearance. Documentary Reviews are generally faster, so we
recommend you begin with this type of review. Also, if you’re denied
in a Documentary Review, you can then appeal through a Personal
Appearance Review. But you can’t request Documentary Review after a
Personal Appearance Review.
</li>
)}
{boardToSubmit.abbr === DRB &&
formResponses[SHORT_NAME_MAP.PREV_APPLICATION_TYPE] ===
RESPONSES.PREV_APPLICATION_DRB_DOCUMENTARY && (
<li>
The DRB allows you to request either a Documentary Review or a
Personal Appearance Review. Because your application was already
denied during a Documentary Review, you must apply for a Personal
Appearance Review in Washington, DC. Note that you will have to pay
your travel costs if you make a personal appearance.
</li>
)}
</ul>
);

const form = determineFormData(formResponses);
const header = `Download and fill out DoD Form ${form.num}`;
const level = [
RESPONSES.PRIOR_SERVICE_PAPERWORK_NO,
RESPONSES.PRIOR_SERVICE_PAPERWORK_YES,
].includes(formResponses[SHORT_NAME_MAP.PRIOR_SERVICE])
? 3
: 2;

return (
<va-process-list-item header={header} level={level}>
<p>Important tips for completing Form {form.num}:</p>
{formResponses[SHORT_NAME_MAP.REASON] ===
RESPONSES.REASON_DD215_UPDATE_TO_DD214
? dd214Tips
: nonDd2014Tips}
{/* Intentionally not using <va-link> per Platform Analytics team */}
<a
className="vads-u-display--block vads-u-margin-bottom--1 step-1-download"
download
href={form.link}
target="_blank"
rel="noopener noreferrer"
>
<va-icon
icon="file_download"
size={3}
className="vads-u-margin-top--0p5 vads-u-padding-right--1"
/>
Download Form {form.num} (opens in a new tab)
</a>
<AlertMessage
content={
<>
<h2 className="usa-alert-heading">
Need help preparing your application?
</h2>
<p>
The process of preparing a discharge upgrade or correction
application can be a lot of work and can take a long time.
Although many Veterans are successful on their own, you may want
to consider finding someone to advocate for you in this process.
Try a Veterans Service Organization (VSO), search online for a
lawyer who may provide services for low or no cost, or ask other
Veterans for recommendations.{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://www.benefits.va.gov/vso/varo.asp"
>
Find a VSO near you (opens in a new tab)
</a>
.
</p>
</>
}
isVisible
status="warning"
/>
</va-process-list-item>
);
};

StepOne.propTypes = {
formResponses: PropTypes.object.isRequired,
};

export default StepOne;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Dependencies
import React from 'react';
import { expect } from 'chai';
import { mount, shallow } from 'enzyme';
import { mount } from 'enzyme';
import AlertMessage from '../../../components/v2/resultsComponents/AlertMessage';
import CarefulConsiderationStatement from '../../../components/v2/resultsComponents/CarefulConsiderationStatement';
import {
Expand All @@ -11,16 +11,16 @@ import {

describe('Discharge Wizard CarefulConsiderationStatement', () => {
it('should show nothing of the component if no reason && dischargeType is populated on props', () => {
const tree = shallow(
const wrapper = mount(
<CarefulConsiderationStatement
formResponses={{
[SHORT_NAME_MAP.REASON]: null,
[SHORT_NAME_MAP.DISCHARGE_TYPE]: null,
}}
/>,
);
expect(tree.html()).to.equal(''); // component renders null
tree.unmount();
expect(wrapper.find(AlertMessage)).to.have.lengthOf(0); // component renders null
wrapper.unmount();
});

it('should show alert box if 12_priorService is populated on props', () => {
Expand Down

0 comments on commit 9ff1cb8

Please sign in to comment.