-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: configurable system wide banner (#657)
* fix: configurable system wide banner * fix: add config values with mergeConfig * fix: use PageBanner from Paragon instead
- Loading branch information
1 parent
c7761b0
commit 43d1ce8
Showing
8 changed files
with
125 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1 @@ | ||
NODE_ENV='production' | ||
BASE_URL='' | ||
LMS_BASE_URL='' | ||
LOGIN_URL='' | ||
LOGOUT_URL='' | ||
ENTERPRISE_SUPPORT_URL='' | ||
SURVEY_MONKEY_URL='' | ||
CSRF_TOKEN_API_PATH='' | ||
REFRESH_ACCESS_TOKEN_ENDPOINT='' | ||
DATA_API_BASE_URL='' | ||
ECOMMERCE_BASE_URL='' | ||
LICENSE_MANAGER_BASE_URL='' | ||
ACCESS_TOKEN_COOKIE_NAME='' | ||
USER_INFO_COOKIE_NAME='' | ||
SEGMENT_KEY='' | ||
NEW_RELIC_APP_ID='' | ||
NEW_RELIC_LICENSE_KEY='' | ||
ENTERPRISE_LEARNER_PORTAL_URL='' | ||
TABLEAU_URL='' | ||
LOGO_URL='' | ||
LOGO_WHITE_URL='' | ||
LOGO_TRADEMARK_URL='' | ||
FAVICON_URL='' |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
================================ | ||
1. Record Architecture Decisions | ||
================================ | ||
|
||
****** | ||
Status | ||
****** | ||
|
||
Accepted | ||
|
||
******* | ||
Context | ||
******* | ||
|
||
We would like to keep a historical record on the architectural decisions we make with this app as it evolves over time. | ||
|
||
******** | ||
Decision | ||
******** | ||
|
||
We will use Architecture Decision Records, as described by | ||
Michael Nygard in `Documenting Architecture Decisions`_ | ||
|
||
.. _Documenting Architecture Decisions: http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions | ||
|
||
************ | ||
Consequences | ||
************ | ||
|
||
See Michael Nygard's article, linked above. | ||
|
||
********** | ||
References | ||
********** | ||
|
||
* https://resources.sei.cmu.edu/asset_files/Presentation/2017_017_001_497746.pdf | ||
* https://github.com/npryce/adr-tools/tree/master/doc/adr |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
============================================================ | ||
2. Configurable system-wide notices banner | ||
============================================================ | ||
|
||
****** | ||
Status | ||
****** | ||
|
||
Accepted | ||
|
||
******* | ||
Context | ||
******* | ||
|
||
This application relies on several backend services for their API endpoints. Occassionally, scheduled planned maintenance must be performed such that certain service dependencies will fail. This may impact the user experience by limiting the functionality of certain features or producing erronous errors. | ||
|
||
To account for this, we want to provide a way to notify users that planned maintenance is underway or about to begin. | ||
|
||
******** | ||
Decision | ||
******** | ||
|
||
To account for this, the Paragon component `SystemWideBanner` will be used to convey a message to the user that maintenance is underway, thereby informing them that things may not work properly or as they expect. This component is a largely warning alert placed at the top of the page (above the header). Whether or not it is shown will be driven by some configuration variables: ``IS_MAINTENANCE_ALERT_ENABLED``, ``MAINTENANCE_ALERT_MESSAGE``, ``MAINTENANCE_ALERT_START_TIMESTAMP``. | ||
|
||
In order to enable the alert, ``IS_MAINTENANCE_ALERT_ENABLED`` and ``MAINTENANCE_ALERT_MESSAGE`` must be set. Optionally, to configure when the alert will appear, you may set a timestamp for ``MAINTENANCE_ALERT_START_TIMESTAMP``. The alert will not appear before this timestamp, but it will stay up indefinitely until ``IS_MAINTENANCE_ALERT_ENABLED`` is removed and the application is re-deployed. We are intentionally not supporting an explicit end date; the assumption is that to turn off an alert is to remove the ``IS_MAINTENANCE_ALERT_ENABLED`` setting. | ||
|
||
The format of the ``MAINTENANCE_ALERT_START_TIMESTAMP`` setting is as follows: "2021-12-10T21:20:00Z" | ||
|
||
************ | ||
Consequences | ||
************ | ||
|
||
We do not have a particular need for an explicit end date with the alert at this time, mainly due to that we don't know how long the maintenance will last for at the time of this writing. Instead, we will simply monitor the system and turn ``IS_MAINTENANCE_ALERT_ENABLED`` off at the appropriate time and re-deploy the application. |
This file contains 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
17 changes: 17 additions & 0 deletions
17
src/components/system-wide-banner/SystemWideWarningBanner.jsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { PageBanner, Icon } from '@edx/paragon'; | ||
import { WarningFilled } from '@edx/paragon/icons'; | ||
|
||
const SystemWideWarningBanner = ({ children }) => ( | ||
<PageBanner variant="warning"> | ||
<Icon src={WarningFilled} className="mr-2" /> | ||
{children} | ||
</PageBanner> | ||
); | ||
|
||
SystemWideWarningBanner.propTypes = { | ||
children: PropTypes.node.isRequired, | ||
}; | ||
|
||
export default SystemWideWarningBanner; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export { default as SystemWideWarningBanner } from './SystemWideWarningBanner'; |
This file contains 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