department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
282 stars 203 forks source link

Update toxic exposure page visibility logic #83849

Closed freeheeling closed 4 months ago

freeheeling commented 5 months ago

Issue Description

Utilize new attribute, includeToxicExposure, in formData prefilled by vets-api to determine whether to show toxic exposure section of form 526.

Front end tasks

Acceptance Criteria

Appendix

Ensure your code changes are covered by E2E tests (expand) - Add E2E tests if none exist for this addition/change. - Update existing E2E tests if this code will change functionality. - Include axe checks, including hidden content
Run axe checks using the Chrome or Firefox browser plugin (expand) - Ensure no heading levels are skipped. - Ensure all buttons and labeled inputs use semantic HTML elements. - Ensure all buttons, labeled elements and images are identified using HTML semantic markers or ARIA roles. - Ensure form fields have clearly defined boundaries or outlines. - Ensure form fields do not use placeholder text. - Ensure form fields have highly visible and specific error states.
Test for color contrast and color blindness issues (expand) - All text has appropriate contrast.
Zoom layouts to 400% at 1280px width (expand) - Ensure readability and usability are supported when zoomed up to 400% at 1280px browser width - Ensure no content gets focused offscreen or is hidden from view.
Test with 1 or 2 screen readers (expand) - Ensure the page includes a skip navigation link. - Ensure all links are properly descriptive. - Ensure screen reader users can hear the text equivalent for each image conveying information. - Ensure screen reader users can hear the text equivalent for each image button. - Ensure screen reader users can hear labels and instructions for inputs. - Ensure purely decorative images are not announced by the screenreader.
Navigate using the keyboard only (expand) - Ensure all links (navigation, text and/or image), form controls and page functions can be reached with the tab key in a logical order. - Ensure all links (navigation, text and/or image), form controls and page functions can be triggered with the spacebar, enter key, or arrow keys. - Ensure all interactive elements can be reached with the tab key in a logical order - Ensure all interactive elements can be triggered with the spacebar, enter key, or arrow keys. - Ensure focus is always visible and appears in logical order. - Ensure each interactive element has visible focus state which appears in logical order.

How to configure this issue

tblackwe commented 4 months ago

@freeheeling please update this ticket to reflect the new design.

freeheeling commented 4 months ago

Ticket title and description have been updated to reflect new approach/design.

freeheeling commented 4 months ago

Utilize the presence of the includeToxicExposure attribute in formData to determine the form version to present to a user.

Confirm that with each PUT request to v0/disability_compensation_in_progress_forms/21-526EZ, the frontend is accepting and returning the new includeToxicExposure attribute in 'formData`, set and sent by vets-api when starting/creating a new IPF.

A user can choose to apply now from /disability/file-disability-claim-form-21-526ez/start and starts the Disability Compensation Application from the /disability/file-disability-claim-form-21-526ez/introduction, the latter of which includes the form expiration date.

Network requests on both pages get feature toggle data from /v0/feature_toggles?&cookie_id=<id>, indicating the toxic exposure Flipper state for the current user:

{
  "name": "disability526ToxicExposure",
  "value": boolean
},
{
  "name": "disability_526_toxic_exposure",
  "value": boolean
},

Selecting start application requests from /v0/disability_compensation_in_progress_forms/21-526EZ vets-api, which responds with formData that includes the includeToxicExposure attribute for a user whose disability_526_toxic_exposure Flipper is enabled.

Thus, the FE must first evaluate the feature toggle in determining which expiration date to display (note: the date change will be implemented after rollout is complete, and will therefore not be dependent on the feature toggle). Then, throughout the duration of an In Progress Form's existence, wherever the toggle would otherwise be evaluated, the presence of the includeToxicExposure attribute in the formData should be referenced in determining the form version.

freeheeling commented 4 months ago

Screenshot 2024-06-12 at 3 28 26 PM Screenshot 2024-06-12 at 3 28 04 PM