Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Add notification module mocks #806

Benjamin King7704da8f4cde
diff --git a/web/js/notifications/ui.js b/web/js/notifications/ui.js
index b8e3f51c9..d80cbfcc6 100644
--- a/web/js/notifications/ui.js
+++ b/web/js/notifications/ui.js
@@ -17,7 +17,6 @@ export function notificationsUi(models, config) {
var url;
var alertBlockExists;
var messageBlockExists;
-
url = config.features.alert.url;
messageBlockExists = false;
alertBlockExists = false;
@@ -46,6 +45,10 @@ export function notificationsUi(models, config) {
if (!util.browser.localStorage) {
return;
}
+ if (config.parameters.mockAlerts) {
+ url = 'mock/notify_' + config.parameters.mockAlerts + '.json';
+ }
+
mainIcon = $('#wv-info-button')[0];
mainIconLabel = $('#wv-info-button label')[0];
p = util.get(url);
diff --git a/web/mock/notify_alert.json b/web/mock/notify_alert.json
new file mode 100644
index 000000000..879179f5d
--- /dev/null
+++ b/web/mock/notify_alert.json
@@ -0,0 +1,18 @@
+{
+ "success":true,
+ "notifications":[
+ {
+ "id":535,
+ "notification_type":"alert",
+ "message":"Watch our new \u003ca href=\"https://www.nasa.gov/feature/goddard/2018/explore-earth-your-way-with-worldview\" target=\"_blank\"\u003etutorial\u003c/a\u003e to learn how to visualize global satellite imagery for severe storms, volcanic eruptions, wildfires and more in Worldview!",
+ "updated_at":"2018-02-20T16:26:43.013-04:00",
+ "created_at":"2018-02-20T16:23:37.049-04:00",
+ "starttime":null,
+ "endtime":null,
+ "applications":["Worldview (OPS)"],
+ "domains":["https://worldview.earthdata.nasa.gov"],
+ "dismissible":true,
+ "path":""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/web/mock/notify_all_types.json b/web/mock/notify_all_types.json
new file mode 100644
index 000000000..3ab28056e
--- /dev/null
+++ b/web/mock/notify_all_types.json
@@ -0,0 +1,44 @@
+{
+ "success":true,
+ "notifications":[
+ {
+ "id":535,
+ "notification_type":"alert",
+ "message":"Watch our new \u003ca href=\"https://www.nasa.gov/feature/goddard/2018/explore-earth-your-way-with-worldview\" target=\"_blank\"\u003etutorial\u003c/a\u003e to learn how to visualize global satellite imagery for severe storms, volcanic eruptions, wildfires and more in Worldview!",
+ "updated_at":"2018-02-20T16:26:43.013-04:00",
+ "created_at":"2018-02-20T16:23:37.049-04:00",
+ "starttime":null,
+ "endtime":null,
+ "applications":["Worldview (OPS)"],
+ "domains":["https://worldview.earthdata.nasa.gov"],
+ "dismissible":true,
+ "path":""
+ },
+ {
+ "id":536,
+ "notification_type":"message",
+ "message":"This is a message test",
+ "updated_at":"2018-03-20T16:26:43.013-04:00",
+ "created_at":"2018-03-20T16:23:37.049-04:00",
+ "starttime":null,
+ "endtime":null,
+ "applications":["Worldview (OPS)"],
+ "domains":["https://worldview.earthdata.nasa.gov"],
+ "dismissible":true,
+ "path":""
+ },
+ {
+ "id":537,
+ "notification_type":"outage",
+ "message":"This is a test Outage",
+ "updated_at": "2018-05-20T16:26:43.013-04:00",
+ "created_at":"2018-05-20T16:23:37.049-04:00",
+ "starttime":null,
+ "endtime":null,
+ "applications":["Worldview (OPS)"],
+ "domains":["https://worldview.earthdata.nasa.gov"],
+ "dismissible":true,
+ "path":""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/web/mock/notify_message.json b/web/mock/notify_message.json
new file mode 100644
index 000000000..79ff19876
--- /dev/null
+++ b/web/mock/notify_message.json
@@ -0,0 +1,18 @@
+{
+ "success":true,
+ "notifications":[
+ {
+ "id":536,
+ "notification_type":"message",
+ "message":"This is a message test",
+ "updated_at":"2018-03-20T16:26:43.013-04:00",
+ "created_at":"2018-03-20T16:23:37.049-04:00",
+ "starttime":null,
+ "endtime":null,
+ "applications":["Worldview (OPS)"],
+ "domains":["https://worldview.earthdata.nasa.gov"],
+ "dismissible":true,
+ "path":""
+ }
+ ]
+}
\ No newline at end of file
diff --git a/web/mock/notify_outage.json b/web/mock/notify_outage.json
new file mode 100644
index 000000000..e88a2c403
--- /dev/null
+++ b/web/mock/notify_outage.json
@@ -0,0 +1,18 @@
+{
+ "success":true,
+ "notifications":[
+ {
+ "id":537,
+ "notification_type":"outage",
+ "message":"This is a test Outage",
+ "updated_at": "2018-05-20T16:26:43.013-04:00",
+ "created_at":"2018-05-20T16:23:37.049-04:00",
+ "starttime":null,
+ "endtime":null,
+ "applications":["Worldview (OPS)"],
+ "domains":["https://worldview.earthdata.nasa.gov"],
+ "dismissible":true,
+ "path":""
+ }
+ ]
+}
\ No newline at end of file