Add persistent BANNER notice type for maintenance and outage info#1146
Merged
Conversation
…e and outage info
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
…itle and subtitle
… document stage values
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BANNERnotice type that renders as a non-dismissible bar pinned to the top of the app, intended for system maintenance and outage information.preview(short-form HTML) anduntilfields from thenoticesAPI and use them for banner copy and expiry.Why
Maintenance and outage notices need to stay visible for the duration of the event. Dismissal is deliberately not offered — a user who dismisses and forgets is the one who files the support ticket the banner was meant to prevent.
Because there is no client-side escape hatch, the banner must reliably remove itself. That is handled server-side by
Notice.visible(), which already filters onenabled,stage,languageand thefrom/untilwindow — so ops can expire or kill a banner without a client release.Implementation notes
previewinstead ofbody. The schema already exposes a dedicated short-form "Preview HTML" field, which suits a single-line bar far better than the fullbodyHTML. Falls back totitlewhenpreviewis empty.untilis re-checked client-side on every render, not in the memoized selector. The server already filters expired notices, butannouncementsis in the redux-persist whitelist, so an offline or failed fetch would otherwise leave an expired banner pinned with no way to dismiss it.Noticecomponent (severity="warning",fullWidth,solid). Omitting its optionalonCloseis what makes the bar non-dismissible.ViewAsBannerinApp.tsx, matching the existing top-banner pattern.NoticeTypeingraphql-apidoes not yet includeBANNER. Until it does, no notice can carry the type and this code renders nothing (it is inert, not broken).The enum is stored as an
int(GENERIC=0…COMMUNICATION=4), so appendingBANNER=5is purely additive — no DB migration needed, the column is alreadyint, and existing rows are not renumbered.previewanduntilare already exposed as GraphQL fields, so querying them is safe today.Validation
npm run typechecknpm run buildtype: BANNERuntil the API enum lands.