-
Notifications
You must be signed in to change notification settings - Fork 123
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
PDF cert warning added to find-form search #22814
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
/* eslint-disable jsx-a11y/no-redundant-roles */ | ||
// Node modules. | ||
import React from 'react'; | ||
|
||
// Relative imports. | ||
import { connect } from 'react-redux'; | ||
import { toggleValues } from 'platform/site-wide/feature-toggles/selectors'; | ||
import FEATURE_FLAG_NAMES from 'platform/utilities/feature-toggles/featureFlagNames'; | ||
|
||
import recordEvent from 'platform/monitoring/record-event'; | ||
import PropTypes from 'prop-types'; | ||
import SearchForm from '../containers/SearchForm'; | ||
import SearchResults from '../containers/SearchResults'; | ||
import recordEvent from 'platform/monitoring/record-event'; | ||
import PdfAlert from './PdfAlert'; | ||
|
||
const onFeaturedContentClick = header => () => { | ||
recordEvent({ | ||
|
@@ -13,111 +20,130 @@ const onFeaturedContentClick = header => () => { | |
}); | ||
}; | ||
|
||
export default () => ( | ||
<> | ||
<SearchForm /> | ||
<SearchResults /> | ||
<h2>Frequently used VA forms</h2> | ||
<p> | ||
You can now do many form-based tasks online, like filing a disability | ||
claim and applying for the GI Bill or VA health care. We'll walk you | ||
through the process step-by-step. | ||
</p> | ||
{/* eslint-disable-next-line jsx-a11y/no-redundant-roles */} | ||
<ul | ||
className="usa-grid usa-grid-full vads-u-margin-top--3 vads-u-margin-bottom--4 vads-u-display--flex vads-u-flex-direction--column medium-screen:vads-u-flex-direction--row" | ||
role="list" | ||
> | ||
<li className="featured-content-list-item vads-u-background-color--primary-alt-lightest vads-u-padding-y--1p5 vads-u-padding-x--1p5 vads-u-margin-bottom--2 medium-screen:vads-u-margin-bottom--0 vads-u-display--flex vads-u-flex-direction--column"> | ||
<h3 className="vads-u-font-size--base vads-u-margin--0"> | ||
File a VA disability claim | ||
</h3> | ||
<hr | ||
aria-hidden="true" | ||
role="presentation" | ||
className="featured-content-hr vads-u-margin-y--1p5 vads-u-border-color--primary" | ||
/> | ||
<p className="va-nav-linkslist-description"> | ||
Equal to VA Form 21-526EZ | ||
</p> | ||
<a | ||
className="vads-u-display--block vads-u-padding-top--1 vads-u-text-decoration--none" | ||
href="/disability/file-disability-claim-form-21-526ez/" | ||
onClick={onFeaturedContentClick('File a VA disability claim')} | ||
> | ||
<span> | ||
Apply online | ||
<span className="vads-u-visibility--screen-reader"> | ||
about filing a VA disability claim | ||
export const FindVaForms = ({ showPdfWarningBanner = false }) => { | ||
return ( | ||
<> | ||
{showPdfWarningBanner && <PdfAlert />} | ||
<SearchForm /> | ||
<SearchResults /> | ||
<h2>Frequently used VA forms</h2> | ||
<p> | ||
You can now do many form-based tasks online, like filing a disability | ||
claim and applying for the GI Bill or VA health care. We’ll walk you | ||
through the process step-by-step. | ||
</p> | ||
{/* eslint-disable-next-line jsx-a11y/no-redundant-roles */} | ||
<ul | ||
className="usa-grid usa-grid-full vads-u-margin-top--3 vads-u-margin-bottom--4 vads-u-display--flex vads-u-flex-direction--column medium-screen:vads-u-flex-direction--row" | ||
role="list" | ||
> | ||
<li className="featured-content-list-item vads-u-background-color--primary-alt-lightest vads-u-padding-y--1p5 vads-u-padding-x--1p5 vads-u-margin-bottom--2 medium-screen:vads-u-margin-bottom--0 vads-u-display--flex vads-u-flex-direction--column"> | ||
<h3 className="vads-u-font-size--base vads-u-margin--0"> | ||
File a VA disability claim | ||
</h3> | ||
<hr | ||
aria-hidden="true" | ||
role="presentation" | ||
className="featured-content-hr vads-u-margin-y--1p5 vads-u-border-color--primary" | ||
/> | ||
<p className="va-nav-linkslist-description"> | ||
Equal to VA Form 21-526EZ | ||
</p> | ||
<a | ||
className="vads-u-display--block vads-u-padding-top--1 vads-u-text-decoration--none" | ||
href="/disability/file-disability-claim-form-21-526ez/" | ||
onClick={onFeaturedContentClick('File a VA disability claim')} | ||
> | ||
<span> | ||
Apply online | ||
<span className="vads-u-visibility--screen-reader"> | ||
about filing a VA disability claim | ||
</span> | ||
<i | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. icon found |
||
aria-hidden="true" | ||
className="fa fa-chevron-right vads-facility-hub-cta-arrow" | ||
role="presentation" | ||
/> | ||
</span> | ||
<i | ||
aria-hidden="true" | ||
className="fa fa-chevron-right vads-facility-hub-cta-arrow" | ||
role="presentation" | ||
/> | ||
</span> | ||
</a> | ||
</li> | ||
<li className="featured-content-list-item vads-u-background-color--primary-alt-lightest vads-u-padding-y--1p5 vads-u-padding-x--1p5 vads-u-margin-bottom--2 medium-screen:vads-u-margin-bottom--0 vads-u-display--flex vads-u-flex-direction--column"> | ||
<h3 className="vads-u-font-size--base vads-u-margin--0"> | ||
Apply for the GI Bill and other education benefits | ||
</h3> | ||
<hr | ||
aria-hidden="true" | ||
role="presentation" | ||
className="featured-content-hr vads-u-margin-y--1p5 vads-u-border-color--primary" | ||
/> | ||
<p className="va-nav-linkslist-description"> | ||
Includes VA Forms 22-1990 and 22-1995 | ||
</p> | ||
<a | ||
className="vads-u-display--block vads-u-padding-top--1 vads-u-text-decoration--none" | ||
href="/education/how-to-apply/" | ||
onClick={onFeaturedContentClick( | ||
'Apply for the GI Bill and other education benefits', | ||
)} | ||
> | ||
<span> | ||
Learn how to apply online | ||
<span className="vads-u-visibility--screen-reader"> | ||
about applying for the GI Bill and other education benefits | ||
</a> | ||
</li> | ||
<li className="featured-content-list-item vads-u-background-color--primary-alt-lightest vads-u-padding-y--1p5 vads-u-padding-x--1p5 vads-u-margin-bottom--2 medium-screen:vads-u-margin-bottom--0 vads-u-display--flex vads-u-flex-direction--column"> | ||
<h3 className="vads-u-font-size--base vads-u-margin--0"> | ||
Apply for the GI Bill and other education benefits | ||
</h3> | ||
<hr | ||
aria-hidden="true" | ||
role="presentation" | ||
className="featured-content-hr vads-u-margin-y--1p5 vads-u-border-color--primary" | ||
/> | ||
<p className="va-nav-linkslist-description"> | ||
Includes VA Forms 22-1990 and 22-1995 | ||
</p> | ||
<a | ||
className="vads-u-display--block vads-u-padding-top--1 vads-u-text-decoration--none" | ||
href="/education/how-to-apply/" | ||
onClick={onFeaturedContentClick( | ||
'Apply for the GI Bill and other education benefits', | ||
)} | ||
> | ||
<span> | ||
Learn how to apply online | ||
<span className="vads-u-visibility--screen-reader"> | ||
about applying for the GI Bill and other education benefits | ||
</span> | ||
<i | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. icon found |
||
aria-hidden="true" | ||
className="fa fa-chevron-right vads-facility-hub-cta-arrow" | ||
role="presentation" | ||
/> | ||
</span> | ||
<i | ||
aria-hidden="true" | ||
className="fa fa-chevron-right vads-facility-hub-cta-arrow" | ||
role="presentation" | ||
/> | ||
</span> | ||
</a> | ||
</li> | ||
<li className="featured-content-list-item vads-u-background-color--primary-alt-lightest vads-u-padding-y--1p5 vads-u-padding-x--1p5 vads-u-margin-bottom--2 medium-screen:vads-u-margin-bottom--0 vads-u-display--flex vads-u-flex-direction--column"> | ||
<h3 className="vads-u-font-size--base vads-u-margin--0"> | ||
Apply for VA health care | ||
</h3> | ||
<hr | ||
aria-hidden="true" | ||
role="presentation" | ||
className="featured-content-hr vads-u-margin-y--1p5 vads-u-border-color--primary" | ||
/> | ||
<p className="va-nav-linkslist-description">Equal to VA Form 10-10EZ</p> | ||
<a | ||
className="vads-u-display--block vads-u-padding-top--1 vads-u-text-decoration--none" | ||
href="/health-care/apply/application/" | ||
onClick={onFeaturedContentClick('Apply for VA health care benefits')} | ||
> | ||
<span> | ||
Apply online | ||
<span className="vads-u-visibility--screen-reader"> | ||
about applying for VA health care benefits | ||
</a> | ||
</li> | ||
<li className="featured-content-list-item vads-u-background-color--primary-alt-lightest vads-u-padding-y--1p5 vads-u-padding-x--1p5 vads-u-margin-bottom--2 medium-screen:vads-u-margin-bottom--0 vads-u-display--flex vads-u-flex-direction--column"> | ||
<h3 className="vads-u-font-size--base vads-u-margin--0"> | ||
Apply for VA health care | ||
</h3> | ||
<hr | ||
aria-hidden="true" | ||
role="presentation" | ||
className="featured-content-hr vads-u-margin-y--1p5 vads-u-border-color--primary" | ||
/> | ||
<p className="va-nav-linkslist-description"> | ||
Equal to VA Form 10-10EZ | ||
</p> | ||
<a | ||
className="vads-u-display--block vads-u-padding-top--1 vads-u-text-decoration--none" | ||
href="/health-care/apply/application/" | ||
onClick={onFeaturedContentClick( | ||
'Apply for VA health care benefits', | ||
)} | ||
> | ||
<span> | ||
Apply online | ||
<span className="vads-u-visibility--screen-reader"> | ||
about applying for VA health care benefits | ||
</span> | ||
<i | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. icon found |
||
aria-hidden="true" | ||
className="fa fa-chevron-right vads-facility-hub-cta-arrow" | ||
role="presentation" | ||
/> | ||
</span> | ||
<i | ||
aria-hidden="true" | ||
className="fa fa-chevron-right vads-facility-hub-cta-arrow" | ||
role="presentation" | ||
/> | ||
</span> | ||
</a> | ||
</li> | ||
</ul> | ||
</> | ||
); | ||
</a> | ||
</li> | ||
</ul> | ||
</> | ||
); | ||
}; | ||
|
||
FindVaForms.propTypes = { | ||
showPdfWarningBanner: PropTypes.bool, | ||
}; | ||
|
||
const mapStateToProps = state => ({ | ||
showPdfWarningBanner: toggleValues(state)[ | ||
FEATURE_FLAG_NAMES.pdfWarningBanner | ||
], | ||
}); | ||
|
||
export default connect(mapStateToProps)(FindVaForms); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
const PdfAlert = () => { | ||
const pdfCertWarningId = 'pdf-cert-warning'; | ||
const pdfCertWarningElement = document.getElementById(pdfCertWarningId); | ||
const [ | ||
pdfCertWarningElementCreated, | ||
setPdfCertWarningElementCreated, | ||
] = useState(false); | ||
|
||
useEffect(() => { | ||
const domNode = document.createElement('div'); | ||
domNode.setAttribute('id', pdfCertWarningId); | ||
|
||
const introTextNode = document.getElementsByClassName('va-introtext')[0]; | ||
const introTextParentNode = introTextNode?.parentNode; | ||
if (introTextNode && introTextParentNode) { | ||
introTextParentNode.insertBefore(domNode, introTextNode); | ||
setPdfCertWarningElementCreated(true); | ||
} | ||
}, []); | ||
|
||
if (!pdfCertWarningElementCreated || !pdfCertWarningElement) { | ||
return <></>; | ||
} | ||
|
||
return ReactDOM.createPortal( | ||
<va-alert> | ||
<h2 slot="headline" className="vads-u-font-size--h3"> | ||
We’re updating our forms | ||
</h2> | ||
<p> | ||
After January 7, 2023, you won’t be able to use VA forms that have a | ||
“last updated” date before March 2022. If you downloaded any of these | ||
older VA forms, you may need to download new copies in January. | ||
</p> | ||
</va-alert>, | ||
pdfCertWarningElement, | ||
); | ||
}; | ||
|
||
export default PdfAlert; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint disabled here