-
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
Conversation
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.
Icon found
Icons can be decorative, but sometimes they are used to convey meaning. If there are any semantics associated with an icon, those semantics should also be conveyed to a screen reader.
What you can do
Review the markup and see if the icon provides information that isn't represented textually, or wait for a VSP review.
<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 comment
The reason will be displayed to describe this comment to others. Learn more.
icon found
<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 comment
The reason will be displayed to describe this comment to others. Learn more.
icon found
<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 comment
The reason will be displayed to describe this comment to others. Learn more.
icon found
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 is disabled
vets-website
uses ESLint to help enforce code quality. In most situations we would like ESLint to remain enabled.
What you can do
See if the code can be refactored to avoid disabling ESLint, or wait for a VSP review.
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 */} |
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
This looks good to me, tested with NVDA as well |
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.
This looks good to me.
<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> |
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.
@wesrowe flag: the copy in our ticket doesn't match the copy Laura provided in department-of-veterans-affairs/va.gov-team#48458 (comment). Can you confirm whether our ticket copy is ok to merge, or needs to be updated to use the SWC copy provided?
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.
You said "okay to merge" – reminder that this should not be merged since that's our strategy for holding it back for Collab Cycle review.
So to your question about content...
What happened on the Search page is that SWContent proposed an update to the copy to include a "dec 15" date when all forms will have been updated, and I missed the github comment. We don't have any confirmation that is going to be the date, so I don't think we should commit to it to Vets. So for the Search page, really I think it's safe to release as it is in the PR and the issue Josh worked from. (And go to Staging Review with that version.)
Same for the Form Detail page. SWContent proposed adding the "Dec 15" – which would be a nice "next steps" detail to offer if it were safe to offer it. But we can't commit at this time to Dec 15 resolution of last few forms. So for that PR I say stick with the copy we have.
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.
Good catch, thx.
<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>`; | ||
|
||
document |
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.
CONSIDER
React provides a first-class way of handling this sort of thing, called portals. It allows us a way to render a child component outside of its parent's DOM hierarchy while keeping the component within the parent's React tree. In this case, we do still need to create a DOM node that we can set as the target of the portal, so we will still have some imperative, side-effect code to create that node (i.e. document.createElement
). The code that actually renders the content, though, remains declarative, first-class React code.
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 const FindVaForms = ({ showPdfWarningBanner }) => {
return (
<>
{showPdfWarningBanner && <PdfAlert />}
<SearchForm />
<SearchResults />
...
...
</>
);
This change is not critical, especially for code that is temporary. It actually makes the code longer, as well, but it's more idiomatic. We'd need to implement in this fashion, say, if we needed events to bubble from the child component up to the parent. As it currently is implemented, the "child" is completely removed from its React "parent".
d673e54
to
b7583d3
Compare
showPdfWarningBanner: toggleValues(state)[ | ||
FEATURE_FLAG_NAMES.pdfWarningBanner || false | ||
], |
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.
It looks like the fallback (... || false
) might be in the wrong place here. I think it should be outside the brackets.
That said, it might be even better to define a default value for this property on the component definition and then just leave this map function to set a possibly undefined value.
export const FindVaForms = ({ showPdfWarningBanner = false }) => {
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.
good call, on it
Description
Adds an info banner to the find-a-form search page
Original issue(s)
department-of-veterans-affairs/va.gov-cms#11021
Testing done
Tested locally both pointed at staging and prod to test flipper logic functionality
QA Steps:
1: Point local api to prod to verify that the alert does not render, to staging to see that it does
2. Navigate to /find-forms/
3. Verify that the alert renders above the va-introtext
Screenshots
Acceptance Criteria
Definition of done