From 4727956c338b36d7bc80e88636d8ea948cd36506 Mon Sep 17 00:00:00 2001 From: Denny Biasiolli Date: Fri, 14 Apr 2017 07:14:59 +0200 Subject: [PATCH 1/7] removing babel devDependency because has been deprecated in favor of babel-cli this fixes a warning during `npm install`: ``` npm WARN deprecated babel@6.23.0: In 6.x, the babel package has been deprecated in favor of babel-cli. Check https://opencollective.com/babel to support the Babel maintainers ``` --- superset/assets/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/superset/assets/package.json b/superset/assets/package.json index 2aca222092eb3..14a97b2b01ab6 100644 --- a/superset/assets/package.json +++ b/superset/assets/package.json @@ -97,7 +97,6 @@ "viewport-mercator-project": "^2.1.0" }, "devDependencies": { - "babel": "^6.3.26", "babel-cli": "^6.14.0", "babel-core": "^6.10.4", "babel-loader": "^6.2.4", From 4a75975259893ff4f1e87d1a2a0a140cb5f866fb Mon Sep 17 00:00:00 2001 From: Denny Biasiolli Date: Thu, 13 Apr 2017 16:14:05 +0200 Subject: [PATCH 2/7] react: using prop-types package to fix deprecated React.PropTypes property warning https://facebook.github.io/react/warnings/dont-call-proptypes.html --- superset/assets/visualizations/filter_box.jsx | 11 +++---- superset/assets/visualizations/mapbox.jsx | 29 ++++++++++--------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/superset/assets/visualizations/filter_box.jsx b/superset/assets/visualizations/filter_box.jsx index 95f93ed7cd45d..14e8596dd8077 100644 --- a/superset/assets/visualizations/filter_box.jsx +++ b/superset/assets/visualizations/filter_box.jsx @@ -1,6 +1,7 @@ // JS import d3 from 'd3'; import React from 'react'; +import PropTypes from 'prop-types'; import ReactDOM from 'react-dom'; import Select from 'react-select'; import { Button } from 'react-bootstrap'; @@ -10,11 +11,11 @@ import { TIME_CHOICES } from './constants'; import './filter_box.css'; const propTypes = { - origSelectedValues: React.PropTypes.object, - instantFiltering: React.PropTypes.bool, - filtersChoices: React.PropTypes.object, - onChange: React.PropTypes.func, - showDateFilter: React.PropTypes.bool, + origSelectedValues: PropTypes.object, + instantFiltering: PropTypes.bool, + filtersChoices: PropTypes.object, + onChange: PropTypes.func, + showDateFilter: PropTypes.bool, }; const defaultProps = { diff --git a/superset/assets/visualizations/mapbox.jsx b/superset/assets/visualizations/mapbox.jsx index 8c9fc22d620f5..9a868534723d1 100644 --- a/superset/assets/visualizations/mapbox.jsx +++ b/superset/assets/visualizations/mapbox.jsx @@ -1,6 +1,7 @@ /* eslint-disable no-param-reassign */ import d3 from 'd3'; import React from 'react'; +import PropTypes from 'prop-types'; import ReactDOM from 'react-dom'; import MapGL from 'react-map-gl'; import ScatterPlotOverlay from 'react-map-gl/dist/overlays/scatterplot.react'; @@ -256,20 +257,20 @@ class MapboxViz extends React.Component { } } MapboxViz.propTypes = { - aggregatorName: React.PropTypes.string, - clusterer: React.PropTypes.object, - globalOpacity: React.PropTypes.number, - mapStyle: React.PropTypes.string, - mapboxApiKey: React.PropTypes.string, - pointRadius: React.PropTypes.number, - pointRadiusUnit: React.PropTypes.string, - renderWhileDragging: React.PropTypes.bool, - rgb: React.PropTypes.array, - sliceHeight: React.PropTypes.number, - sliceWidth: React.PropTypes.number, - viewportLatitude: React.PropTypes.number, - viewportLongitude: React.PropTypes.number, - viewportZoom: React.PropTypes.number, + aggregatorName: PropTypes.string, + clusterer: PropTypes.object, + globalOpacity: PropTypes.number, + mapStyle: PropTypes.string, + mapboxApiKey: PropTypes.string, + pointRadius: PropTypes.number, + pointRadiusUnit: PropTypes.string, + renderWhileDragging: PropTypes.bool, + rgb: PropTypes.array, + sliceHeight: PropTypes.number, + sliceWidth: PropTypes.number, + viewportLatitude: PropTypes.number, + viewportLongitude: PropTypes.number, + viewportZoom: PropTypes.number, }; function mapbox(slice, json) { From 6ecdbc9819ee3e07077e7260bdfd77821da9c41e Mon Sep 17 00:00:00 2001 From: Denny Biasiolli Date: Fri, 14 Apr 2017 07:50:08 +0200 Subject: [PATCH 3/7] js: setting ExploreActionButtons.queryEndpoint PropType as required because it's required in the child component DisplayQueryButton --- .../javascripts/explorev2/components/ExploreActionButtons.jsx | 2 +- .../explorev2/components/ExploreActionButtons_spec.jsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/superset/assets/javascripts/explorev2/components/ExploreActionButtons.jsx b/superset/assets/javascripts/explorev2/components/ExploreActionButtons.jsx index f46c5688535f0..249a7017fadb2 100644 --- a/superset/assets/javascripts/explorev2/components/ExploreActionButtons.jsx +++ b/superset/assets/javascripts/explorev2/components/ExploreActionButtons.jsx @@ -8,7 +8,7 @@ import DisplayQueryButton from './DisplayQueryButton'; const propTypes = { canDownload: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).isRequired, slice: PropTypes.object, - queryEndpoint: PropTypes.string, + queryEndpoint: PropTypes.string.isRequired, queryResponse: PropTypes.object, chartStatus: PropTypes.string, }; diff --git a/superset/assets/spec/javascripts/explorev2/components/ExploreActionButtons_spec.jsx b/superset/assets/spec/javascripts/explorev2/components/ExploreActionButtons_spec.jsx index a67124e4ccea7..8a32386326255 100644 --- a/superset/assets/spec/javascripts/explorev2/components/ExploreActionButtons_spec.jsx +++ b/superset/assets/spec/javascripts/explorev2/components/ExploreActionButtons_spec.jsx @@ -14,6 +14,7 @@ describe('ExploreActionButtons', () => { json_endpoint: '', }, }, + queryEndpoint: 'localhost', }; it('renders', () => { From c15c6e34d481f723e19f248aaadf8ab109830c42 Mon Sep 17 00:00:00 2001 From: Denny Biasiolli Date: Fri, 14 Apr 2017 07:55:51 +0200 Subject: [PATCH 4/7] js(tests): using object in expandedSlices prop type of SliceCell tests --- superset/assets/spec/javascripts/dashboard/SliceCell_spec.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/assets/spec/javascripts/dashboard/SliceCell_spec.jsx b/superset/assets/spec/javascripts/dashboard/SliceCell_spec.jsx index cc3e046ff5b5d..a66ed4edb90e8 100644 --- a/superset/assets/spec/javascripts/dashboard/SliceCell_spec.jsx +++ b/superset/assets/spec/javascripts/dashboard/SliceCell_spec.jsx @@ -10,7 +10,7 @@ describe('SliceCell', () => { const mockedProps = { slice, removeSlice: () => {}, - expandedSlices: () => {}, + expandedSlices: {}, }; it('is valid', () => { expect( From ba588f39ced6e390922955d08366d71fec3c6b87 Mon Sep 17 00:00:00 2001 From: Denny Biasiolli Date: Fri, 14 Apr 2017 08:34:01 +0200 Subject: [PATCH 5/7] js(tests): adding required props to SqlEditor mockedProps --- superset/assets/spec/javascripts/sqllab/SqlEditor_spec.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/superset/assets/spec/javascripts/sqllab/SqlEditor_spec.jsx b/superset/assets/spec/javascripts/sqllab/SqlEditor_spec.jsx index 0244c0dd502ed..ab00ee6272c69 100644 --- a/superset/assets/spec/javascripts/sqllab/SqlEditor_spec.jsx +++ b/superset/assets/spec/javascripts/sqllab/SqlEditor_spec.jsx @@ -15,6 +15,9 @@ describe('SqlEditor', () => { latestQuery: queries[0], tables: [table], queries, + height: '', + editorQueries: [], + dataPreviewQueries: [], }; it('is valid', () => { expect( From 48662b82945d51c9c9d821360100b1659b7d76f1 Mon Sep 17 00:00:00 2001 From: Denny Biasiolli Date: Fri, 14 Apr 2017 08:35:32 +0200 Subject: [PATCH 6/7] js(tests): adding required prop editorHeight to TabbedSqlEditors mockedProps --- .../assets/spec/javascripts/sqllab/TabbedSqlEditors_spec.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/superset/assets/spec/javascripts/sqllab/TabbedSqlEditors_spec.jsx b/superset/assets/spec/javascripts/sqllab/TabbedSqlEditors_spec.jsx index 96648c9799e0a..bbe54efefa252 100644 --- a/superset/assets/spec/javascripts/sqllab/TabbedSqlEditors_spec.jsx +++ b/superset/assets/spec/javascripts/sqllab/TabbedSqlEditors_spec.jsx @@ -15,6 +15,7 @@ describe('TabbedSqlEditors', () => { queries: {}, queryEditors: initialState.queryEditors, tabHistory: initialState.tabHistory, + editorHeight: '', }; it('is valid', () => { expect( From 8928938107e259794367b6994155e16909b5dc08 Mon Sep 17 00:00:00 2001 From: Denny Biasiolli Date: Fri, 14 Apr 2017 10:05:59 +0200 Subject: [PATCH 7/7] js: removing unused moments dependency --- superset/assets/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/superset/assets/package.json b/superset/assets/package.json index 14a97b2b01ab6..56b0738faf309 100644 --- a/superset/assets/package.json +++ b/superset/assets/package.json @@ -62,7 +62,6 @@ "lodash.throttle": "^4.1.1", "mapbox-gl": "^0.26.0", "moment": "^2.14.1", - "moments": "0.0.2", "mustache": "^2.2.1", "nvd3": "1.8.5", "prop-types": "^15.5.8",