[filter box] making filter order matches the dropdown (#1007)
fixes https://github.com/airbnb/caravel/issues/1005
This commit is contained in:
parent
7eceb140be
commit
f17cfcbfa2
|
|
@ -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() || {}}
|
||||
/>,
|
||||
|
|
|
|||
Loading…
Reference in New Issue