From 96f38be54013193425e85aec54c3dc004f722621 Mon Sep 17 00:00:00 2001 From: Ketan <73937490+devketanpro@users.noreply.github.com> Date: Fri, 17 May 2024 08:41:50 +0200 Subject: [PATCH] Fix: display of accurate Items using manual filters search [SDESK-7264] (#1988) * Updated the function to include the params * address comment --- .../components/Main/FilterSubnavDropdown.tsx | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/client/components/Main/FilterSubnavDropdown.tsx b/client/components/Main/FilterSubnavDropdown.tsx index b3e33e58f..fdcb8322d 100644 --- a/client/components/Main/FilterSubnavDropdown.tsx +++ b/client/components/Main/FilterSubnavDropdown.tsx @@ -79,7 +79,10 @@ class FilterSubnavDropdownComponent extends React.PureComponent { return filters.map((filter) => ({ id: filter._id, label: filter.name, - action: () => planningApi.ui.list.changeFilterId(filter._id), + action: () => planningApi.ui.list.changeFilterId( + filter._id, + {advancedSearch: {dates: {range: filter?.params?.date_filter}}} + ), group: gettext('Search Filters'), })); } @@ -93,7 +96,10 @@ class FilterSubnavDropdownComponent extends React.PureComponent { label: this.hasGlobalFiltersPrivilege() ? gettext('All Events & Planning') : gettext('My Events & Planning'), - action: () => planningApi.ui.list.changeFilterId(EVENTS_PLANNING.FILTER.ALL_EVENTS_PLANNING), + action: () => planningApi.ui.list.changeFilterId( + EVENTS_PLANNING.FILTER.ALL_EVENTS_PLANNING, + {advancedSearch: {}} + ), group: '', } ]; @@ -107,7 +113,10 @@ class FilterSubnavDropdownComponent extends React.PureComponent { label: this.hasGlobalFiltersPrivilege() ? gettext('All Events') : gettext('My Events'), - action: () => planningApi.ui.list.changeCalendarId(EVENTS.FILTER.ALL_CALENDARS), + action: () => planningApi.ui.list.changeCalendarId( + EVENTS.FILTER.ALL_CALENDARS, + {advancedSearch: {}} + ), group: '', }, { id: 'no_calendar', @@ -163,7 +172,10 @@ class FilterSubnavDropdownComponent extends React.PureComponent { label: this.hasGlobalFiltersPrivilege() ? gettext('All Planning Items') : gettext('My Planning'), - action: () => planningApi.ui.list.changeAgendaId(AGENDA.FILTER.ALL_PLANNING), + action: () => planningApi.ui.list.changeAgendaId( + AGENDA.FILTER.ALL_PLANNING, + {advancedSearch: {}} + ), group: '', }, { id: 'no_agenda',