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

Editor-centered management for Veteran-centered content.
https://prod.cms.va.gov
GNU General Public License v2.0
99 stars 68 forks source link

[Web Component] Use the <va-button>web component for the homepage email signup form #17790

Closed FranECross closed 2 weeks ago

FranECross commented 6 months ago

Status

[2024-08-19] [Fran] I believe the DST code was merged and this can now be worked on (if not, it can go back to Blocked/Backlog). Before we can pick up and work this ticket, we need to carefully consider exactly how each of the links are constructed and our technical approach to converting them to web components, if possible.

Description

New story carved off of #17568 for the web component's submit property, because it doesn't work yet, and wasn't submitting the form data. @laflannery discovered an existing DST issue that describes this problem: department-of-veterans-affairs/vets-design-system-documentation#2379.

History:

As part of this ticket: #17277 we attempted to convert the email signup form on the homepage to design system web components. Unfortunately, the simple implementation caused the form not to submit. We will need to explore further how to use the design system components to implement this form.

image.png

User story

End User's Point of View AS A Veteran, or their family member, caregiver or survivor I WANT the email sign up form to submit correctly SO THAT I can get the latest updates from the VA without errors

PO/PM Point of View AS A PO/PM responsible for the sign up form on the VA.gov home page I WANT the email sign up form to utilize web components AND to submit correctly SO THAT we are in alignment with the Design Team's current requests, as well as so that Veterans, their caregivers, family members and survivors can get the latest updates from the VA without errors

Engineering notes / background

This email form is an integration of the GovDelivery platform. Submissions are sent to GovDelivery via the form action https://public.govdelivery.com/accounts/USVACHOOSE/subscribers/qualify and hidden input fields.

Most recently modified here: #11389

Quality / testing notes

Acceptance criteria AC1: Veteran, their family member, caregiver or survivor successfully signs up for VA updates GIVEN: A Veteran, their family member, caregiver or survivor has entered their email address in the form in order to receive updates from the VA WHEN: I click the 'Sign up' button THEN: I want the form to submit my email address successfully so that I then receive updates accordingly

Acceptance critera

randimays commented 5 months ago

@FranECross This ticket is still blocked by https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues/2379.

FranECross commented 5 months ago

@FranECross check progress and move back to blocked.

randimays commented 4 months ago

Pulling in as stretch for sprint 6.

randimays commented 4 months ago

The original DST ticket is closed, but there's still a PR open for the changes and it hasn't been released.

In the DST ticket:

Screenshot 2024-06-26 at 12 11 27 PM

Putting this ticket back into blocked, and we'll need to track the above PR for when we can unblock.

randimays commented 3 months ago

@FranECross We have custom analytics events on the sign up button:

event: 'cta-button-click'
button-type: 'primary'
button-click-label: 'Sign up'

and

event: 'homepage-email-sign-up'
action: 'Homepage email sign up'

When we convert this to a va-button, we will get the URL of the current page, the type of button ("primary") and the text of the button ("Sign up"). Is this sufficient to replace the two custom events above?

Whether we decide to keep the custom events and disable va-button analytics, or remove the custom events and use baked-in analytics, could you please add acceptance criteria for that decision to this ticket?

FranECross commented 3 months ago

@randimays AC added to indicate (1) update to component, (2) enable baked-in analytics, (3) remove custom analytics, and (4) if there are any duplicate events, remove or N/A. Thanks!

FranECross commented 2 weeks ago

The work in this ticket will be done in 19516. Fran to ensure details in this ticket will be in 19516.