-
Notifications
You must be signed in to change notification settings - Fork 125
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
Banners 9223 #12959
Banners 9223 #12959
Conversation
src/platform/site-wide/maintenance-banner/tests/01-accessibility.e2e.spec.js
Outdated
Show resolved
Hide resolved
src/platform/site-wide/maintenance-banner/tests/components/App.unit.spec.js
Outdated
Show resolved
Hide resolved
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.
Loving it!
src/platform/site-wide/maintenance-banner/tests/01-accessibility.e2e.spec.js
Outdated
Show resolved
Hide resolved
const { | ||
content, | ||
expiresAt, | ||
id, | ||
startsAt, | ||
title, | ||
warnContent, | ||
warnStartsAt, | ||
warnTitle, | ||
} = config; |
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.
It would be more idiomatic to pass these in as props.
We should fetch this information from pager duty using something like getCurrentGlobalDowntime
in src/platform/monitoring/DowntimeNotification/util/helpers.js
. The parent component for this could transform that data into the view props (e.g. I think you only get the downtime window but you'd need to turn that into stuff like warnStartsAt
).
If we use that helper then we don't need to do a site deploy to turn this on- we can set a maintenance window for the global downtime in PagerDuty.
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.
Oh nice! I'll check that out 🙂
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.
ESLint is disabled
vets-website
uses ESLint to help enforce code quality. In most situations we would like ESLint to remain enabled.
What you can do
See if the code can be refactored to avoid disabling ESLint, or wait for a VSP review.
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.
Fantastic work! 👏
src/applications/static-pages/homepage-banner/HomepageBanner.jsx
Outdated
Show resolved
Hide resolved
id: PropTypes.string.isRequired, | ||
startsAt: PropTypes.object.isRequired, | ||
title: PropTypes.string.isRequired, | ||
warnContent: PropTypes.string, |
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 were asked to add some enforcement for the 300-length limit on the content so maybe we could throw an explicit error if the text length exceeds that. That could make sense as a follow-up PR though and to ahve this lay the foundation
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.
Oh you're right! As the timestamp changes that length will change, too 🤔 Hmm...
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.
Yeah, and the length also doesn't include HTML tags (only the text content itself) so it's not actually a super easy problem
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.
Ooo, do you think I should set inner html here? I wasn't planning on the maintenance banner having jsx elements in it other than just a plain string with formatted startsAt, etc. Currently it just shows this non-html string.
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.
Good question. I'm a little torn because on one hand we want to standardize the messaging but we also want to cap the message at a 300-character limit, which suggests we do intend to customize the message every now and then. How you have it now as a plain string seems totally fine as a starting point
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.
The maintenance banner content shouldn't change after this implementation (theoretically of course...), so isn't putting a length limit on it a little overkill if it's not going to change?
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 could see a length limit being useful for the homepage banner
src/platform/site-wide/banners/components/HomepageBanner/index.unit.spec.js
Outdated
Show resolved
Hide resolved
@department-of-veterans-affairs/frontend-review-group ready for review! 🎉 |
Can't seem to figure out which unit tests are failing here, they all seem to pass locally 🤔 http://jenkins.vfs.va.gov/blue/organizations/jenkins/testing%2Fvets-website/detail/banners-9223/28/tests |
Description
Issue: department-of-veterans-affairs/va.gov-team#9223
This PR implements the first version of a new site-wide banners management folder. This folder currently contains the Maintenance Banner and the Homepage Banner (aka Emergency Banner). It may include other banners in the future should the need arise.
Testing done
Created unit + e2e tests. The e2e tests don't run currently as we need to have the ability to change the system clock the e2e test suite runs in to test this code with Nightwatch.
Screenshots
Before
Pre-Downtime (defaults to 12 hours before
startsAt
) (1+ days of downtime)Pre-Downtime (defaults to 12 hours before
startsAt
) (less than 1 day of downtime)During Downtime (1+ days of downtime)
During Downtime (less than 1 day of downtime)
After
What about mobile?
Acceptance criteria
Definition of done