[explorev2] Bug fixes in Save Modal (#1707)

* Bug fixes in Save Modal
Issues solved:
 - Save button doesn't pass in gotodash
 - slice_name was passed in from store as original slice_name instead of
   new one in 'saveas' action
 - datasource_type wasn't passed in to defaultViz and defaultForm
   function

* Change css filename to exploreV2

* Moved out utils
This commit is contained in:
vera-liu
2016-11-29 15:03:15 -08:00
committed by GitHub
parent dc98c6739f
commit 03b21dcf0a
7 changed files with 53 additions and 49 deletions

View File

@@ -4,7 +4,7 @@ import $ from 'jquery';
import { Modal, Alert, Button, Radio } from 'react-bootstrap';
import Select from 'react-select';
import { connect } from 'react-redux';
import { getParamObject } from '../../modules/utils.js';
import { getParamObject } from '../exploreUtils';
const propTypes = {
can_edit: PropTypes.bool,
@@ -58,7 +58,8 @@ class SaveModal extends React.Component {
saveOrOverwrite(gotodash) {
this.setState({ alert: null });
this.props.actions.removeSaveModalAlert();
const params = getParamObject(this.props.form_data, this.props.datasource_type);
const params = getParamObject(
this.props.form_data, this.props.datasource_type, this.state.action === 'saveas');
const sliceParams = {};
params.datasource_name = this.props.form_data.datasource_name;
@@ -199,7 +200,7 @@ class SaveModal extends React.Component {
type="button"
id="btn_modal_save"
className="btn pull-left"
onClick={this.saveOrOverwrite.bind(this)}
onClick={this.saveOrOverwrite.bind(this, false)}
>
Save
</Button>