Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travel Pay / flesh out SMOC introduction page #33888

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5c33296
add README
liztownd Jan 2, 2025
f8958e3
fix cypress test
liztownd Jan 2, 2025
88307e5
bare-bones basics of smoc
liztownd Jan 2, 2025
781ef9e
simple it up some more
liztownd Jan 2, 2025
00c1b51
fix cypress test for breadcrumb link
liztownd Jan 3, 2025
b4de3cd
add feature toggle redirect, combine handlers
liztownd Jan 3, 2025
0382e89
destructure props
liztownd Jan 3, 2025
b3a8982
add spacing on how to base route page
liztownd Jan 3, 2025
76e0a0d
wrap explainer page in feature flipper
liztownd Jan 3, 2025
e483314
Merge remote-tracking branch 'origin/main' into liz/smoc-flow-outline
liztownd Jan 3, 2025
3354a49
Merge remote-tracking branch 'origin/main' into liz/smoc-flow-outline
liztownd Jan 3, 2025
14aeb9f
Merge remote-tracking branch 'origin/main' into liz/smoc-flow-outline
liztownd Jan 3, 2025
30eb709
remove unneccessary divs and fragments
liztownd Jan 3, 2025
5903efe
Merge branch 'main' into liz/smoc-flow-outline
liztownd Jan 3, 2025
ce5c199
Merge branch 'main' into liz/smoc-flow-outline
liztownd Jan 3, 2025
d6abddd
update help text content
liztownd Jan 3, 2025
335feaf
add mocked data for appt + user
liztownd Jan 3, 2025
542f1a2
add date util fn, add content to intro page
liztownd Jan 3, 2025
4c97164
add appt to submit wrapper
liztownd Jan 3, 2025
f7c3625
update cypress test
liztownd Jan 6, 2025
9bb8a9a
Merge remote-tracking branch 'origin/main' into liz/flesh-out-intro-page
liztownd Jan 7, 2025
14d26e0
tidying after merging main
liztownd Jan 7, 2025
5e91b29
add smoc specific cypress test + mock data
liztownd Jan 7, 2025
9b56d6c
add unit tests + mock appt data; add appt to intro prop types
liztownd Jan 7, 2025
e3e23a0
Merge remote-tracking branch 'origin/main' into liz/flesh-out-intro-page
liztownd Jan 7, 2025
378adcc
update appt start time
liztownd Jan 7, 2025
2e43932
onNext > onStart
liztownd Jan 7, 2025
cc1c958
fix linting errors
liztownd Jan 7, 2025
87c5d8e
Merge remote-tracking branch 'origin/main' into liz/flesh-out-intro-page
liztownd Jan 7, 2025
a6d39be
Merge remote-tracking branch 'origin/main' into liz/flesh-out-intro-page
liztownd Jan 7, 2025
cfcc321
update text in unit test to match updated appt date
liztownd Jan 7, 2025
184357d
Merge remote-tracking branch 'origin/main' into liz/flesh-out-intro-page
liztownd Jan 7, 2025
1c4a954
Merge remote-tracking branch 'origin/main' into liz/flesh-out-intro-page
liztownd Jan 7, 2025
1c9dde6
Merge branch 'main' into liz/flesh-out-intro-page
liztownd Jan 7, 2025
c9b358f
merge main
liztownd Jan 8, 2025
d198d1c
update getDaysLeft; add tests
liztownd Jan 8, 2025
941f6b6
use calendar days instead, update test
liztownd Jan 8, 2025
2d94c9f
use isUnsupportedClaimType instead of cantFile
liztownd Jan 8, 2025
6af34e9
update cantFile test
liztownd Jan 8, 2025
0af62d9
elaborate TODO in Breadcrumbs
liztownd Jan 8, 2025
51d2430
rename cantFilePage
liztownd Jan 8, 2025
1d8d1b3
Merge remote-tracking branch 'origin/main' into liz/flesh-out-intro-page
liztownd Jan 8, 2025
07c21f9
Merge remote-tracking branch 'origin/main' into liz/flesh-out-intro-page
liztownd Jan 8, 2025
5b5b3d2
add date test for exactly 30 days
liztownd Jan 8, 2025
f41241d
Merge remote-tracking branch 'origin/main' into liz/flesh-out-intro-page
liztownd Jan 8, 2025
0058fb0
Merge branch 'main' into liz/flesh-out-intro-page
liztownd Jan 8, 2025
530c66e
Merge branch 'main' into liz/flesh-out-intro-page
liztownd Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions src/applications/travel-pay/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Travel Pay

