diff --git a/client/api/ui/list.ts b/client/api/ui/list.ts index 9a7d2b48d..fce2f1593 100644 --- a/client/api/ui/list.ts +++ b/client/api/ui/list.ts @@ -102,8 +102,9 @@ function changeFilterId(id: ISearchFilter['_id'], params: ICombinedEventOrPlanni type: EVENTS_PLANNING.ACTIONS.SELECT_EVENTS_PLANNING_FILTER, payload: id, }); - urlParams.setString('eventsPlanningFilter', id); } + urlParams.setString('eventsPlanningFilter', id); + return reloadList(params); } diff --git a/client/components/Main/FiltersBox.tsx b/client/components/Main/FiltersBox.tsx index 98eeadaea..a21719f51 100644 --- a/client/components/Main/FiltersBox.tsx +++ b/client/components/Main/FiltersBox.tsx @@ -7,20 +7,29 @@ import {StretchBar} from '../UI/SubNav'; import {PLANNING_VIEW} from '../../interfaces'; import {activeFilter as getCurrentView} from '../../selectors/main'; -import {planningApi} from '../../superdeskApi'; +import {planningApi, superdeskApi} from '../../superdeskApi'; import {PRIVILEGES} from '../../constants'; +import * as selectors from '../../selectors'; interface IProps { showFilters?: boolean; // defaults to true currentView: PLANNING_VIEW; privileges: {[key: string]: number}; + currentFilterId?: any; } const mapStateToProps = (state) => ({ currentView: getCurrentView(state), + currentFilterId: selectors.main.currentSearchFilterId(state), }); class FiltersBoxComponent extends React.PureComponent { + componentDidUpdate(): void { + const {urlParams} = superdeskApi.browser.location; + + urlParams.setString('eventsPlanningFilter', this.props.currentFilterId); + } + render() { const privileges = this.props.privileges; let filter_items = [];