Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-2829 outage adjustments (#4715)

Tom Cariellod4f4f7abf759
diff --git a/web/js/app.js b/web/js/app.js
index 8de628b84..d598eda37 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -67,10 +67,10 @@ class App extends React.Component {
componentDidUpdate(prevProps) {
// Check if the numberUnseen prop has changed
- const { numberOutagesUnseen, object } = this.props;
+ const { kioskModeEnabled, numberOutagesUnseen, object } = this.props;
if (numberOutagesUnseen !== prevProps.numberOutagesUnseen) {
- if (numberOutagesUnseen > 0) {
- this.openNotification(object, numberOutagesUnseen);
+ if (numberOutagesUnseen > 0 && !kioskModeEnabled) {
+ this.openNotification(object.outages, numberOutagesUnseen);
}
}
}
@@ -190,8 +190,10 @@ function mapStateToProps(state) {
const {
numberOutagesUnseen, numberUnseen, type, object,
} = notifications;
+ const kioskModeEnabled = (state.ui.eic !== null && state.ui.eic !== '') || state.ui.isKioskModeActive;
return {
state,
+ kioskModeEnabled,
isAnimationWidgetActive: state.animation.isActive,
isEmbedModeActive: state.embed.isEmbedModeActive,
isMobile: state.screenSize.isMobileDevice,
@@ -219,6 +221,7 @@ const mapDispatchToProps = (dispatch) => ({
openCustomContent('NOTIFICATION_LIST_MODAL', {
headerText: 'Notifications',
bodyComponent: Notifications,
+ source: 'outage-alert',
onClose: () => {
if (numberOutagesUnseen > 0) {
dispatch(outageNotificationsSeenAction());
@@ -236,6 +239,7 @@ export default connect(
App.propTypes = {
isAnimationWidgetActive: PropTypes.bool,
+ kioskModeEnabled: PropTypes.bool,
isEmbedModeActive: PropTypes.bool,
isMobile: PropTypes.bool,
isTourActive: PropTypes.bool,
diff --git a/web/js/containers/notifications.js b/web/js/containers/notifications.js
index 52b18eea1..26dd7eeb5 100644
--- a/web/js/containers/notifications.js
+++ b/web/js/containers/notifications.js
@@ -5,10 +5,22 @@ import NotificationBlock from '../components/notifications/notification-block';
import { getNumberOfTypeNotSeen } from '../modules/notifications/util';
function Notifications(props) {
- const { object } = props;
+ const { kioskModeEnabled, numberOutagesUnseen, object } = props;
const {
messages, outages, alerts,
} = object;
+
+ if (numberOutagesUnseen > 0 && !kioskModeEnabled) {
+ return (
+ <div className="wv-notify-modal">
+ <NotificationBlock
+ arr={outages}
+ type="outage"
+ numberNotSeen={getNumberOfTypeNotSeen('outage', outages)}
+ />
+ </div>
+ );
+ }
return (
<div className="wv-notify-modal">
<NotificationBlock
@@ -30,9 +42,11 @@ function Notifications(props) {
);
}
function mapStateToProps(state) {
- const { object } = state.notifications;
-
+ const { object, numberOutagesUnseen } = state.notifications;
+ const kioskModeEnabled = (state.ui.eic !== null && state.ui.eic !== '') || state.ui.isKioskModeActive;
return {
+ kioskModeEnabled,
+ numberOutagesUnseen,
object,
};
}
@@ -44,4 +58,5 @@ export default connect(
Notifications.propTypes = {
object: PropTypes.object,
+ numberOutagesUnseen: PropTypes.number,
};