Skip to content

Commit

Permalink
fixing the datasource inconsistence but in visualize flow (#3698)
Browse files Browse the repository at this point in the history
datasource in landing explore view is not the datasource created in sal lab.
  • Loading branch information
Grace Guo authored Oct 24, 2017
1 parent 58ea736 commit 18e9640
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 18e9640

Please sign in to comment.