Skip to content

Commit

Permalink
Merge branch 'main' into tk/SOBupdates
Browse files Browse the repository at this point in the history
  • Loading branch information
flex2016 authored Jan 16, 2025
2 parents 26afb80 + 68031f8 commit 5b1af64
Show file tree
Hide file tree
Showing 543 changed files with 14,333 additions and 13,716 deletions.
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ src/applications/proxy-rewrite @department-of-veterans-affairs/platform-design-s
src/applications/auth @department-of-veterans-affairs/octo-identity @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/login @department-of-veterans-affairs/octo-identity @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/sign-in-changes @department-of-veterans-affairs/octo-identity @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/static-pages/cta-widget @department-of-veterans-affairs/octo-identity @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/terms-of-use @department-of-veterans-affairs/octo-identity @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/verify @department-of-veterans-affairs/octo-identity @department-of-veterans-affairs/va-platform-cop-frontend
src/platform/site-wide/ebenefits/ @department-of-veterans-affairs/octo-identity @department-of-veterans-affairs/va-platform-cop-frontend
Expand Down Expand Up @@ -134,14 +135,13 @@ src/applications/find-forms @department-of-veterans-affairs/vfs-public-websites-
src/applications/discharge-wizard @department-of-veterans-affairs/vfs-public-websites-frontend @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/income-limits @department-of-veterans-affairs/vfs-public-websites-frontend @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/public-outreach-materials @department-of-veterans-affairs/vfs-public-websites-frontend @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/search @department-of-veterans-affairs/vfs-public-websites-frontend @department-of-veterans-affairs/1010-health-apps-frontend @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/search @department-of-veterans-affairs/vfs-public-websites-frontend @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/static-pages/BTSSS-login @department-of-veterans-affairs/vfs-public-websites-frontend @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/static-pages/cta-widget @department-of-veterans-affairs/vfs-public-websites-frontend @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/static-pages/events @department-of-veterans-affairs/vfs-public-websites-frontend @department-of-veterans-affairs/vfs-facilities-frontend @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/static-pages/homepage @department-of-veterans-affairs/vfs-public-websites-frontend @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/static-pages/homepage-veteran-banner @department-of-veterans-affairs/vfs-public-websites-frontend @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/static-pages/i18select @department-of-veterans-affairs/vfs-public-websites-frontend @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/resources-and-support @department-of-veterans-affairs/vfs-public-websites-frontend @department-of-veterans-affairs/1010-health-apps-frontend @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/resources-and-support @department-of-veterans-affairs/vfs-public-websites-frontend @department-of-veterans-affairs/va-platform-cop-frontend
src/applications/pact-act @department-of-veterans-affairs/vfs-public-websites-frontend @department-of-veterans-affairs/va-platform-cop-frontend

