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

Fix timeseries widgets wonkiness. Resolves #4751.

parent 20ceb23b
Branches
Tags
No related merge requests found
......@@ -33,8 +33,10 @@ type Props = {
className: string,
card: CardObject,
tableMetadata: TableMetadata,
setDatasetQuery: (datasetQuery: DatasetQuery) => void,
runQuery: () => void
setDatasetQuery: (
datasetQuery: DatasetQuery,
options: { run: boolean }
) => void
};
type State = {
......@@ -89,8 +91,7 @@ export default class TimeseriesFilterWidget extends Component<*, Props, State> {
className,
card,
tableMetadata,
setDatasetQuery,
runQuery
setDatasetQuery
} = this.props;
const { filter, filterIndex, currentFilter } = this.state;
let currentDescription;
......@@ -144,11 +145,13 @@ export default class TimeseriesFilterWidget extends Component<*, Props, State> {
query = Query.addFilter(query, filter);
}
// $FlowFixMe
setDatasetQuery({
...card.dataset_query,
query
});
runQuery();
setDatasetQuery(
{
...card.dataset_query,
query
},
{ run: true }
);
}
if (this._popover) {
this._popover.close();
......
......@@ -19,15 +19,18 @@ import type {
type Props = {
card: CardObject,
setDatasetQuery: (datasetQuery: DatasetQuery) => void,
runQuery: () => void
setDatasetQuery: (
datasetQuery: DatasetQuery,
options: { run: boolean }
) => void
};
export default class TimeseriesGroupingWidget extends Component<*, Props, *> {
_popover: ?any;
render() {
const { card, setDatasetQuery, runQuery } = this.props;
const { card, setDatasetQuery } = this.props;
if (Card.isStructured(card)) {
const query = Card.getQuery(card);
const breakouts = query && Query.getBreakouts(query);
......@@ -58,11 +61,13 @@ export default class TimeseriesGroupingWidget extends Component<*, Props, *> {
breakout
);
// $FlowFixMe
setDatasetQuery({
...card.dataset_query,
query
});
runQuery();
setDatasetQuery(
{
...card.dataset_query,
query
},
{ run: true }
);
if (this._popover) {
this._popover.close();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment