mirror of https://github.com/apache/superset.git
fixing the datasource inconsistence but in visualize flow (#3698)
datasource in landing explore view is not the datasource created in sal lab.
This commit is contained in:
parent
58ea736ed6
commit
18e9640d99
|
@ -151,11 +151,12 @@ class VisualizeModal extends React.PureComponent {
|
|||
}
|
||||
visualize() {
|
||||
this.props.actions.createDatasource(this.buildVizOptions(), this)
|
||||
.done(() => {
|
||||
.done((resp) => {
|
||||
const columns = Object.keys(this.state.columns).map(k => this.state.columns[k]);
|
||||
const data = JSON.parse(resp);
|
||||
const mainGroupBy = columns.filter(d => d.is_dim)[0];
|
||||
const formData = {
|
||||
datasource: this.props.datasource,
|
||||
datasource: `${data.table_id}__table`,
|
||||
viz_type: this.state.chartType.value,
|
||||
since: '100 years ago',
|
||||
limit: '0',
|
||||
|
|
|
@ -340,6 +340,8 @@ describe('VisualizeModal', () => {
|
|||
wrapper.setProps({ actions: { createDatasource: datasourceSpy } });
|
||||
|
||||
wrapper.instance().visualize();
|
||||
expect(exploreUtils.getExploreUrl.callCount).to.equal(1);
|
||||
expect(exploreUtils.getExploreUrl.getCall(0).args[0].datasource).to.equal('107__table');
|
||||
expect(window.open.callCount).to.equal(1);
|
||||
});
|
||||
it('should notify error', () => {
|
||||
|
|
Loading…
Reference in New Issue