Fix error in searchbox in tickets/search-tickets (#891)
This commit is contained in:
parent
994a39ad6d
commit
a64c9f2255
|
@ -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';
|
||||
|
|
|
@ -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}`;
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue