You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2017/10/12 04:07:54 UTC

[incubator-superset] branch master updated: Fixing some warnings during tests (#3648)

This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 3df3e0d  Fixing some warnings during tests (#3648)
3df3e0d is described below

commit 3df3e0d6814e7aa87b9332999c38f149ac2d0cd2
Author: Denny Biasiolli <de...@users.noreply.github.com>
AuthorDate: Thu Oct 12 06:07:52 2017 +0200

    Fixing some warnings during tests (#3648)
    
    * 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
    
    * Control: adding PropTypes.func in types allowed inside `value` prop
    
    This removes a warning during yarn tests
    
    Fix #3589
    
    * 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
    ```
    
    * 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`.
    ```
    
    * 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`.
    ```
---
 .../assets/javascripts/SqlLab/components/RunQueryActionButton.jsx    | 2 +-
 superset/assets/javascripts/SqlLab/components/SaveQuery.jsx          | 1 -
 superset/assets/javascripts/explore/components/Control.jsx           | 3 ++-
 .../javascripts/explore/components/controls/ColorSchemeControl.jsx   | 2 +-
 superset/assets/spec/javascripts/sqllab/QueryStateLabel_spec.jsx     | 5 -----
 5 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/superset/assets/javascripts/SqlLab/components/RunQueryActionButton.jsx b/superset/assets/javascripts/SqlLab/components/RunQueryActionButton.jsx
index 60437d3..6b6cdad 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,
diff --git a/superset/assets/javascripts/SqlLab/components/SaveQuery.jsx b/superset/assets/javascripts/SqlLab/components/SaveQuery.jsx
index d932fc4..8ab1b22 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 {
       <span className="SaveQuery">
         <Overlay
           trigger="click"
-          target={this.state.target}
           show={this.state.showSave}
           placement="bottom"
           animation={this.props.animation}
diff --git a/superset/assets/javascripts/explore/components/Control.jsx b/superset/assets/javascripts/explore/components/Control.jsx
index ed7ea97..7d8fcc3 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 = {
diff --git a/superset/assets/javascripts/explore/components/controls/ColorSchemeControl.jsx b/superset/assets/javascripts/explore/components/controls/ColorSchemeControl.jsx
index db51792..14702d8 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,
 };
diff --git a/superset/assets/spec/javascripts/sqllab/QueryStateLabel_spec.jsx b/superset/assets/spec/javascripts/sqllab/QueryStateLabel_spec.jsx
index fc15baa..5977065 100644
--- a/superset/assets/spec/javascripts/sqllab/QueryStateLabel_spec.jsx
+++ b/superset/assets/spec/javascripts/sqllab/QueryStateLabel_spec.jsx
@@ -14,11 +14,6 @@ describe('SavedQuery', () => {
   };
   it('is valid', () => {
     expect(
-      React.isValidElement(<QueryStateLabel />),
-    ).to.equal(true);
-  });
-  it('is valid with props', () => {
-    expect(
       React.isValidElement(<QueryStateLabel {...mockedProps} />),
     ).to.equal(true);
   });

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <co...@superset.apache.org>'].