From e9eebb3432cdfc6e79447380b907bef05c8db1b8 Mon Sep 17 00:00:00 2001 From: Denny Biasiolli Date: Wed, 4 Oct 2017 09:08:04 +0200 Subject: [PATCH 1/5] ColorSchemeControl: fixing bad use of PropTypes Accessing PropTypes via the main React package is deprecated, and will be removed in React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs --- .../explore/components/controls/ColorSchemeControl.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/assets/javascripts/explore/components/controls/ColorSchemeControl.jsx b/superset/assets/javascripts/explore/components/controls/ColorSchemeControl.jsx index db51792cfc696..14702d8442002 100644 --- a/superset/assets/javascripts/explore/components/controls/ColorSchemeControl.jsx +++ b/superset/assets/javascripts/explore/components/controls/ColorSchemeControl.jsx @@ -12,7 +12,7 @@ const propTypes = { onChange: PropTypes.func, value: PropTypes.string, default: PropTypes.string, - choices: PropTypes.arrayOf(React.PropTypes.array).isRequired, + choices: PropTypes.arrayOf(PropTypes.array).isRequired, schemes: PropTypes.object.isRequired, isLinear: PropTypes.bool, }; From e70f32dd1a922b4df871ce23a33ad70a6025f7f0 Mon Sep 17 00:00:00 2001 From: Denny Biasiolli Date: Wed, 4 Oct 2017 10:36:04 +0200 Subject: [PATCH 2/5] Control: adding PropTypes.func in types allowed inside `value` prop This removes a warning during yarn tests Fix #3589 --- superset/assets/javascripts/explore/components/Control.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superset/assets/javascripts/explore/components/Control.jsx b/superset/assets/javascripts/explore/components/Control.jsx index ed7ea97ad31d6..7d8fcc3dcd666 100644 --- a/superset/assets/javascripts/explore/components/Control.jsx +++ b/superset/assets/javascripts/explore/components/Control.jsx @@ -22,7 +22,8 @@ const propTypes = { PropTypes.string, PropTypes.number, PropTypes.bool, - PropTypes.array]), + PropTypes.array, + PropTypes.func]), }; const defaultProps = { From a164e779634045b96bd135c3d3fa2cb08ec08a7c Mon Sep 17 00:00:00 2001 From: Denny Biasiolli Date: Wed, 4 Oct 2017 11:04:28 +0200 Subject: [PATCH 3/5] tests(QueryStateLabel): removing missing prop warning ``` Warning: Failed prop type: The prop `query` is marked as required in `QueryStateLabel`, but its value is `undefined`. in QueryStateLabel ``` --- .../assets/spec/javascripts/sqllab/QueryStateLabel_spec.jsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/superset/assets/spec/javascripts/sqllab/QueryStateLabel_spec.jsx b/superset/assets/spec/javascripts/sqllab/QueryStateLabel_spec.jsx index fc15baa484f4b..597706587d8df 100644 --- a/superset/assets/spec/javascripts/sqllab/QueryStateLabel_spec.jsx +++ b/superset/assets/spec/javascripts/sqllab/QueryStateLabel_spec.jsx @@ -13,11 +13,6 @@ describe('SavedQuery', () => { }, }; it('is valid', () => { - expect( - React.isValidElement(), - ).to.equal(true); - }); - it('is valid with props', () => { expect( React.isValidElement(), ).to.equal(true); From 71362774a1efd6f14e27421e0196386614a0be55 Mon Sep 17 00:00:00 2001 From: Denny Biasiolli Date: Wed, 4 Oct 2017 11:14:01 +0200 Subject: [PATCH 4/5] SaveQuery: removing invalid prop `target` supplied to `Overlay`. This removes a warning during yarn tests: ``` Warning: Failed prop type: Invalid prop `target` supplied to `Overlay`. ``` --- superset/assets/javascripts/SqlLab/components/SaveQuery.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/superset/assets/javascripts/SqlLab/components/SaveQuery.jsx b/superset/assets/javascripts/SqlLab/components/SaveQuery.jsx index d932fc46186ec..8ab1b22ad0c68 100644 --- a/superset/assets/javascripts/SqlLab/components/SaveQuery.jsx +++ b/superset/assets/javascripts/SqlLab/components/SaveQuery.jsx @@ -112,7 +112,6 @@ class SaveQuery extends React.PureComponent { Date: Wed, 4 Oct 2017 11:32:57 +0200 Subject: [PATCH 5/5] RunQueryActionButton: removing `isRequired` from queryState props This removes a warning during yarn tests: ``` Warning: Failed prop type: The prop `queryState` is marked as required in `RunQueryActionButton`, but its value is `null`. ``` --- .../javascripts/SqlLab/components/RunQueryActionButton.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/assets/javascripts/SqlLab/components/RunQueryActionButton.jsx b/superset/assets/javascripts/SqlLab/components/RunQueryActionButton.jsx index 60437d3913557..6b6cdad6e16d4 100644 --- a/superset/assets/javascripts/SqlLab/components/RunQueryActionButton.jsx +++ b/superset/assets/javascripts/SqlLab/components/RunQueryActionButton.jsx @@ -6,7 +6,7 @@ import { t } from '../../locales'; const propTypes = { allowAsync: PropTypes.bool.isRequired, dbId: PropTypes.number, - queryState: PropTypes.string.isRequired, + queryState: PropTypes.string, runQuery: PropTypes.func.isRequired, selectedText: PropTypes.string, stopQuery: PropTypes.func.isRequired,