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

Replace table with va-table web component #1817

Merged
merged 5 commits into from
Dec 18, 2023
Merged

Conversation

nickjg231
Copy link
Contributor

@nickjg231 nickjg231 commented Dec 1, 2023

Summary

  • Replace <table> with <va-table> in the table.drupal.liquid file.

Tested manually using the page found at /housing-assistance/home-loans/funding-fee-and-closing-costs/

Some things to note:

  • va-table applies its own classes, so some of the columns are right-aligned as you'll see in the screenshots.

Related issue(s)

closes department-of-veterans-affairs/vets-design-system-documentation#2217

Testing done

  • Manually tested in Firefox

Screenshots

Desktop screen changes before:

image

after:

image

Mobile screen changes before:

image
image

after:

image
image

What areas of the site does it impact?

(Describe what parts of the site are impacted if code touched other areas)

Acceptance criteria

  • Places with <table> are replaced properly with <va-table> and <va-table-row>
  • Updated files still work with web-components

Quality Assurance & Testing

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Linting warnings have been addressed
  • Documentation has been updated (link to documentation *if necessary)
  • Screenshot of the developed feature is added
  • Accessibility testing has been performed

Error Handling

  • Browser console contains no warnings or errors.
  • Events are being sent to the appropriate logging solution
  • Feature/bug has a monitor built into Datadog or Grafana (if applicable)

Authentication

  • Did you login to a local build and verify all authenticated routes work as expected with a test user

⚠️ Team Sites (only applies to modifications made to the VA.gov header) ⚠️

  • The header does not contain any web-components
  • I used the proxy-rewrite steps to test the injected header scenario
  • I reached out in the #sitewide-public-websites Slack channel for questions

Requested Feedback

(OPTIONAL) What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?

@va-vfs-bot va-vfs-bot temporarily deployed to master/main/2217-table-deprecation December 15, 2023 22:59 Inactive
{% if forloop.first == true %}
<va-table-row slot="headers" key="header">
{% for column in value %}
{% if column == "" or column == nil %}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure how, but --- was being rendered to fields that came through as empty or null, so I've added a check here and just render a span with some whitespace if the value is null.

Copy link
Contributor

@jamigibbs jamigibbs Dec 18, 2023

Choose a reason for hiding this comment

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

This is a default behavior of the web component for handling missing data: https://design.va.gov/storybook/?path=/docs/components-va-table--missing-data

Screenshot 2023-12-18 at 9 00 05 AM

@va-vfs-bot va-vfs-bot requested a review from a team December 18, 2023 15:10
Copy link
Collaborator

@va-vfs-bot va-vfs-bot left a 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.

script/github-actions/code-coverage-format-report.js Outdated Show resolved Hide resolved
@jamigibbs jamigibbs marked this pull request as ready for review December 18, 2023 16:04
@jamigibbs jamigibbs requested a review from a team as a code owner December 18, 2023 16:04
@jamigibbs jamigibbs changed the title 2217 - Deprecate table Replace table with va-table web component Dec 18, 2023
@tjheffner
Copy link
Contributor

The code changes LGTM, just want to confirm that the visual changes are expected / desired. No more borders around non-table-header cells, and the text-alignment feels different

Screenshot 2023-12-18 at 8 15 46 AM

The lack of borders appears consistent with: https://design.va.gov/storybook/?path=/docs/components-va-table--missing-data but I'm not as sure about the alignment?

@jamigibbs
Copy link
Contributor

The lack of borders appears consistent with: https://design.va.gov/storybook/?path=/docs/components-va-table--missing-data but I'm not as sure about the alignment?

@tjheffner Thanks for the review! Yes, the alignment is expected with the web component. We have an outstanding issue in our backlog to clarify this in our documentation: department-of-veterans-affairs/vets-design-system-documentation#1871

@jamigibbs jamigibbs merged commit 2f78534 into main Dec 18, 2023
25 checks passed
@jamigibbs jamigibbs deleted the 2217-table-deprecation branch December 18, 2023 18:02
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.

Table Deprecation - Content Build
6 participants