diff --git a/client/src/app/admin/panel/admin-panel-menu.js b/client/src/app/admin/panel/admin-panel-menu.js index 0e3c07d0..cc367d22 100644 --- a/client/src/app/admin/panel/admin-panel-menu.js +++ b/client/src/app/admin/panel/admin-panel-menu.js @@ -3,7 +3,6 @@ import _ from 'lodash'; import {connect} from 'react-redux'; import i18n from 'lib-app/i18n'; -import searchTicketsUtils from 'lib-app/search-tickets-utils'; import Menu from 'core-components/menu'; import queryString from 'query-string'; diff --git a/client/src/lib-app/search-tickets-utils.js b/client/src/lib-app/search-tickets-utils.js index ba3a5cc9..55f1b767 100644 --- a/client/src/lib-app/search-tickets-utils.js +++ b/client/src/lib-app/search-tickets-utils.js @@ -102,11 +102,15 @@ export default { getFiltersForURL(filtersWithShouldRemoveParams) { const shouldRemoveCustomParam = filtersWithShouldRemoveParams.shouldRemoveCustomParam ? filtersWithShouldRemoveParams.shouldRemoveCustomParam : false; const shouldRemoveUseInitialValuesParam = filtersWithShouldRemoveParams.shouldRemoveUseInitialValuesParam ? filtersWithShouldRemoveParams.shouldRemoveUseInitialValuesParam : false; - let filters = filtersWithShouldRemoveParams.filters; + const currentSearchParams = queryString.parse(window.location.search); + let filters = { + ...currentSearchParams, + ...filtersWithShouldRemoveParams.filters, + }; filters = { - ...queryString.parse(window.location.search), ...filters, + query: filters.query ? encodeURIComponent(filters.query) : filters.query }; if(shouldRemoveCustomParam) delete filters.custom; @@ -127,7 +131,7 @@ export default { else return query + `&${filter}=${JSON.stringify(value)}`; }, '').slice(1); - if(!_.isEqual(queryString.parse(`?${query}`), queryString.parse(window.location.search))) { + if(!_.isEqual(queryString.parse(`?${query}`), currentSearchParams)) { return `?${query}`; } },