<!-- TOC -->

- [Travel Pay](#travel-pay)
- [Test Users](#test-users)
- [Local FE development only](#local-fe-development-only)
- [Start mock API](#start-mock-api)
- [Start the API](#start-the-api)
- [Test it](#test-it)
- [Start the website](#start-the-website)
- [Build](#build)
- [Run](#run)
- [Trick user session](#trick-user-session)
- [Things of note](#things-of-note)

<!-- /TOC -->

## Test users

Users should have a contact in Dynamics and travel related claims already in BTSSS in order to show their statuses.

Staging test users are laid out in [this spreadsheet](https://docs.google.com/spreadsheets/d/1hpFNNk1Iv4X1W8C9dc13KA73V1mhI1zZ).

## Local FE development (non-api)

### Start mock API

#### Start the API

Open a terminal and start the the mock api

```bash
yarn mock-api --responses src/applications/travel-pay/services/mocks/index.js
```

#### Test it

Open the mock api url, and visit `/v0/user` to test it. You should see a JSON response of the user object.

### Start the website

#### Build

Since we are running the site as a static site, build the app in localhost mode. We need build for the locally environment so we can change the API url to the mock api we are running in this instance

```bash
yarn build:webpack:local --env api="http://localhost:3000"
```

#### Run

We are going to serve the built website through a static server, defining the PORT as `3001`

```bash
WEB_PORT=3001 node src/platform/testing/e2e/test-server.js --buildtype=localhost
```

#### Trick user session

- Force the user to have a session by opening your console and typing `localStorage.setItem('hasSession', true)` into the dev console

#### Things of note

- The main content will never load, that is static content. That is outside the scope of this setup.
- Sometimes its a refresh or two to get things going
- If you make changes, you will have to re-build and re-start the server
48 changes: 41 additions & 7 deletions src/applications/travel-pay/components/Breadcrumbs.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { VaBreadcrumbs } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import { useLocation, useHistory, Link } from 'react-router-dom';
import { useLocation, useHistory, useParams } from 'react-router-dom';

export default function BreadCrumbs() {
const { pathname } = useLocation();
Expand All @@ -9,6 +9,12 @@ export default function BreadCrumbs() {
const isDetailsPage = pathname.match(uuidPathRegex);
const isStatusExplainer = pathname.includes('/help');

const { apptId } = useParams();

// TODO: this needs work
const isSubmitWrapper = pathname.includes(`/file-new-claim/${apptId}`);
const isFileClaimExplainerPage = pathname.includes('/file-new-claim');

const breadcrumbList = [
{
href: '/',
Expand All @@ -35,17 +41,45 @@ export default function BreadCrumbs() {
});
}

if (isFileClaimExplainerPage) {
breadcrumbList.push({
href: '/file-new-claim',
label: 'How to file a travel reimbursement claim',
isRouterLink: true,
});
}

if (isSubmitWrapper) {
breadcrumbList.push({
href: `/file-new-claim/${apptId}`,
label: 'File a new travel claim',
isRouterLink: true,
});
}

const handleRouteChange = ({ detail }) => {
const { href } = detail;
history.push(href);
};

return isDetailsPage ? (
<div className="travel-pay-breadcrumb-wrapper">
{isDetailsPage && <va-icon class="back-arrow" icon="arrow_back" />}
<Link className="go-back-link" to="/claims/">
Back to your travel reimbursement claims
</Link>
return isDetailsPage || isSubmitWrapper ? (
<div className="vads-u-padding-top--2p5 vads-u-padding-bottom--4">
{isDetailsPage && (
<va-link
data-testid="details-back-link"
back
href="/my-health/travel-pay/claims/"
text="Back to your travel reimbursement claims"
/>
)}
{isSubmitWrapper && (
<va-link
data-testid="submit-back-link"
back
href={`/my-health/appointments/past/${apptId}`}
text="Back to your appointment"
/>
)}
</div>
) : (
<VaBreadcrumbs
Expand Down
71 changes: 57 additions & 14 deletions src/applications/travel-pay/components/HelpText.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import React from 'react';
import { Link } from 'react-router-dom';

export default function HelpTextContent() {
const BTSSS_PORTAL_URL = 'https://dvagov-btsss.dynamics365portals.us/';
import {
BTSSS_PORTAL_URL,
FORM_103542_LINK,
FIND_FACILITY_TP_CONTACT_LINK,
} from '../constants';

export const HelpTextManage = () => {
return (
<div>
<p>
Expand All @@ -20,17 +23,57 @@ export default function HelpTextContent() {
Monday through Friday. Have your claim number ready to share when you
call.
</p>
<p className="vads-u-margin-top--2">
<Link
data-testid="status-explainer-link"
to={{
pathname: '/help',
}}
className="vads-u-display--flex vads-u-align-items--center"
>
What does my claim status mean?
</Link>
</div>
);
};

export const HelpTextGeneral = () => {
return (
<div>
<p>
Call the BTSSS call center at <va-telephone contact="8555747292" />.
We’re here Monday through Friday, 8:00 a.m. to 8:00 p.m. ET.
</p>
<p className="vads-u-margin-y--2">
Or call your VA health facility’s Beneficiary Travel contact.
</p>
<va-link
href={FIND_FACILITY_TP_CONTACT_LINK}
text="Find the travel contact for your facility"
/>
</div>
);
};

export const HelpTextModalities = () => {
return (
<div>
<p>
You can still file a claim within 30 days of this appointment these
other ways:
</p>
<ul>
<li>
<p className="vads-u-margin-y--2">
Online 24/7 through the Beneficiary Travel Self Service System
(BTSSS)
</p>
<va-link
external
href={BTSSS_PORTAL_URL}
text="File a travel claim online"
/>
</li>
<li>
<p className="vads-u-margin-y--2">
VA Form 10-3542 by mail, fax, email, or in person
</p>
<va-link
href={FORM_103542_LINK}
text="Learn more about VA Form 10-3542"
/>
</li>
</ul>
</div>
);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Element } from 'platform/utilities/scroll';
import { apiRequest } from '@department-of-veterans-affairs/platform-utilities/api';
import environment from '@department-of-veterans-affairs/platform-utilities/environment';

import HelpTextContent from './HelpText';
import { HelpTextManage } from './HelpText';
import BreadCrumbs from './Breadcrumbs';
import ClaimDetailsContent from './ClaimDetailsContent';

Expand Down Expand Up @@ -116,7 +116,7 @@ export default function TravelClaimDetails() {
</a>
<va-need-help>
<div slot="content">
<HelpTextContent />
<HelpTextManage />
</div>
</va-need-help>
</article>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import { VaButtonPair } from '@department-of-veterans-affairs/component-library/dist/react-bindings';

const AddressPage = props => {
const { handlers } = props;

Check warning on line 5 in src/applications/travel-pay/components/submit-flow/pages/AddressPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/travel-pay/components/submit-flow/pages/AddressPage.jsx:5:11:'handlers' is missing in props validation
return (
<div>
<h1>Address page</h1>

<VaButtonPair
class="vads-u-margin-y--2"
continue
onPrimaryClick={e => handlers.onNext(e)}

Check warning on line 13 in src/applications/travel-pay/components/submit-flow/pages/AddressPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/travel-pay/components/submit-flow/pages/AddressPage.jsx:13:39:'handlers.onNext' is missing in props validation
onSecondaryClick={e => handlers.onBack(e)}

Check warning on line 14 in src/applications/travel-pay/components/submit-flow/pages/AddressPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/travel-pay/components/submit-flow/pages/AddressPage.jsx:14:41:'handlers.onBack' is missing in props validation
/>
</div>
);
};

export default AddressPage;
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';

const CantFilePage = props => {
const { pageIndex, setPageIndex, setCantFile } = props;

Check warning on line 4 in src/applications/travel-pay/components/submit-flow/pages/CantFilePage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/travel-pay/components/submit-flow/pages/CantFilePage.jsx:4:11:'pageIndex' is missing in props validation

Check warning on line 4 in src/applications/travel-pay/components/submit-flow/pages/CantFilePage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/travel-pay/components/submit-flow/pages/CantFilePage.jsx:4:22:'setPageIndex' is missing in props validation

Check warning on line 4 in src/applications/travel-pay/components/submit-flow/pages/CantFilePage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/travel-pay/components/submit-flow/pages/CantFilePage.jsx:4:36:'setCantFile' is missing in props validation
const onBack = e => {
e.preventDefault();
setCantFile(false);
setPageIndex(pageIndex);
};

return (
<div>
<h1 tabIndex="-1">
We can’t file this type of travel reimbursement claim
</h1>
<va-button
class="vads-u-margin-y--2"
text="Back"
onClick={e => onBack(e)}
/>
</div>
);
};

export default CantFilePage;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

const ConfirmationPage = () => {
return (
<div className="vads-u-margin-bottom--3">
<h1 tabIndex="-1">We’re processing your travel reimbursement claim</h1>
</div>
);
};

export default ConfirmationPage;
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import React from 'react';

import { HelpTextManage } from '../../HelpText';
import { formatDateTime, getDaysLeft } from '../../../util/dates';

const IntroductionPage = props => {
const { appointment, onNext } = props;

Check warning on line 7 in src/applications/travel-pay/components/submit-flow/pages/IntroductionPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/travel-pay/components/submit-flow/pages/IntroductionPage.jsx:7:11:'appointment' is missing in props validation

Check warning on line 7 in src/applications/travel-pay/components/submit-flow/pages/IntroductionPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/travel-pay/components/submit-flow/pages/IntroductionPage.jsx:7:24:'onNext' is missing in props validation

const [formattedDate] = formatDateTime(appointment.vaos.apiData.start);

Check warning on line 9 in src/applications/travel-pay/components/submit-flow/pages/IntroductionPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/travel-pay/components/submit-flow/pages/IntroductionPage.jsx:9:54:'appointment.vaos' is missing in props validation

Check warning on line 9 in src/applications/travel-pay/components/submit-flow/pages/IntroductionPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/travel-pay/components/submit-flow/pages/IntroductionPage.jsx:9:59:'appointment.vaos.apiData' is missing in props validation
const daysLeft = getDaysLeft(appointment.vaos.apiData.start);

return (
<div>
<h1 tabIndex="-1">File a travel reimbursement claim</h1>
<p>
You have{' '}
<strong>{`${daysLeft} ${daysLeft === 1 ? 'day' : 'days'}`}</strong> left
to file for your appointment on{' '}
<strong>
{formattedDate} at {appointment.vaos.apiData.location.attributes.name}
</strong>
.
</p>

<h2 className="vads-u-font-size--h3 vad-u-margin-top--0">
Follow the steps below to apply for beneficiary travel claim.
</h2>
<va-process-list>
<va-process-list-item header="Check your travel reimbursement eligibility">
<p>
If you’re eligible for health care travel reimbursement and you have
your direct deposit set up, you can file a reimbursement claim now.
</p>
<va-link
href="https://www.va.gov/health-care/get-reimbursed-for-travel-pay/#eligibility-for-general-health"
text="Travel reimbursement eligibility"
/>
</va-process-list-item>
<va-process-list-item header="File your claim">
<p>
If you’re only claiming mileage, you can file online right now.
We’ll just ask you a few questions—you won’t need receipts.
</p>
<va-link-action
onClick={e => onNext(e)}
href="javascript0:void"
text="File a mileage only claim"
/>

<p>
If you’re claiming other expenses, like lodging, meals, or tolls,
you will need receipts for these expenses. You can file online
through the Beneficiary Travel Self Service System (BTSSS), by mail,
or in person.
</p>
<va-link
href="https://www.va.gov/health-care/get-reimbursed-for-travel-pay/"
text="Learn how to file claims for other expenses"
/>
</va-process-list-item>
</va-process-list>
<va-alert status="info" visible>
<h3 id="set-up-direct-deposit" slot="headline">
Set up direct deposit
</h3>
<p className="vads-u-margin-y--0">
You have to set up direct deposit to receive travel reimbursement. If
you’ve already done this, no additional steps are needed.
</p>
<va-link
external
href="https://www.cep.fsc.va.gov/"
text="Set up direct deposit"
/>
</va-alert>
<div
className="omb-info--container vads-u-margin-y--3"
style={{ paddingLeft: '0px' }}
>
<va-omb-info
res-burden={10}
omb-number="2900-0798"
exp-date="11/30/2027"
/>
</div>

<va-need-help>
<div slot="content">
<HelpTextManage />
</div>
</va-need-help>
</div>
);
};

export default IntroductionPage;
Loading
Loading