[sql lab] preserve schema through visualize flow (#4742)

* [sql lab] preserve schema through visualize flow

https://github.com/apache/incubator-superset/pull/4696 got tangled
into refactoring views out of views/core.py and onto views/sql_lab.py

This is the same PR without the refactoring.

* Fix lint
This commit is contained in:
Maxime Beauchemin
2018-04-04 13:38:37 -07:00
committed by GitHub
parent 9a79d33e0d
commit 3b7e0a951a
6 changed files with 38 additions and 2 deletions

View File

@@ -31,6 +31,7 @@ const propTypes = {
onHide: PropTypes.func,
query: PropTypes.object,
show: PropTypes.bool,
schema: PropTypes.string,
datasource: PropTypes.string,
errorMessage: PropTypes.string,
timeout: PropTypes.number,
@@ -48,6 +49,7 @@ class VisualizeModal extends React.PureComponent {
chartType: CHART_TYPES[0],
datasourceName: this.datasourceName(),
columns: this.getColumnFromProps(),
schema: props.query ? props.query.schema : null,
hints: [],
};
}
@@ -126,6 +128,7 @@ class VisualizeModal extends React.PureComponent {
buildVizOptions() {
return {
chartType: this.state.chartType.value,
schema: this.state.schema,
datasourceName: this.state.datasourceName,
columns: this.state.columns,
sql: this.props.query.sql,