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

Add styling to the WFO page #1539

Merged
merged 14 commits into from
Aug 13, 2024
Merged

Conversation

greg-does-weather
Copy link
Collaborator

@greg-does-weather greg-does-weather commented Aug 7, 2024

What does this PR do? 🛠️

This extends the previous work standing up a WFO page by adding the styling described in Figma.

This PR makes one extension to the previous approach to rendering WFO pages. If an office has not create a WFO information content node, we still show that WFO's page using the information available to us – its name and coverage area map. Requests for WFO pages for offices that don't exist continues to result in a 404.

closes #1474

Screenshots (if appropriate): 📸

Full content, mobile size
Full content, desktop size
Default content, mobile size
Default content, desktop size

Copy link
Contributor

github-actions bot commented Aug 7, 2024

This PR modifies theme Javascript or CSS assets but does not update the theme libraries file. Did you mean to update the appropriate version information in the libraries file?

1 similar comment
Copy link
Contributor

github-actions bot commented Aug 7, 2024

This PR modifies theme Javascript or CSS assets but does not update the theme libraries file. Did you mean to update the appropriate version information in the libraries file?

Base automatically changed from eg-1470-wfo-info-routing to main August 8, 2024 15:40
Copy link
Contributor

github-actions bot commented Aug 8, 2024

This PR modifies theme Javascript or CSS assets but does not update the theme libraries file. Did you mean to update the appropriate version information in the libraries file?

2 similar comments
Copy link
Contributor

github-actions bot commented Aug 8, 2024

This PR modifies theme Javascript or CSS assets but does not update the theme libraries file. Did you mean to update the appropriate version information in the libraries file?

Copy link
Contributor

github-actions bot commented Aug 8, 2024

This PR modifies theme Javascript or CSS assets but does not update the theme libraries file. Did you mean to update the appropriate version information in the libraries file?

Copy link
Contributor

github-actions bot commented Aug 8, 2024

This PR modifies theme Javascript or CSS assets but does not update the theme libraries file. Did you mean to update the appropriate version information in the libraries file?

@greg-does-weather greg-does-weather changed the title Mgwalker/1474 wfo page styling Add styling to the WFO page Aug 8, 2024
@greg-does-weather greg-does-weather marked this pull request as ready for review August 8, 2024 18:19
Copy link
Collaborator

@eric-gade eric-gade left a comment

Choose a reason for hiding this comment

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

This looks good and works well on my end 👍

Just a couple of things:

Renaming the individual field templates means those fields will display the same way where ever they are (re)used. I think this is fine, but something to consider when building out the WFO Promo block, for example, where we can probably use some kind of drupal shortcuts to just render the fields according to existing templates if we want.

I'll leave most of the styling stuff to @partly-igor , but I did notice that there probably needs to be some margin on the bottom in the mobile/tablet view near the forecast discussion (though I know that is work that is forthcoming):

Screenshot 2024-08-12 at 9 59 45 AM

Code Review Checklist

This is an automated comment on every pull request requiring a review. A checked item is either an assertion that I have tested this item or an indication that I have verified it does not apply to this pull request.

The Basics

  • Checks are passing
  • I read the code
  • I ran the code
  • (if applicable) Post deploy steps are run
  • (if applicable) I validated the change on the deployed version in

Documentation

  • changes to “how we do things” are documented in READMEs
  • all new functions and methods are commented using plain language
  • any new modules added documented in modules.md

Security

  • security false positives are documented
  • data from external sources is cleaned and clearly marked

Reliability

  • error handling exists for unusual or missing values
  • interactions with external systems are wrapped in try/except
  • functionality is tested with unit or integration tests
  • dependency updates in composer.json also got changed in composer-lock.json

Infrastructure

  • all changes are auditable and documented via a script
  • it is clear who can and should run the script
  • (if applicable) diagrams have been updated or added in PlantUML

Accessibility

  • New pages have been added to cypress-axe file so that they will be tested with our automated accessibility testing
  • Meets WCAG 2.0 AA or 2.1 AA for Section 508 compliance
    • Site is keyboard accessible. All interactions can be accessed with a keyboard
    • Site is free of keyboard traps. The keyboard focus is never trapped in a loop
    • All form inputs have explicit labels
    • Form instructions are associated with inputs
    • All relevant images use an img tag
    • All images have appropriate alt attributes
    • Multimedia is tagged. All multimedia has appropriate captioning and audio description
    • Text has sufficient color contrast. All text has a contrast ratio of 4.5:1 with the background
    • Site never loses focus. Focus is always visible when moving through the page with the keyboard
    • Tab order is logical
    • Tables are coded properly. Tables have proper headers and column attributes
    • Headings are nested properly. Heading elements are nested in a logical way
    • Language is set. The language for the page is set
    • CSS is not required to use the page. The page makes sense with or without CSS
    • Links are unique and contextual. All links can be understood taken alone, e.g., ‘Read more - about 508’
    • Page titles are descriptive

Device Matrix

  • firefox/gecko (renders correctly and user interactions work)
  • chrome/chromium/edge (renders correctly and user interactions work)
  • safari/webkit (renders correctly and user interactions work)
  • web page is readable and usable
    • at 480px (mobile)
    • at 640px (tablet)
    • at 1024px (desktop)

Comment on lines +72 to +78
if (!$wfoInfo) {
// If there's not already a node for this WFO, create a blank
// one in memory so we can still render a page. It'll just have
// less content in it.
$wfoInfo = Node::create(["type" => "wfo_info"]);
$wfoInfo->set("field_wfo", $wfoTerm);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Great idea

Comment on lines +64 to +73
{% set hasPhone = phone is not empty %}
{% set hasAddress = address is not empty %}
{% set hasEmail = email is not empty %}

{% set hasFacebook = not (content.field_facebook_url.isEmpty or content.field_facebook_url.0 is not defined) %}
{% set hasTwitter = not (content.field_twitter_url.isEmpty or content.field_twitter_url.0 is not defined) %}
{% set hasYoutube = not (content.field_youtube_url.isEmpty or content.field_youtube_url.0 is not defined) %}
{% set hasSocial = hasFacebook or hasTwitter or hasYoutube %}

{% set hasContact = hasSocial or hasAddress or hasPhone or hasEmail %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should make a small ticket for the future that moves this logic into the hook where we are already massaging the data for display in twig. What do you think?

Copy link
Collaborator

@partly-igor partly-igor left a comment

Choose a reason for hiding this comment

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

Looking good, there are some design/style updates to make it match the design.

// one step so we have a somewhat broader view.
const bounds = wfo.getBounds();
map.fitBounds(bounds);
map.zoomOut(1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am curious to see what it looks like without this one step zoom out – not sure what the right level is, but I am wondering if the current one is a touch too zoomed out.

stuff, make sure we add things to the translations list appropriately.
#}
<div class="grid-row">
<div class="grid-col-12 tablet:grid-col-6">
Copy link
Collaborator

Choose a reason for hiding this comment

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

On mobile the spacing between the sections is a uneven. Could we make it so there is 4 units of space between the between the bottom of one section and the start (border) of the next

Screenshot of uneven spacing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 I added margin-top-4 padding-top-4 to all the headings and that seemed to accomplish it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep, that looks great, only one that sticks out is the list under Local Expertise, so I think we add margin-bottom-0 to that ul we should be good to go

@greg-does-weather
Copy link
Collaborator Author

greg-does-weather commented Aug 12, 2024

With automatic zoom out:

OHX

Without automatic zoom out:

OHX

I think I agree, that extra zoom out is unnecessary. I'm curious if it'll be dependent on the particular WFO, but I don't think so – this approach should guarantee that the entire WFO is visible before we do any zooming, so it should be okay?

@partly-igor
Copy link
Collaborator

Nice yeah, I think that without the zoom out is a good balance.

Copy link
Collaborator

@partly-igor partly-igor left a comment

Choose a reason for hiding this comment

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

Updates look really good, except the padding below the border should be 105 instead of 4

@@ -33,31 +33,31 @@
#}
<div class="grid-row">
<div class="grid-col-12 tablet:grid-col-6">
<h2 class="border-top-1px border-base-light text-normal text-primary-darker padding-top-1">
<h2 class="font-sans-xl border-top-1px border-base-light text-normal text-primary-darker padding-top-4 margin-top-4">
Copy link
Collaborator

Choose a reason for hiding this comment

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

padding-top-105

</ul>
</div>

<div class="grid-col-12 tablet:grid-col-6">
<h2 class="border-top-1px border-base-light text-normal text-primary-darker padding-top-1">
<h2 class="font-sans-xl border-top-1px border-base-light text-normal text-primary-darker padding-top-4 margin-top-4">
Copy link
Collaborator

Choose a reason for hiding this comment

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

padding-top-105

@@ -73,7 +73,7 @@
{% set hasContact = hasSocial or hasAddress or hasPhone or hasEmail %}

{% if hasContact %}
<h2 class="border-top-1px border-base-light text-normal text-primary-darker padding-top-1 margin-bottom-0">
<h2 class="font-sans-xl border-top-1px border-base-light text-normal text-primary-darker margin-bottom-0 padding-top-4 margin-top-4">
Copy link
Collaborator

Choose a reason for hiding this comment

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

padding-top-105

@partly-igor partly-igor self-requested a review August 13, 2024 14:35
Copy link
Collaborator

@partly-igor partly-igor left a comment

Choose a reason for hiding this comment

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

Updates look good!

@greg-does-weather greg-does-weather merged commit cc13b3e into main Aug 13, 2024
18 checks passed
@greg-does-weather greg-does-weather deleted the mgwalker/1474-wfo-page-styling branch August 13, 2024 15:42
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.

WFO Page template
3 participants