# Public Websites - unauthed experience only
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@
"@babel/runtime": "^7.15.4",
"@datadog/browser-logs": "^5.8.0",
"@datadog/browser-rum": "^4.49.0",
"@department-of-veterans-affairs/component-library": "^48.3.0",
"@department-of-veterans-affairs/css-library": "^0.16.1",
"@department-of-veterans-affairs/component-library": "^48.4.0",
"@department-of-veterans-affairs/css-library": "^0.17.0",
"@department-of-veterans-affairs/react-jsonschema-form": "^1.2.5",
"@department-of-veterans-affairs/va-forms-system-core": "1.6.1",
"@department-of-veterans-affairs/vagov-platform": "^0.0.1",
Expand Down Expand Up @@ -335,7 +335,7 @@
"url-search-params-polyfill": "^8.1.1",
"uswds": "1.6.10",
"vanilla-lazyload": "^16.1.0",
"vets-json-schema": "https://github.com/department-of-veterans-affairs/vets-json-schema.git#35ca8ea9a798407936e20ccf76a4be0fd75a8f76",
"vets-json-schema": "https://github.com/department-of-veterans-affairs/vets-json-schema.git#75b0a0dd78b479e230867e89989bf3e8262d850c",
"web-vitals": "^4.2.4"
},
"resolutions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { PAGE_TITLE } from '../config/constants';
export const IntroductionPageHeader = () => (
<>
<FormTitle title={PAGE_TITLE} />
<p className="vads-u-font-size--h3 vads-u-margin-bottom--0 vads-u-margin-top--neg3">
<p className="vads-u-font-size--h3 vads-u-margin-top--neg1">
VA Form 21-686c and 21-674
</p>
</>
Expand Down
2 changes: 2 additions & 0 deletions src/applications/686c-674/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ export const NETWORTH_VALUE = '159,240';
export const FORMAT_YMD_DATE_FNS = 'yyyy-MM-dd';
export const FORMAT_COMPACT_DATE_FNS = 'MMM d, yyyy';
export const FORMAT_READABLE_DATE_FNS = 'MMMM d, yyyy';

export const V2_LAUNCH_DATE = 'March 27th, 2025'; // TBD - update after launch
7 changes: 4 additions & 3 deletions src/applications/686c-674/containers/ConfirmationPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export default function ConfirmationPage() {
const form = useSelector(state => state?.form);

const { submission, data } = form;
const formSubmissionId = submission?.response?.formSubmissionId;
const response = submission?.response ?? {};
const confirmationNumber = response?.attributes?.confirmationNumber;
const veteranFirstName = data?.veteranInformation?.fullName?.first || '';
const veteranLastName = data?.veteranInformation?.fullName?.last || '';

Expand All @@ -29,11 +30,11 @@ export default function ConfirmationPage() {
return (
<>
<va-alert status="success" class="vads-u-margin-bottom--4" uswds>
<h3>Form submission started on August 15, 2024</h3>
<h3>Form submission started on {dateSubmitted}</h3>
<p className="vads-u-margin-y--0">Your submission is in progress.</p>
<p>
It can take up to 10 days for us to receive your form. Your
confirmation number is {formSubmissionId}.
confirmation number is {confirmationNumber}.
</p>
<va-link-action
href="/my-va/"
Expand Down
18 changes: 14 additions & 4 deletions src/applications/686c-674/containers/IntroductionPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
VaFileNumberMissingAlert,
ServerErrorAlert,
} from '../config/helpers';
import { V2_LAUNCH_DATE } from '../config/constants';

const IntroductionPage = props => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -62,7 +63,6 @@ const IntroductionPage = props => {
) : (
<div className="schemaform-intro">
<IntroductionPageHeader />
<IntroductionPageFormProcess />
<SaveInProgressIntro
{...props}
hideUnauthedStartLink
Expand All @@ -73,12 +73,22 @@ const IntroductionPage = props => {
pageList={props.route.pageList}
startText="Add or remove a dependent"
headingLevel={2}
/>
>
<p className="vads-u-margin-bottom--4">
You should also know that we updated our online form.{' '}
<strong>
If you started applying online before {V2_LAUNCH_DATE},
</strong>{' '}
you’ll need to review the information in your application.Select
Continue your application to use our updated form.
</p>
</SaveInProgressIntro>
<IntroductionPageFormProcess />
<div className="omb-info--container vads-u-padding-left--0 vads-u-margin-top--2">
<va-omb-info
res-burden={30}
omb-number="2900-0043"
exp-date="09/30/2021"
omb-number="2900-0009"
exp-date="08/31/2025"
/>
</div>
</div>
Expand Down
16 changes: 13 additions & 3 deletions src/applications/_mock-form-ae-design-patterns/app-entry.jsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
import 'platform/polyfills';
import './sass/_mock-form-ae-design-patterns.scss';

import startApp from 'platform/startup';
import routes from './routes';
import reducer from './reducers';
import manifest from './manifest.json';

import coeReducer from './patterns/pattern2/TaskGray/shared/reducers';
import { asyncStartApp } from './utils/asyncStartApp';

const combinedReducers = {
...reducer,
certificateOfEligibility: coeReducer.certificateOfEligibility,
};

startApp({
const createRoutes = initialRoutes => {
// here we can do some async stuff
// maybe we change the routes based on the state or other api call responses?
// this could be where we add or remove routes for the contact info that is missing for a user
// replace () with (store) to access the store and use it to determine the routes
return () => {
return initialRoutes;
};
};

asyncStartApp({
entryName: manifest.entryName,
url: manifest.rootUrl,
reducer: combinedReducers,
routes,
createAsyncRoutesWithStore: createRoutes(routes),
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ import { useState, useEffect } from 'react';
* useLocalStorage is a hook that provides a way to store and retrieve values from localStorage
* @param {string} key - The key to store the value under
* @param {any} defaultValue - The default value to use if the key does not exist
* @param {boolean} json - Whether to parse the value as JSON, this way a stringified object can be stored and retrieved as an object
* @returns {array} An array with [value, setValue, clearValue]
*/
export const useLocalStorage = (key, defaultValue) => {
export const useLocalStorage = (key, defaultValue, json = false) => {
const [value, setValue] = useState(() => {
let currentValue;

try {
const item = localStorage.getItem(key);
if (item === null) {
currentValue = defaultValue;
} else if (item.startsWith('{') || item.startsWith('[')) {
} else if (json && (item.startsWith('{') || item.startsWith('['))) {
currentValue = JSON.parse(item);
} else {
currentValue = item;
Expand All @@ -29,14 +30,21 @@ export const useLocalStorage = (key, defaultValue) => {

useEffect(
() => {
localStorage.setItem(key, JSON.stringify(value));
if (value === null) {
localStorage.removeItem(key);
return;
}
if (json) {
localStorage.setItem(key, JSON.stringify(value));
return;
}
localStorage.setItem(key, value);
},
[value, key],
[value, key, json],
);

const clearValue = () => {
localStorage.removeItem(key);
setValue(defaultValue);
setValue(null);
};

return [value, setValue, clearValue];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,41 @@ import { useEffect, useMemo } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { teardownProfileSession } from 'platform/user/profile/utilities';
import { updateLoggedInStatus } from 'platform/user/authentication/actions';
import { refreshProfile } from 'platform/user/exportsFile';
import { initializeProfile } from 'platform/user/profile/actions';

import { useLocalStorage } from './useLocalStorage';

// useMockedLogin is a hook that provides a way to log in and out of the application
// it also provides a way to check if the user is logged in
// used for local development
export const useMockedLogin = () => {
const [
localHasSession,
setLocalHasSession,
clearLocalHasSession,
] = useLocalStorage('hasSession', '');
] = useLocalStorage('hasSession', null);

const loggedInFromState = useSelector(
state => state?.user?.login?.currentlyLoggedIn,
);

/**
* memoized value that is true if the local storage has a session or the redux store has a logged in status
* @returns {boolean}
*/
const loggedIn = useMemo(
() => localHasSession === 'true' || loggedInFromState,
() => localHasSession === 'true' && loggedInFromState,
[localHasSession, loggedInFromState],
);

const dispatch = useDispatch();

const logIn = () => {
setLocalHasSession('true');
dispatch(initializeProfile());
dispatch(updateLoggedInStatus(true));
// get the profile right away, so that user state is updated in the redux store
dispatch(refreshProfile());
};

const logOut = () => {
Expand All @@ -35,6 +45,12 @@ export const useMockedLogin = () => {
clearLocalHasSession();
};

/**
* useLoggedInQuery is a hook that checks the url query params for loggedIn=true or loggedIn=false
* and sets the local storage and redux store accordingly
* @param {*} location - the location object from react router
* @returns {void}
*/
const useLoggedInQuery = location => {
useEffect(
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,73 @@ const loa3UserWithUpdatedHomePhoneTimeStamp = set(
);

const loa3UserWithUpdatedMailingAddress = set(
set(
cloneDeep(loa3User),
'data.attributes.vet360ContactInformation.mailingAddress.addressLine1',
'345 Mailing Address St.',
),
'data.attributes.vet360ContactInformation.mailingAddress.updatedAt',
new Date().toISOString(),
);

const loa3UserWithNoEmail = set(
cloneDeep(loa3User),
'data.attributes.vet360ContactInformation.email',
{},
);

const loa3UserWithNoContactInfo = set(
cloneDeep(loa3User),
'data.attributes.vet360ContactInformation.mailingAddress.addressLine1',
'345 Mailing Address St.',
'data.attributes.vet360ContactInformation',
{
email: {
...loa3User.data.attributes.vet360ContactInformation.email,
emailAddress: '',
},
homePhone: {
...loa3User.data.attributes.vet360ContactInformation.homePhone,
phoneNumber: '',
areaCode: '',
countryCode: '',
phoneType: '',
},
mobilePhone: {
...loa3User.data.attributes.vet360ContactInformation.mobilePhone,
phoneNumber: '',
areaCode: '',
countryCode: '',
phoneType: '',
},
mailingAddress: {
...loa3User.data.attributes.vet360ContactInformation.mailingAddress,
addressLine1: '',
addressLine2: '',
addressLine3: '',
city: '',
stateCode: '',
zipCode: '',
countryCodeIso2: '',
countryCodeIso3: '',
countryCodeFips: '',
countyCode: '',
countyName: '',
createdAt: '',
effectiveEndDate: '',
effectiveStartDate: '',
geocodeDate: '',
geocodePrecision: '',
id: '',
internationalPostalCode: '',
latitude: '',
longitude: '',
},
},
);

module.exports = {
loa3User,
loa3UserWithUpdatedHomePhoneTimeStamp,
loa3UserWithUpdatedMailingAddress,
loa3UserWithNoEmail,
loa3UserWithNoContactInfo,
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,30 @@ const dfns = require('date-fns');
const fetch = require('node-fetch');
const { warn, error, success, debug } = require('../utils');

const cwd = process.cwd();
const findBuildRoot = startDir => {
let currentDir = startDir;

const buildLocalhostPath = './build/localhost/data/cms/vamc-ehr.json';
// Walk up until we find .build or hit the root
while (currentDir !== path.parse(currentDir).root) {
const buildPath = path.join(currentDir, 'build');

const urlForStagingVamcDSOT = 'https://staging.va.gov/data/cms/vamc-ehr.json';
const pathToSaveData = path.join(cwd, buildLocalhostPath);
if (fs.existsSync(buildPath)) {
return currentDir;
}

currentDir = path.dirname(currentDir);
}

throw new Error('Could not find .build directory in parent directories');
};

const buildRoot = findBuildRoot(__dirname);
const pathToSaveData = path.join(
buildRoot,
'build/localhost/data/cms/vamc-ehr.json',
);

const urlForStagingVamcDSOT = 'https://staging.va.gov/data/cms/vamc-ehr.json';
const amount = 14;
const twoWeeksAgo = dfns.subDays(new Date(), amount);

Expand Down
Loading

0 comments on commit 5b1af64

Please sign in to comment.