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 2018/08/14 23:30:53 UTC

[incubator-superset] branch master updated: Tackling late-arriving comments from #5186 (#5626)

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 d601ff4  Tackling late-arriving comments from #5186 (#5626)
d601ff4 is described below

commit d601ff4747570b28fd6eccc719d9b7f882f7ac84
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Tue Aug 14 16:30:50 2018 -0700

    Tackling late-arriving comments from #5186 (#5626)
---
 superset/assets/src/CRUD/CollectionTable.jsx                  |  8 +++++---
 superset/assets/src/CRUD/Field.jsx                            |  5 +++--
 superset/assets/src/CRUD/Fieldset.jsx                         |  7 ++++---
 superset/assets/src/components/EditableTitle.jsx              |  1 +
 superset/assets/src/datasource/DatasourceModal.jsx            | 11 ++++++++---
 .../src/explore/components/controls/CheckboxControl.jsx       |  2 --
 6 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/superset/assets/src/CRUD/CollectionTable.jsx b/superset/assets/src/CRUD/CollectionTable.jsx
index 4520225..2cbc132 100644
--- a/superset/assets/src/CRUD/CollectionTable.jsx
+++ b/superset/assets/src/CRUD/CollectionTable.jsx
@@ -8,11 +8,10 @@ import { recurseReactClone } from './utils';
 import './styles.css';
 
 const propTypes = {
-  collection: PropTypes.array,
+  collection: PropTypes.arrayOf(PropTypes.object).isRequired,
   itemGenerator: PropTypes.func,
   columnLabels: PropTypes.object,
-  tableColumns: PropTypes.array,
-  columns: PropTypes.array,
+  tableColumns: PropTypes.array.isRequired,
   onChange: PropTypes.func,
   itemRenderers: PropTypes.object,
   allowDeletes: PropTypes.bool,
@@ -29,6 +28,8 @@ const defaultProps = {
   emptyMessage: 'No entries',
   allowAddItem: false,
   itemGenerator: () => ({}),
+  expandFieldset: null,
+  extraButtons: null,
 };
 const Frame = props => (
   <div className="frame">
@@ -100,6 +101,7 @@ export default class CRUDCollection extends React.PureComponent {
     const { columnLabels } = this.props;
     let label = columnLabels[col] ? columnLabels[col] : col;
     if (label.startsWith('__')) {
+      // special label-free columns (ie: caret for expand, delete cross)
       label = '';
     }
     return label;
diff --git a/superset/assets/src/CRUD/Field.jsx b/superset/assets/src/CRUD/Field.jsx
index 0fa0ad7..6b7b870 100644
--- a/superset/assets/src/CRUD/Field.jsx
+++ b/superset/assets/src/CRUD/Field.jsx
@@ -7,8 +7,8 @@ import {
 import './styles.less';
 
 const propTypes = {
-  value: PropTypes.any,
-  label: PropTypes.string,
+  value: PropTypes.any.isRequired,
+  label: PropTypes.string.isRequired,
   descr: PropTypes.node,
   fieldKey: PropTypes.string.isRequired,
   control: PropTypes.node.isRequired,
@@ -19,6 +19,7 @@ const defaultProps = {
   controlProps: {},
   onChange: () => {},
   compact: false,
+  desc: null,
 };
 
 export default class Field extends React.PureComponent {
diff --git a/superset/assets/src/CRUD/Fieldset.jsx b/superset/assets/src/CRUD/Fieldset.jsx
index 6c3c74e..6b03c07 100644
--- a/superset/assets/src/CRUD/Fieldset.jsx
+++ b/superset/assets/src/CRUD/Fieldset.jsx
@@ -6,14 +6,15 @@ import { recurseReactClone } from './utils';
 import Field from './Field';
 
 const propTypes = {
-  children: PropTypes.node,
-  onChange: PropTypes.func,
-  item: PropTypes.object,
+  children: PropTypes.node.isRequired,
+  onChange: PropTypes.func.isRequired,
+  item: PropTypes.object.isRequired,
   title: PropTypes.node,
   compact: PropTypes.bool,
 };
 const defaultProps = {
   compact: false,
+  title: null,
 };
 
 export default class Fieldset extends React.PureComponent {
diff --git a/superset/assets/src/components/EditableTitle.jsx b/superset/assets/src/components/EditableTitle.jsx
index 5e206c9..a3df712 100644
--- a/superset/assets/src/components/EditableTitle.jsx
+++ b/superset/assets/src/components/EditableTitle.jsx
@@ -19,6 +19,7 @@ const defaultProps = {
   showTooltip: true,
   onSaveTitle: () => {},
   emptyText: '<empty>',
+  style: null,
 };
 
 export default class EditableTitle extends React.PureComponent {
diff --git a/superset/assets/src/datasource/DatasourceModal.jsx b/superset/assets/src/datasource/DatasourceModal.jsx
index cef993b..690dc8e 100644
--- a/superset/assets/src/datasource/DatasourceModal.jsx
+++ b/superset/assets/src/datasource/DatasourceModal.jsx
@@ -2,16 +2,16 @@ import React from 'react';
 import PropTypes from 'prop-types';
 import { Alert, Button, Modal } from 'react-bootstrap';
 import Dialog from 'react-bootstrap-dialog';
+import $ from 'jquery';
 
 import { t } from '../locales';
 import DatasourceEditor from '../datasource/DatasourceEditor';
 import withToasts from '../messageToasts/enhancers/withToasts';
 
-const $ = window.$ = require('jquery');
 
 const propTypes = {
   onChange: PropTypes.func,
-  datasource: PropTypes.object,
+  datasource: PropTypes.object.isRequired,
   show: PropTypes.bool.isRequired,
   onHide: PropTypes.func,
   onDatasourceSave: PropTypes.func,
@@ -22,6 +22,7 @@ const defaultProps = {
   onChange: () => {},
   onHide: () => {},
   onDatasourceSave: () => {},
+  show: false,
 };
 
 class DatasourceModal extends React.PureComponent {
@@ -41,6 +42,7 @@ class DatasourceModal extends React.PureComponent {
     this.onDatasourceChange = this.onDatasourceChange.bind(this);
     this.onClickSave = this.onClickSave.bind(this);
     this.onConfirmSave = this.onConfirmSave.bind(this);
+    this.setDialogRef = this.setDialogRef.bind(this);
   }
   onClickSave() {
     this.dialog.show({
@@ -90,6 +92,9 @@ class DatasourceModal extends React.PureComponent {
   setSearchRef(searchRef) {
     this.searchRef = searchRef;
   }
+  setDialogRef(ref) {
+    this.dialog = ref;
+  }
   toggleShowDatasource() {
     this.setState({ showDatasource: !this.state.showDatasource });
   }
@@ -149,7 +154,7 @@ class DatasourceModal extends React.PureComponent {
               {t('Save')}
             </Button>
             <Button bsSize="sm" onClick={this.props.onHide}>{t('Cancel')}</Button>
-            <Dialog ref={(el) => { this.dialog = el; }} />
+            <Dialog ref={this.setDialogRef} />
           </span>
         </Modal.Footer>
       </Modal>);
diff --git a/superset/assets/src/explore/components/controls/CheckboxControl.jsx b/superset/assets/src/explore/components/controls/CheckboxControl.jsx
index 4c15c37..6f785cb 100644
--- a/superset/assets/src/explore/components/controls/CheckboxControl.jsx
+++ b/superset/assets/src/explore/components/controls/CheckboxControl.jsx
@@ -4,10 +4,8 @@ import ControlHeader from '../ControlHeader';
 import Checkbox from '../../../components/Checkbox';
 
 const propTypes = {
-  name: PropTypes.string,
   value: PropTypes.bool,
   label: PropTypes.string,
-  description: PropTypes.string,
   onChange: PropTypes.func,
 };