Skip to content
Snippets Groups Projects
Commit f6b40daa authored by Tom Robinson's avatar Tom Robinson
Browse files

Fix adding SQL cards to multiseries

parent 6d183646
No related branches found
No related tags found
No related merge requests found
......@@ -98,7 +98,12 @@ export default class AddSeriesModal extends Component {
this.setState({ series: this.state.series.filter(c => c.id !== card.id) });
}
} catch (e) {
console.error("onCardChange", e)
console.error("onCardChange", e);
this.setState({
state: "incompatible",
badCards: { ...this.state.badCards, [card.id]: true }
});
setTimeout(() => this.setState({ state: null }), 2000);
}
}
......
......@@ -27,13 +27,15 @@ export default class LineAreaBarChart extends Component {
}
static seriesAreCompatible(initialSeries, newSeries) {
// no bare rows
if (newSeries.card.dataset_query.query.aggregation[0] === "rows") {
return false;
}
// must have one and only one breakout
if (newSeries.card.dataset_query.query.breakout.length !== 1) {
return false;
if (newSeries.card.dataset_query.type === "query") {
// no bare rows
if (newSeries.card.dataset_query.query.aggregation[0] === "rows") {
return false;
}
// must have one and only one breakout
if (newSeries.card.dataset_query.query.breakout.length !== 1) {
return false;
}
}
return columnsAreCompatible(initialSeries.data.cols, newSeries.data.cols);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment