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

Va-minimal-footer: add component #937

Merged
merged 17 commits into from
Nov 15, 2023
Merged

Va-minimal-footer: add component #937

merged 17 commits into from
Nov 15, 2023

Conversation

it-harrison
Copy link
Contributor

@it-harrison it-harrison commented Nov 6, 2023

Chromatic

https://1777-minimal-footer--60f9b557105290003b387cd5.chromatic.com


Description

Closes 1777

Testing done

local testing in Chrome, Edge, Firefox, Safari

Screenshots

Desktop:

Screenshot 2023-11-06 at 8 48 50 AM

Mobile
Simulator Screenshot - iPhone SE (3rd generation) - 2023-11-06 at 08 46 31

Acceptance criteria

  • [ ]

Definition of done

  • Documentation has been updated, if applicable
  • A link has been provided to the originating GitHub issue (or connected to it via ZenHub)

@it-harrison it-harrison added the minor For a minor Semantic Version change label Nov 6, 2023
@it-harrison it-harrison requested a review from a team as a code owner November 6, 2023 16:17
<Host>
<div class="va-footer">
<a href="/" >
<img class="va-logo" src={vaSeal} aria-hidden="true"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think because this is a functional image, and serves as the only content of the anchor tag, instead of aria-hidden="true" it needs some alt text to indicate that it's a link that takes the user to the va.gov home page. Something like alt="VA.gov home"

More info here - https://www.w3.org/WAI/tutorials/images/functional/#example-1-image-used-alone-as-a-linked-logo.

And actually, I think the minimal header needs to be fixed as well -

<img class="va-logo" src={vaSeal} aria-hidden="true"/>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@micahchiang thanks for the heads up. Also, here is a PR to update minimal header.

Copy link
Contributor

@jamigibbs jamigibbs Nov 7, 2023

Choose a reason for hiding this comment

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

I left a comment on the other PR and I just wanted to mention here too that we can probably use the existing alt text from the current VA.gov footer logo: "VA logo and Seal, U.S. Department of Veterans Affairs"

There is also a title on the link "Go to VA.gov":

Screenshot 2023-11-07 at 2 44 47 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jamigibbs fixed!

}
</style>

</head>
<body>
<my-component first="Stencil" last="'Don't call me a framework' JS"></my-component>
</body>
<va-minimal-footer />
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 I understand why this file was changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ug, accidentally committed!

Copy link
Contributor

@jamigibbs jamigibbs Nov 7, 2023

Choose a reason for hiding this comment

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

Did we have to manually add this image here to the Storybook assets? Or was it moved by the build script? I noticed that there is a PNG and an SVG version in web-components/src/assets but here it's just the PNG.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jamigibbs I removed the .png since it's not being used

Copy link
Contributor

@jamigibbs jamigibbs Nov 7, 2023

Choose a reason for hiding this comment

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

Same also here. There is a PNG and an SVG version in web-components/src/assets but here it's just the PNG.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jamigibbs I removed the .png since it's not being used

Copy link
Contributor

Choose a reason for hiding this comment

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

@it-harrison There are a couple of other places that a .png file exists still. Do we want these removed as well?

Screenshot 2023-11-08 at 9 42 16 AM

import { newSpecPage } from '@stencil/core/testing';
import { VAMinimalFooter } from '../va-minimal-footer';

describe('va-minimal-footer', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a unit test at all for this component? I think we can accomplish the same thing that you're doing here with an e2e test like this:

https://github.com/department-of-veterans-affairs/component-library/blob/main/packages/web-components/src/components/va-button/test/va-button.e2e.ts#L5-L18

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jamigibbs I included the unit test here because the similar e2e test required putting the entire base 64 encoded svg in the test which made it unwieldy.

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense, thank you!

},
};

const Template = () => {
Copy link
Contributor

@jamigibbs jamigibbs Nov 7, 2023

Choose a reason for hiding this comment

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

The component story isn't displaying in the code example:

Screenshot 2023-11-07 at 10 43 49 AM

I think to fix this you'll need to pass in an empty object to story like this:

https://github.com/department-of-veterans-affairs/component-library/blob/main/packages/storybook/stories/va-need-help.stories.jsx#L18-L20

@jamigibbs jamigibbs requested a review from danbrady November 7, 2023 20:39
@jamigibbs
Copy link
Contributor

@it-harrison Can you add this new component and the English strings that we will want to get translations for to our spreadsheet here? 🙏

https://docs.google.com/spreadsheets/d/1iIg9pP5GG-QFk7DrsyoKJv9GebtYmDuzKf_heqxWks4/edit#gid=0


const defaultArgs = {};

const Template = ({ }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can probably just do 🤷‍♀️:

const defaultArgs = {};

const Template = (defaultArgs) => {

Or remove defaultArgs completely. I think the example I linked to before was done a little strange:

@@ -12,7 +12,7 @@
<style type="text/css" media="screen">
body {
/* For a little breathing room around the components */
padding: 4rem;
/* padding: 4rem; */
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you able to revert this change too?

Copy link
Contributor

@jamigibbs jamigibbs 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 dev looks good to me but let's get design approval too before it's merged. cc @danbrady

@it-harrison
Copy link
Contributor Author

@danbrady I have updated the css:
desktop:
Screenshot 2023-11-14 at 10 07 23 AM

I'm not sure if the mobile view is correct - the padding changes from 32px/8px to 10px/16px. I got these numbers from looking at the minimal-header, not sure if they are correct:

Screenshot 2023-11-14 at 10 09 38 AM

@danbrady
Copy link
Contributor

Thanks, @it-harrison. Looking at the mockup, we want more height to the footer. So let's set the padding to 32px/8px for both mobile and desktop. When the header gets tweaked to fill the width, ee should ensure we're consistent with the padding there too.

@it-harrison it-harrison merged commit 03d3fdd into main Nov 15, 2023
6 checks passed
@it-harrison it-harrison deleted the 1777-minimal-footer branch November 15, 2023 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor For a minor Semantic Version change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minimal Footer - Web Component - Development
4 participants