-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
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
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? |
ec798b2
to
614b42d
Compare
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
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? |
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? |
ebdcff3
to
9fecb8d
Compare
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? |
There was a problem hiding this 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):
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)
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); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea
{% 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 %} |
There was a problem hiding this comment.
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?
9d443a1
to
4a82b93
Compare
There was a problem hiding this 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.
spatial-data/maps/template.html
Outdated
// one step so we have a somewhat broader view. | ||
const bounds = wfo.getBounds(); | ||
map.fitBounds(bounds); | ||
map.zoomOut(1); |
There was a problem hiding this comment.
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.
web/themes/new_weather_theme/templates/wfo-info/node--wfo-info.html.twig
Outdated
Show resolved
Hide resolved
web/themes/new_weather_theme/templates/wfo-info/node--wfo-info.html.twig
Outdated
Show resolved
Hide resolved
web/themes/new_weather_theme/templates/wfo-info/node--wfo-info.html.twig
Outdated
Show resolved
Hide resolved
web/themes/new_weather_theme/templates/wfo-info/node--wfo-info.html.twig
Outdated
Show resolved
Hide resolved
web/themes/new_weather_theme/templates/wfo-info/node--wfo-info.html.twig
Show resolved
Hide resolved
stuff, make sure we add things to the translations list appropriately. | ||
#} | ||
<div class="grid-row"> | ||
<div class="grid-col-12 tablet:grid-col-6"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
web/themes/new_weather_theme/templates/wfo-info/node--wfo-info.html.twig
Outdated
Show resolved
Hide resolved
web/themes/new_weather_theme/templates/wfo-info/node--wfo-info.html.twig
Outdated
Show resolved
Hide resolved
web/themes/new_weather_theme/templates/wfo-info/node--wfo-info.html.twig
Show resolved
Hide resolved
Nice yeah, I think that without the zoom out is a good balance. |
There was a problem hiding this 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"> |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
padding-top-105
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates look good!
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