Skip to content

Commit

Permalink
[filter box] making filter order matches the dropdown (#1007)
Browse files Browse the repository at this point in the history
fixes #1005
  • Loading branch information
mistercrunch committed Aug 26, 2016
1 parent 7eceb14 commit f17cfcb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion caravel/assets/visualizations/filter_box.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,15 @@ function filterBox(slice) {
// filter box should ignore the dashboard's filters
const url = slice.jsonEndpoint({ extraFilters: false });
$.getJSON(url, (payload) => {
const filtersChoices = {};
// Making sure the ordering of the fields matches the setting in the
// dropdown as it may have been shuffled while serialized to json
payload.form_data.groupby.forEach((f) => {
filtersChoices[f] = payload.data[f];
});
ReactDOM.render(
<FilterBox
filtersChoices={payload.data}
filtersChoices={filtersChoices}
onChange={slice.setFilter}
origSelectedValues={slice.getFilters() || {}}
/>,
Expand Down

0 comments on commit f17cfcb

Please sign in to comment.