Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection of Planning filter is lost on scrolling down and up - update #1902

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading