Skip to content
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

Sitewide integration: R&S Checklist migration #837

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

randimays
Copy link
Contributor

@randimays randimays commented Dec 12, 2024

Description

Combines the contents of Sitewide-integration with main. This integration branch was created to avoid merging any code into main before Events were successfully deployed to production. Now that the Events deploy has been successfully validated in production, we can move in this code and stop using an integration branch.

The code that is in this branch was added as part of the Checklist template code and includes updates to existing components to bring them up to speed with production and updates of the design system dependencies.

Details for each update are in these PRs:

Ticket

Relates to #19386

Developer Task

Tasks

Preview Give feedback

Testing Steps

Explain the steps needed for testing

QA steps

What needs to be checked to prove this works?
What needs to be checked to prove it didn't break any related things?
What variations of circumstances (users, actions, values) need to be checked?

  • Check the Events page(s) to ensure there are no unexpected regressions
  • App should build successfully
  • App should not have any type(script) errors
  • All tests should pass

Screenshots

Note that testing was specifically regression checks for the /outreach-and-events/events page and individual event pages. Since there were updates to the design system dependencies, spacing here and there has been updated and is expected.

Events - Desktop

/outreach-and-events/events

Note: the underlines on the pagination numbers are also not showing on the main branch, but they appear fine in production - not sure why this is.

Before After
Screenshot 2024-12-12 at 11 58 12 AM Screenshot 2024-12-12 at 11 58 17 AM
Screenshot 2024-12-12 at 12 07 37 PM Screenshot 2024-12-12 at 12 07 45 PM

/central-western-massachusetts-health-care/events/73034/

Before After
Screenshot 2024-12-12 at 12 09 21 PM Screenshot 2024-12-12 at 12 09 15 PM
Screenshot 2024-12-12 at 12 10 59 PM Screenshot 2024-12-12 at 12 11 07 PM

/outreach-and-events/events/75180/

Before After
Screenshot 2024-12-12 at 12 24 05 PM Screenshot 2024-12-12 at 12 23 59 PM
Screenshot 2024-12-12 at 12 24 54 PM Screenshot 2024-12-12 at 12 24 47 PM

Events - Tablet

/outreach-and-events/events

Before After
Screenshot 2024-12-12 at 12 12 14 PM Screenshot 2024-12-12 at 12 12 20 PM

Events - Mobile

/outreach-and-events/events

Before After
Screenshot 2024-12-12 at 12 15 56 PM Screenshot 2024-12-12 at 12 15 50 PM

/outreach-and-events/events/75180/

Before After
Screenshot 2024-12-12 at 12 18 06 PM Screenshot 2024-12-12 at 12 18 00 PM
Screenshot 2024-12-12 at 12 18 52 PM Screenshot 2024-12-12 at 12 18 46 PM

/central-western-massachusetts-health-care/events/73034/

Before After
Screenshot 2024-12-12 at 12 21 05 PM Screenshot 2024-12-12 at 12 21 00 PM
Screenshot 2024-12-12 at 12 22 00 PM Screenshot 2024-12-12 at 12 21 53 PM

Is this PR blocked by another PR?

  • Add the DO NOT MERGE label
  • Add links to additional PRs here:

Reviewer

Reviewing a PR

This section lists items that need to be checked or updated when making changes to this repository.

Standard Checks

Tasks

Preview Give feedback

Merging an Approved Layout

When merging a layout, you must ensure that the content type has been turned on for next-build inside the CMS. This CMS flag must be turned on for editors to preview their work using the next build preview server.

Resource types (layouts) that have not been approved by design should NOT be pushed to production. Ensure that slug.tsx does not include your resource type if it is not approved.

The status of layouts should be kept up to date inside templates.md. This includes QA progress, development progress, etc. A link should be provided for where testing can occur.

Merging a Non-Approved Layout

Your new resource type should not be included inside slug.tsx. Items added here will go into production once merged into the main branch. It is imperative that we do not push anything live that has not been approved.

Ensure that this layout has been added to the templates.md file with the current status of the work.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 12, 2024 18:08 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 12, 2024 18:27 Destroyed
@randimays randimays marked this pull request as ready for review December 12, 2024 18:30
@randimays randimays force-pushed the Sitewide-integration branch from 70dbef9 to 6bdf487 Compare December 16, 2024 15:42
@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 16, 2024 15:42 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 16, 2024 20:42 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat December 16, 2024 20:51 Destroyed
@jilladams jilladams changed the title Sitewide integration Sitewide integration: R&S Checklist migration Jan 24, 2025
Copy link
Contributor

@cvalarida cvalarida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this all looks good to me. The only thing I couldn't account for was the src/templates/common/meta/index.tsx. I'm maybe just blind, but I couldn't find it in any of those PRs or as a separate commit in the history of this branch. 😕

Other than that, I think we're golden. Before I approve, I'd like to test it locally (or in a preview server, honestly, if those are up and running 🤞). What's the best way to do that?

README.md Outdated
@@ -34,7 +34,9 @@ You should set these up before attempting to install the repo.

7. In the `next-build` directory, run `yarn setup` to pull initial built assets from the `vets-website` repo. This will grab a bunch of files from a vets-website S3 bucket and place them into the appropriate `public/` folders.

8. Run `yarn dev`.
8. In your `envs/.env.local` file, uncomment `FEATURE_NEXT_BUILD_CONTENT_ALL=true`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be uncommented by default in #884

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove this change.

additional.d.ts Outdated
Comment on lines 33 to 35
'va-link-action'
'va-on-this-page'
'va-telephone'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own clarity: The va-link-action and va-telephone are net new here.

Comment on lines +1 to +3
/**
* @jest-environment node
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/**
* @jest-environment node
*/
/**
* @jest-environment node
*/

@@ -1,51 +1,51 @@
import { createQueries } from 'next-drupal-query'
import * as PressRelease from './pressRelease'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own clarity: I just copied the before and after into files, sorted the before, and did a diff against the after. They're all the same imports, just alphabetized.

@@ -13,15 +13,7 @@ import dynamic from 'next/dynamic'
import Script from 'next/script'
import { drupalClient } from '@/lib/drupal/drupalClient'
import { getGlobalElements } from '@/lib/drupal/getGlobalElements'
import { Wrapper } from '@/templates/layouts/wrapper'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own clarity: All these are the same, just reorganized.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@randimays Why was this deleted? I assume it's not used, right? I looked in the original PR, but didn't see a comment for this one.

How can I double-check that it doesn't break anything?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I'm struggling with this one. 😅 I can't seem to find it in any of those PRs you listed up top. What's the story behind this change?

Comment on lines +26 to +40
expect(container.innerHTML).toContain(
'Eligibility for burial in a VA national cemetery'
)
expect(container.innerHTML).toContain(
'href="https://va.gov/burials-memorials/eligibility"'
)
expect(container.innerHTML).toContain(
'Here is a summary for this URL so you can see how it displays underneath.'
)
expect(container.innerHTML).toContain(
'Schedule a burial for a Veteran or family member'
)
expect(container.innerHTML).toContain(
'href="https://va.gov/burials-memorials/schedule-a-burial"'
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we're not using semantic queries here?

const links = container.getAllByRole('link');
expect(links).toHaveLength(2);
// etc.

Or even

const first = container.querySelector('[href="https://va.gov/burials-memorials/eligibility"]');
// etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The <a> tags are in the shadow DOM (of the va-link web component). Unfortunately the test runner can't find them by role.

Screenshot 2025-02-14 at 11 43 03 AM Screenshot 2025-02-14 at 11 43 14 AM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhh, that makes sense! Thanks!

I may fiddle around with that at some point. Not sure if this is a problem because we just aren't hydrating the web components in our test setup, the way JSDOM handles web components, or something else. 🤔 For now, this looks fine. If I get the chance, I'll see if I can fix this up in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There has been quite a bit of talk around trying to get access to the shadow DOM in unit tests (see here minimally; there are lots of results if you search DSVA Slack for "shadow DOM unit test"). If you manage to get it working, definitely wave the victory flag somewhere - lots of folks will be interested :D

@randimays randimays force-pushed the Sitewide-integration branch from 6801613 to a628053 Compare February 14, 2025 16:14
@randimays randimays requested review from a team as code owners February 14, 2025 16:14
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 14, 2025 16:14 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 14, 2025 16:29 Destroyed
@randimays randimays force-pushed the Sitewide-integration branch from c57dbb7 to 5918b87 Compare February 14, 2025 17:46
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 14, 2025 17:46 Destroyed
@randimays
Copy link
Contributor Author

@cvalarida I don't see changes to src/templates/common/meta/index.tsx. I just updated the branch with what's in main, so maybe those diffs dropped off?

@cvalarida
Copy link
Contributor

💨 It's gone! Looks like updating with main made it disappear into the ether. 👍

@randimays
Copy link
Contributor Author

@cvalarida The Link component (src/templates/common/link/index.tsx) is not used. Apologies for the confusion, it was not my original intention to create so many PRs from this code and I've lost track of what is documented where. The original checklist PR has a reference to it:

Removes the unused custom component

If you search the source code for Link (case-sensitive), you can see that the only place it's ever imported from is next/link, so that custom component isn't used.

As far as testing goes - this one is a bit tricky. Pretty much all of my changes are to Resources & Support common components because they were in support of the checklist template, and we don't have any other next-build R&S templates prod-ready yet. You can see the components I changed in the Storybook view (relatedLinks, secondaryButtonGroup, contactInfo). Otherwise there's just a lot of alphabetization/organization. You can regression check by running the code locally at /outreach-and-events/events (to be sure nothing is going to break prod).

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 18, 2025 20:19 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 19, 2025 18:09 Destroyed
Copy link
Contributor

@cvalarida cvalarida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks generally good. I noticed no regressions, but the ContactInfo was confusing to me. Mind adding some docs?

Comment on lines +41 to +46
return (
<li className="vads-u-margin-top--1">
<strong>{label}&nbsp;</strong>
<va-telephone contact={number} extension={extension || null} />
</li>
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one doesn't look quite right. Shouldn't it show the phone number? The link is correct (tel:...), but why does the link text say "Phone Number"?

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: Default contact. That little contactType="DC" magic property renders the default, not this PhoneContact component. Got it.

This behavior isn't what I'd expect, honestly. I assume we don't have much leeway in changing the behavior, do we? Probably requires an upstream change in Drupal and corresponding content-build template. 😮‍💨

Can we get some documentation on this component describing what's going on? Ideally, I'd also like a JSDoc string on the ContactInfo type and its properties so we can leverage the language server hover docs. 🤞

className="usa-unstyled-list vads-u-display--flex vads-u-flex-direction--column"
role="list"
>
<ul className="usa-unstyled-list vads-u-display--flex vads-u-flex-direction--column">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is outside the scope of this PR since it was this way before, but for posterity, this should probably be a description list, not an unordered list. I think the default formatting for that will be funky, but it's more semantically correct, I believe.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For posterity: I can't leave a comment on line 104 of the new version because it's out of scope of this PR, but I'm not sure we should add that 0 x padding on large displays (desktop-lg:vads-u-padding-x--0). 🤷

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants