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

Website 39 add onsite location details to where for events exhibits page template #313

Conversation

SalazarJosh
Copy link
Collaborator

@SalazarJosh SalazarJosh commented Oct 21, 2024

Overview

This PR is specific to the "WHERE" for event details on the event template and the event cards as seen on the Today and Upcoming page and the "What’s happening?" section on the homepage.

There are three parts to this enhancement:

  • Changing how we present the WHERE for events/exhibits in library locations to include the floor, room # (where relevant), and “view floorplan” link, modeled after the Designation page templates
  • Adding a “View directions” link to the WHERE for events/exhibits non-library locations
  • Adjusting the presentation for Hybrid events to align with the other changes

This pull request addresses WEBSITE-39.

How I went about it

The strings are built in eventFormatWhere in the event.js utility file. They're built by pushing a series of strings named label to an object array where. where is then mapped in the event template file and the locality is extracted and applied as a link if it's present.

The floor plans are loaded in the event template file using useFloorPlan from use-floor-plan.js.

The "View directions" link is generated from createGoogleMapsURL if there is a locality in there where object. Both non-library events and library events can have a "View directions" link, but non-library events should always have a "View directions" link.

Examples

Here are some current events that we can preview:

For other events, hybrid and online, we don’t have current examples, but I can edit event details before running the logic to see what that looks like:

  • A hybrid event with a library location:
    image
    And the card:
    image

  • A hybrid event with a library location and event link:
    image
    And the card (same as above):
    image

  • An online event (no library location):
    image
    And the card:
    image

Testing

  • Make sure the PR is consistent in these browsers:
    • Chrome
    • Firefox
    • Safari (the assignee was not able to test the pull request in this browser)
    • Edge
  • Run accessibility tests:
    • ARC Toolkit
    • axe DevTools
    • NVDA

eventFormatWhere was only returning room and building fields. We now need room on one line, building, floor, and room number on the next. I'm also now looking up the floorPlan in the event and adding that to the end of the "where" label if it exists.
…n-site event could still have an address so I refactored eventFormatWhere to support that, removed redundancy, etc.
…o added check for isBrief for online events so we don't show link / URL on the event cards
…he same line as the "hybrid" or "online" label.
@SalazarJosh SalazarJosh self-assigned this Oct 22, 2024
@SalazarJosh SalazarJosh added the enhancement New feature or request label Oct 22, 2024
@SalazarJosh SalazarJosh marked this pull request as ready for review October 22, 2024 18:34
Copy link
Collaborator

@erinesullivan erinesullivan left a comment

Choose a reason for hiding this comment

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

👍🏻 I see the working links in comparison to the live site. I also love seeing a PR that deletes more code than adding. Great job!

@SalazarJosh SalazarJosh merged commit 28ce9e4 into master Oct 25, 2024
2 checks passed
@SalazarJosh SalazarJosh deleted the WEBSITE-39-Add-onsite-location-details-to-where-for-Events-Exhibits-page-template branch October 25, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants