Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Merge branch 'nightwatch' into testing-1.4.0

Benjamin039ae7dfc9d3
diff --cc Gruntfile.js
index db2dcb694,67f094fab..f6455893f
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@@ -713,6 -715,9 +745,9 @@@ module.exports = function(grunt)
grunt.registerTask("distclean", ["remove:build", "remove:dist"]);
grunt.registerTask("lint", ["jshint:console"]);
grunt.registerTask("test", ["buster:console"]);
+ grunt.registerTask("chrome-tests", ["nightwatch:chrome"]);
+ grunt.registerTask("firefox-tests", ["nightwatch:firefox"]);
+ grunt.registerTask("e2e", ["firefox-tests", "chrome-tests"]);
- grunt.registerTask("default", ["update", "build", "config", "site"]);
+ grunt.registerTask("default", ["update-packages", "update", "build", "config", "site"]);
};
diff --cc package.json
index 755524580,d3b618012..edb99ba90
--- a/package.json
+++ b/package.json
@@@ -12,15 -12,17 +12,17 @@@
"babel-polyfill": "^6.16.0",
"bluebird": "^3.4.6",
"buster": "0.7.12",
+ "chromedriver": "2.25.1",
+ "geckodriver": "^1.2.0",
"grunt": "0.4.x",
"grunt-buster": "0.4.x",
- "grunt-contrib-clean": "0.5.x",
- "grunt-contrib-coffee": "0.13.x",
+ "grunt-contrib-clean": "1.0.x",
+ "grunt-contrib-coffee": "1.0.x",
"grunt-contrib-compress": "0.5.x",
- "grunt-contrib-concat": "0.3.x",
- "grunt-contrib-copy": "0.6.x",
+ "grunt-contrib-concat": "1.0.x",
+ "grunt-contrib-copy": "1.0.x",
"grunt-contrib-csslint": "0.2.x",
- "grunt-contrib-cssmin": "0.7.x",
+ "grunt-contrib-cssmin": "1.0.x",
"grunt-contrib-jshint": "0.8.x",
"grunt-contrib-uglify": "2.0.x",
"grunt-exec": "0.4.x",
@@@ -34,13 -37,13 +37,14 @@@
"jshint": "2.9.x",
"lodash": "^4.15.0",
"moment": "2.13.x",
+ "openlayers": "4.0.1",
+ "gifshot": "https://github.com/nasa-gibs/gifshot/archive/4.2.0.tar.gz",
+ "nightwatch": "^0.9.9",
- "openlayers": "3.19.x",
"phantomjs": "2.1.x",
"promise-queue": "^2.2.3",
"react": "^15.3.1",
"react-dom": "^15.3.1",
- "worldview-components": "1.2.0"
- "selenium-server-standalone-jar": "3.0.1",
- "worldview-timeline-components": "*"
++ "worldview-components": "1.2.0",
++ "selenium-server-standalone-jar": "3.0.1"
}
}
-
diff --cc web/js/map/wv.map.runningdata.js
index b2cf25419,5f0a2dd78..90bfb8c6e
--- a/web/js/map/wv.map.runningdata.js
+++ b/web/js/map/wv.map.runningdata.js
@@@ -258,55 -193,6 +258,55 @@@ wv.map.runningdata = wv.map.runningdat
self.updateRunners(self.LayersToRemove(self.oldLayers, self.activeLayers));
}
self.oldLayers = self.activeLayers;
+
+ };
+ /*
+ * Initiates new legend
+ *
+ * @method newLegend
+ *
+ * @param {Array} legends - tooltip data
+ *
+ * @param {String} hex - color
+ *
+ * @return {Void}
+ *
+ */
+ self.newLegend = function(legends, hex) {
+ self.activeLayers = [legends.id];
+ $productsBox.addClass('active-lengend');
+ self.createRunnerFromLegend(legends, hex);
+ self.update();
+ };
+
+ /*
+ * Compare old and new arrays to determine which Layers need to be
+ * removed
+ *
+ * @method LayersToRemove
+ *
+ * @param {Array} coords - Array of coordinate values
+ *
+ * @param {Object} map - OpenLayers Map Object
+ *
+ * @return {Void}
+ *
+ */
+ self.createRunnerFromLegend = function(legend, hex) {
+ var paletteInfo;
- if(legend.type === 'continuous' || 'discrete') {
++ if(legend.type === 'continuous' || legend.type === 'discrete') {
+ paletteInfo = self.getDataLabel(legend, hex);
+ if(paletteInfo) {
+ self.setLayerValue(legend.id, paletteInfo);
+ self.activeLayers.push(legend.id);
+ }
+ } else if(legend.type === 'classification') {
+ paletteInfo = self.getDataLabel(legend, hex);
+ if(paletteInfo) {
+ self.setCategoryValue(legend.id, paletteInfo);
+ self.activeLayers.push(legend.id);
+ }
+ }
};
/*