From f17cfcbfa277669f4864981174ce48ba7cc1ebee Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Fri, 26 Aug 2016 15:22:43 -0700 Subject: [PATCH] [filter box] making filter order matches the dropdown (#1007) fixes https://github.com/airbnb/caravel/issues/1005 --- caravel/assets/visualizations/filter_box.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/caravel/assets/visualizations/filter_box.jsx b/caravel/assets/visualizations/filter_box.jsx index f50e52eba..ca56ebb52 100644 --- a/caravel/assets/visualizations/filter_box.jsx +++ b/caravel/assets/visualizations/filter_box.jsx @@ -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( ,