Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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