diff --git a/.eslintrc.js b/.eslintrc.js index 73021f311090..370efba534eb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -112,6 +112,12 @@ module.exports = { 'jsx-a11y/no-static-element-interactions': 1, // 20 }, overrides: [ + { + files: ['*'], + rules: { + 'cypress/unsafe-to-chain-command': 'warn', + }, + }, { files: [ '**/*.spec.jsx', @@ -120,6 +126,7 @@ module.exports = { 'src/platform/testing/**/*.jsx', ], rules: { + 'cypress/unsafe-to-chain-command': 'warn', 'no-restricted-imports': ['error', 'raven'], 'no-unused-expressions': 0, 'react/no-find-dom-node': 0, @@ -130,9 +137,9 @@ module.exports = { { files: ['**/*.cypress.spec.js'], rules: { + 'cypress/unsafe-to-chain-command': 'warn', '@department-of-veterans-affairs/axe-check-required': 1, '@department-of-veterans-affairs/cypress-viewport-deprecated': 1, - 'cypress/unsafe-to-chain-command': 0, }, }, ], diff --git a/package.json b/package.json index 8df8a68c464e..b1e305a6acbe 100644 --- a/package.json +++ b/package.json @@ -244,6 +244,7 @@ "private": true, "dependencies": { "@babel/runtime": "^7.15.4", + "@department-of-veterans-affairs/css-library": "^0.1.0-rc4", "@department-of-veterans-affairs/component-library": "^19.1.0", "@department-of-veterans-affairs/formation": "^7.0.8", "@department-of-veterans-affairs/react-jsonschema-form": "^1.2.5", diff --git a/src/applications/claims-status/components/ClosedClaimMessage.jsx b/src/applications/claims-status/components/ClosedClaimMessage.jsx index f7f5c02df866..948e036f8db2 100644 --- a/src/applications/claims-status/components/ClosedClaimMessage.jsx +++ b/src/applications/claims-status/components/ClosedClaimMessage.jsx @@ -1,7 +1,15 @@ import React from 'react'; import { Link } from 'react-router'; +import { + format, + getUnixTime, + isAfter, + isValid, + parseISO, + startOfDay, + subDays, +} from 'date-fns'; import { orderBy } from 'lodash'; -import moment from 'moment'; import PropTypes from 'prop-types'; import recordEvent from 'platform/monitoring/record-event'; @@ -25,22 +33,16 @@ const getRecentlyClosedClaims = claims => { // Check if this is an appeal, if so we want to filter it out // if it was closed more than 60 days ago if (isAppeal(claim)) { - const sixtyDaysAgo = moment() - .add(-60, 'days') - .startOf('day'); + const sixtyDaysAgo = startOfDay(subDays(new Date(), 60)); const events = orderBy( claim.attributes.events, - [e => moment(e.date).unix()], + [e => getUnixTime(parseISO(e.date))], ['desc'], ); const lastEvent = events[0]; + const lastEventDate = startOfDay(parseISO(lastEvent.date)); - return ( - !claim.attributes.active && - moment(lastEvent.date) - .startOf('day') - .isAfter(sixtyDaysAgo) - ); + return !claim.attributes.active && isAfter(lastEventDate, sixtyDaysAgo); } // START lighthouse_migration @@ -52,22 +54,16 @@ const getRecentlyClosedClaims = claims => { // If the claim is not an appeal, we want to filter it out // if it was closed more than 30 days ago - return ( - isClosed && - moment(dateClosed || null) - .startOf('day') - .isAfter( - moment() - .add(-30, 'days') - .startOf('day'), - ) - ); + const thirtyDaysAgo = startOfDay(subDays(new Date(), 30)); + const startOfCloseDate = startOfDay(parseISO(dateClosed)); + + return isClosed && isAfter(startOfCloseDate, thirtyDaysAgo); }) .map(c => { if (isAppeal(c)) { const events = orderBy( c.attributes.events, - [e => moment(e.date).unix()], + [e => getUnixTime(parseISO(e.date))], ['desc'], ); return { @@ -98,7 +94,13 @@ const getClaimDate = claim => { }; // END lighthouse_migration -const formatDate = date => moment(date || null).format('MMMM D, YYYY'); +const formatDate = date => { + const parsedDate = parseISO(date); + + return isValid(parsedDate) + ? format(parsedDate, 'MMMM d, yyyy') + : 'Invalid date'; +}; const getLinkText = claim => { const claimType = isAppeal(claim) diff --git a/src/applications/disability-benefits/all-claims/content/itfWrapper.jsx b/src/applications/disability-benefits/all-claims/content/itfWrapper.jsx index 19bc496875b1..512abcc6eb37 100644 --- a/src/applications/disability-benefits/all-claims/content/itfWrapper.jsx +++ b/src/applications/disability-benefits/all-claims/content/itfWrapper.jsx @@ -7,9 +7,13 @@ import { recordEventOnce } from 'platform/monitoring/record-event'; // EVSS returns dates like '2014-07-28T19:53:45.810+0000' const evssDateFormat = 'YYYY-MM-DDTHH:mm:ss.SSSZ'; -const outputDateFormat = 'MMMM DD, YYYY'; +const outputDateFormat = 'dddd MMMM Do[,] Y [at] h[:]ma'; +// Adding 1 hour to the displayDate output will display the time in the ET timezone as the returned time and date +// is in the central timezone const displayDate = dateString => - moment(dateString, evssDateFormat).format(outputDateFormat); + moment(dateString, evssDateFormat) + .add(1, 'hours') + .format(outputDateFormat); export const itfMessage = (headline, content, status) => ( // Inline style to match .full-page-alert bottom margin because usa-grid > :last-child has a @@ -80,15 +84,15 @@ export const itfSuccess = (
Thank you for submitting your Intent to File request for disability compensation. Your Intent to File will expire on{' '} - {displayDate(expirationDate)}. + {displayDate(expirationDate)} ET.
{hasPreviousItf && (Please note: We found a previous Intent to File request - in our records that expired on {displayDate(prevExpirationDate)}. This - ITF might have been from an application you started, but didn’t finish - before the ITF expired. Or, it could have been from a claim you already - submitted. + in our records that expired on{' '} + {displayDate(prevExpirationDate)} ET. This ITF might + have been from an application you started, but didn’t finish before the + ITF expired. Or, it could have been from a claim you already submitted.
)} {expander} @@ -100,7 +104,7 @@ export const itfActive = expirationDate => (Our records show that you already have an Intent to File for disability compensation. Your Intent to File will expire on{' '} - {displayDate(expirationDate)}. You’ll need to submit your claim by this + {displayDate(expirationDate)} ET. You’ll need to submit your claim by this date in order to receive payments starting from your effective date.
{expander} diff --git a/src/applications/ds-v3-playground/pages/V3BasePage.jsx b/src/applications/ds-v3-playground/pages/V3BasePage.jsx index e2a8b725aaa6..a67d59f5b8f0 100644 --- a/src/applications/ds-v3-playground/pages/V3BasePage.jsx +++ b/src/applications/ds-v3-playground/pages/V3BasePage.jsx @@ -113,15 +113,15 @@ export default function V3BasePage() { return ( <> -- {dob - ? 'This is the personal information we have on file for you.' - : 'Here’s the name we have on file for you.'} -
-- {veteranName} -
- - {dob ? ( -- Date of birth: {veteranDOB} -
- ) : null} -
- Note: If you need to update your personal
- information, call our VA benefits hotline at{' '}
-
- You can also call your VA medical center (
-
+ Make sure you meet our eligibility requirements for enrollment before + you apply. +
+
+ Note: We can help connect you with mental health
+ care—no matter your discharge status, service history, or eligibility
+ for VA health care.{' '}
+
- Make sure you meet our eligibility requirements for enrollment - before you apply. + You may be eligible to enroll in VA health care if all of these + statements are true: +
+You must meet at least one of these service requirements:
++ Note: Time spent on active-duty status for training + purposes only doesn’t count toward the service requirements.
- Note: We can help connect you with mental health
- care—no matter your discharge status, service history, or
- eligibility for VA health care.{' '}
-
- You may be eligible to enroll in VA health care if all of these - statements are true: -
-You must meet at least one of these service requirements:
-- Note: Time spent on active-duty status for - training purposes only doesn’t count toward the service - requirements. -
-- - Get instructions on how to apply for a discharge upgrade or - correction - -
- -Here’s what you’ll need to apply:
+We’ll also ask you for this optional information:
+Here’s what you’ll need to apply:
+When you apply, we review this information:
We’ll also ask you for this optional information:
+We use this information to help us decide these 3 things:
+ We give Veterans with service-connected disabilities the highest + priority. +
++ Note: We ask about other health insurance for + billing only. Having other health insurance doesn’t affect your + eligibility for VA health care. +
+When you apply, we review this information:
-We use this information to help us decide these 3 things:
-- We give Veterans with service-connected disabilities the highest - priority. -
-- Note: We ask about other health insurance for - billing only. Having other health insurance doesn’t affect your - eligibility for VA health care. -
-+ We’ll take you through each step of the process. It should take about + 30 minutes. +
++ We process health care applications within about a week. We’ll send + you a letter in the mail with our decision. +
- We’ll take you through each step of the process. It should take
- about 30 minutes.
+ If you don’t receive your decision letter within a week after you
+ apply, please don’t apply again. Call us at{' '}
+
- We process health care applications within about a week. We’ll - send you a letter in the mail with our decision. -
-
- If you don’t receive your decision letter within a week after you
- apply, please don’t apply again. Call us at{' '}
-
+ {veteranDOB + ? 'This is the personal information we have on file for you.' + : 'Here\u2019s the name we have on file for you.'} +
+
+ Note: If you need to update your personal information,
+ call our VA benefits hotline at{' '}
+
+ You can also call your VA medical center (
+
+ Confirm your information before you continue. +
+- This will help us fit the application to your specific needs. Please - fill out the form below. Then we’ll take you to the VA health care - application (10-10EZ). + We need some information before you can start your application. This + will help us fit your application to your specific needs.
+Then you can fill out the VA health care application (10-10EZ).
+Sign in and save time
- Want to skip this step? + You can sign in and confirm that the information we have for you is + up to date and then fill out the VA health care application.