You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2020/11/18 03:53:57 UTC

[incubator-superset] branch hugh/SO-1117-modal updated (d3cd168 -> 4c7364f)

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

hugh pushed a change to branch hugh/SO-1117-modal
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git.


    from d3cd168  fix the filteroption
     new e72d882  💯
     new 4c7364f  move state to upper component

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 superset-frontend/src/SqlLab/components/ResultSet.tsx        | 11 ++++++++++-
 superset-frontend/src/SqlLab/components/SaveDatasetModal.tsx | 10 ++--------
 2 files changed, 12 insertions(+), 9 deletions(-)


[incubator-superset] 02/02: move state to upper component

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch hugh/SO-1117-modal
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit 4c7364f7078948b16a20778deaf60f11b8f3685c
Author: hughhhh <hu...@gmail.com>
AuthorDate: Tue Nov 17 19:34:41 2020 -0800

    move state to upper component
---
 superset-frontend/src/SqlLab/components/ResultSet.tsx        | 11 ++++++++++-
 superset-frontend/src/SqlLab/components/SaveDatasetModal.tsx |  9 ++-------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/superset-frontend/src/SqlLab/components/ResultSet.tsx b/superset-frontend/src/SqlLab/components/ResultSet.tsx
index e8d7fac..71337a6 100644
--- a/superset-frontend/src/SqlLab/components/ResultSet.tsx
+++ b/superset-frontend/src/SqlLab/components/ResultSet.tsx
@@ -91,7 +91,8 @@ export default class ResultSet extends React.PureComponent<
       data: [],
       showSaveDatasetModal: false,
       newSaveDatasetName: '',
-      userDatasetsOwned: []
+      userDatasetsOwned: [],
+      saveDatasetRadioBtnState: 1,
     };
 
     this.changeSearch = this.changeSearch.bind(this);
@@ -104,6 +105,7 @@ export default class ResultSet extends React.PureComponent<
     this.handleSaveInDataset = this.handleSaveInDataset.bind(this);
     this.handleHideSaveModal = this.handleHideSaveModal.bind(this);
     this.handleDatasetNameChange = this.handleDatasetNameChange.bind(this);
+    this.handleSaveDatasetRadioBtnState = this.handleSaveDatasetRadioBtnState.bind(this);
   }
 
   componentDidMount() {
@@ -238,6 +240,11 @@ export default class ResultSet extends React.PureComponent<
     this.setState({showSaveDatasetModal: false})
   }
 
+  handleSaveDatasetRadioBtnState(e) {
+    console.log(e.target.value)
+    this.setState({saveDatasetRadioBtnState: e.target.value});
+  }
+
   renderControls() {
     if (this.props.search || this.props.visualize || this.props.csv) {
       let { data } = this.props.query.results;
@@ -254,6 +261,8 @@ export default class ResultSet extends React.PureComponent<
             onCancel={this.handleHideSaveModal}
             handleDatasetNameChange={this.handleDatasetNameChange}
             userDatasetsOwned={this.state.userDatasetsOwned}
+            handleSaveDatasetRadioBtnState={this.handleSaveDatasetRadioBtnState}
+            saveDatasetRadioBtnState={this.state.saveDatasetRadioBtnState}
           />
           <div className="ResultSetButtons">
             {this.props.visualize &&
diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetModal.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetModal.tsx
index 3f6d96c..77016e2 100644
--- a/superset-frontend/src/SqlLab/components/SaveDatasetModal.tsx
+++ b/superset-frontend/src/SqlLab/components/SaveDatasetModal.tsx
@@ -33,8 +33,7 @@ interface SaveDatasetModalProps = {
 }
 
 // eslint-disable-next-line no-empty-pattern
-export const SaveDatasetModal: FunctionComponent<> = ({visible, onOk, onCancel, handleDatasetNameChange, userDatasetsOwned}) => {
-  const [value, setValue] = useState('');
+export const SaveDatasetModal: FunctionComponent<> = ({visible, onOk, onCancel, handleDatasetNameChange, userDatasetsOwned, handleSaveDatasetRadioBtnState, saveDatasetRadioBtnState}) => {
   const [options, setOptions] = useState([]);
   const [radioOption, setRadioOptions] = useState(1);
 
@@ -52,10 +51,6 @@ export const SaveDatasetModal: FunctionComponent<> = ({visible, onOk, onCancel,
     console.log('onSelect', data);
   };
 
-  const onRadioChange = e => {
-    setRadioOptions(e.target.value)
-  };
-
   const radioStyle = {
     display: 'block',
     height: '30px',
@@ -84,7 +79,7 @@ export const SaveDatasetModal: FunctionComponent<> = ({visible, onOk, onCancel,
         <div>
           To explore the results of this query, we need to save it as a virtual dataset
         </div>
-        <Radio.Group onChange={onRadioChange} value={radioOption}>
+        <Radio.Group onChange={handleSaveDatasetRadioBtnState} value={saveDatasetRadioBtnState}>
           <Radio style={radioStyle} value={1}>
             Save as new dataset
             <Input style={{ width: 200 }} defaultValue="my_new_dataset_A" onChange={handleDatasetNameChange} />


[incubator-superset] 01/02: 💯

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch hugh/SO-1117-modal
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit e72d8820c94d298db004eb3ed3951cc2c29c9b25
Author: hughhhh <hu...@gmail.com>
AuthorDate: Tue Nov 17 19:10:07 2020 -0800

    💯
---
 superset-frontend/src/SqlLab/components/SaveDatasetModal.tsx | 1 -
 1 file changed, 1 deletion(-)

diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetModal.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetModal.tsx
index 58e821a..3f6d96c 100644
--- a/superset-frontend/src/SqlLab/components/SaveDatasetModal.tsx
+++ b/superset-frontend/src/SqlLab/components/SaveDatasetModal.tsx
@@ -53,7 +53,6 @@ export const SaveDatasetModal: FunctionComponent<> = ({visible, onOk, onCancel,
   };
 
   const onRadioChange = e => {
-    console.log('radio checked', e.target.value);
     setRadioOptions(e.target.value)
   };