Skip to content

Commit

Permalink
Selection of Planning filter is lost on scrolling down and up - update (
Browse files Browse the repository at this point in the history
  • Loading branch information
dzonidoo authored Feb 12, 2024
1 parent 0b5f89b commit 34c07b7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion client/api/ui/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
11 changes: 10 additions & 1 deletion client/components/Main/FiltersBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<IProps> {
componentDidUpdate(): void {
const {urlParams} = superdeskApi.browser.location;

urlParams.setString('eventsPlanningFilter', this.props.currentFilterId);
}

render() {
const privileges = this.props.privileges;
let filter_items = [];
Expand Down

0 comments on commit 34c07b7

Please sign in to comment.