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 location alert fields to homepage widget #150

Merged
merged 1 commit into from
May 24, 2024
Merged

Conversation

matt-bernhardt
Copy link
Member

@matt-bernhardt matt-bernhardt commented May 13, 2024

Developer

This change adds a field to the Location data model, along with display logic in the homepage hours widget, which combined allow the UX staff to manage alerts for the locations on the platform homepage.

This change does not affect the existing platform-wide alerts, nor the existing location-based alerts shown on the hours grid or the location homepages.

Relevant ticket(s):

Stylesheets

  • Any theme or plugin whose stylesheets have changed has had its version
    string incremented.

Secrets

  • All new secrets have been added to Pantheon tiers
  • Relevant secrets have been updated in Github Actions
  • All new secrets documented in README
  • No secrets are affected

Documentation

  • Project documentation has been updated
  • No documentation changes are needed

Accessibility

  • ANDI or Wave has been run in accordance to
    our guide and
    all issues introduced by these changes have been resolved or opened as new
    issues (link to those issues in the Pull Request details above)

Stakeholder approval

  • Stakeholder approval has been confirmed
  • Stakeholder approval is not needed

Dependencies

NO dependencies are updated

Additional context needed to review

There are links to the review app in the Jira ticket.

Code Reviewer

  • The commit message is clear and follows our guidelines
    (not just this pull request message)
  • The changes have been verified
  • The documentation has been updated or is unnecessary
  • New dependencies are appropriate or there were no changes

** Why are these changes being introduced:

* There is an upcoming closure to the Hayden library, and we want to
  enable UXWS staff to be able to add alerts to the homepage for cases
  like this without asking for EngX to modify static templates.

* After discussing the needed feature among themselves, UX has decided
  that a separate field for homepage alerts was preferrable, because
  that space frequently needs a single line of text that does not
  replicate the uses of the existing title and body fields for the
  current alert information.

** Relevant ticket(s):

* https://mitlibraries.atlassian.net/browse/pw-93

** How does this address that need:

* First, we add a new field to the Location Attributes fieldset, named
  alert_frontpage. This field appears next to the other location alert
  fields (alert_title and alert_content), with help text advising that
  this new field should only have links added to it.

* Second, we add a method to the widget class (which is provided by the
  hours plugin) to check for content in this new field. If content is
  found, it is included in the widget output below that location's
  entry.

* The styling for this display is taken from the former styles for the
  Hayden renovation alert, which was statically added to this partial.

* Because the parent theme's styles are changing, we bump the theme
  version.

** Document any side effects to this change:

* This ticket is validating our choice to go with a monorepo for our
  WordPress application - as the changes being made might have spanned
  across several repositories in our previous infrastructure (one for
  the hours widget, one for the parent theme to change the styling,
  and potentially a third for the data model change - although that
  may have just been a configuration and not a code change before).

* While the use of a class method and not a function in a tempalte is
  good, we are still mixing content and code because we have hard-
  coded location names, phone numbers, etc - as well as the post IDs
  for our actual locations. I'm choosing not to continue pulling on
  this thread, however.
@matt-bernhardt matt-bernhardt marked this pull request as ready for review May 15, 2024 17:56
@JPrevost JPrevost self-assigned this May 24, 2024
Copy link
Member

@JPrevost JPrevost left a comment

Choose a reason for hiding this comment

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

This seems like a good solution. I sort of hate the magic post numbers but I agree it's not worth trying to address that at this time.

@matt-bernhardt matt-bernhardt merged commit dec3161 into master May 24, 2024
3 checks passed
@matt-bernhardt matt-bernhardt deleted the pw-93 branch May 24, 2024 15:33
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.

2 participants