Interactive interface for browsing global, full-resolution satellite imagery
get notifications from deployed domain when possible
Jason Kent48cac2c68d9b
diff --git a/config/default/common/features.json b/config/default/common/features.jsonindex 5e0fdf797..1fb746c92 100644--- a/config/default/common/features.json+++ b/config/default/common/features.json@@ -12,7 +12,7 @@"id": "GTM-WNP7MLF"},"notification": {- "url": "https://status.earthdata.nasa.gov/api/v1/notifications?domain=https%3A%2F%2Fworldview.earthdata.nasa.gov",+ "url": "https://status.earthdata.nasa.gov/api/v1/notifications","releases": "https://github.com/nasa-gibs/worldview/releases"},"imageDownload": {diff --git a/web/js/containers/toolbar.js b/web/js/containers/toolbar.jsindex 664d9db25..a9149cfe2 100644--- a/web/js/containers/toolbar.js+++ b/web/js/containers/toolbar.js@@ -129,16 +129,21 @@ class toolbarContainer extends Component {requestNotifications() {const { config, requestNotifications } = this.props;- if (config.features.notification) {- let notificationURL = config.features.notification.url- ? config.features.notification.url+ const { parameters, features } = config;+ const { notification } = features;+ const domain = window.location.origin;++ if (notification) {+ let notificationURL = notification.url && !domain.includes('localhost')+ // Use the deployed domain (SIT, UAT, PROD) when possible+ ? `${notification.url}?domain=${domain}`+ // Use the PROD domain when running locally: STATUS_REQUEST_URL;- if (config.parameters.mockAlerts) {- notificationURL = `mock/notify_${config.parameters.mockAlerts}.json`;- } else if (config.parameters.notificationURL) {- console.log('mock notificationURL');- notificationURL = `https://status.earthdata.nasa.gov/api/v1/notifications?domain=${- config.parameters.notificationURL}`;++ if (parameters.mockAlerts) {+ notificationURL = `mock/notify_${parameters.mockAlerts}.json`;+ } else if (parameters.notificationURL) {+ notificationURL = `${notification.url}?domain=${parameters.notificationURL}`;}requestNotifications(notificationURL);}