Skip to content

Commit

Permalink
events planning filter
Browse files Browse the repository at this point in the history
  • Loading branch information
dzonidoo committed Jan 23, 2024
1 parent 65434dc commit 3164dc8
Show file tree
Hide file tree
Showing 2 changed files with 11 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
10 changes: 9 additions & 1 deletion client/components/Main/FiltersBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,28 @@ 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(prevProps: Readonly<IProps>, prevState: Readonly<{}>, snapshot?: any): void {
const {urlParams} = superdeskApi.browser.location;

Check failure on line 28 in client/components/Main/FiltersBox.tsx

View workflow job for this annotation

GitHub Actions / client (14.x)

Expected blank line after variable declarations
urlParams.setString('eventsPlanningFilter', this.props.currentFilterId);
}

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

0 comments on commit 3164dc8

Please sign in to comment.