diff --git a/src/components/events/partials/EventsDateCell.tsx b/src/components/events/partials/EventsDateCell.tsx index 6d1ae9127f..e91f220d9a 100644 --- a/src/components/events/partials/EventsDateCell.tsx +++ b/src/components/events/partials/EventsDateCell.tsx @@ -1,7 +1,7 @@ import React from "react"; import { useTranslation } from "react-i18next"; import { editFilterValue } from "../../../slices/tableFilterSlice"; -import { loadEventsIntoTable } from "../../../thunks/tableThunks"; +import { loadEventsIntoTable, goToPage } from "../../../thunks/tableThunks"; import { getFilters } from "../../../selectors/tableFilterSelectors"; import { useAppDispatch, useAppSelector } from "../../../store"; import { fetchEvents } from "../../../slices/eventSlice"; @@ -35,6 +35,7 @@ const EventsDateCell = ({ endDate.setMinutes(59); endDate.setSeconds(59); + dispatch(goToPage(0)); await dispatch(editFilterValue({filterName: filter.name, value: startDate.toISOString() + "/" + endDate.toISOString()})); await dispatch(fetchEvents()); dispatch(loadEventsIntoTable()); diff --git a/src/components/events/partials/EventsLocationCell.tsx b/src/components/events/partials/EventsLocationCell.tsx index 6fa11c22c0..7f758c3a98 100644 --- a/src/components/events/partials/EventsLocationCell.tsx +++ b/src/components/events/partials/EventsLocationCell.tsx @@ -1,7 +1,7 @@ import React from "react"; import { getFilters } from "../../../selectors/tableFilterSelectors"; import { editFilterValue } from "../../../slices/tableFilterSlice"; -import { loadEventsIntoTable } from "../../../thunks/tableThunks"; +import { loadEventsIntoTable, goToPage } from "../../../thunks/tableThunks"; import { useAppDispatch, useAppSelector } from "../../../store"; import { fetchEvents } from "../../../slices/eventSlice"; import { Event } from "../../../slices/eventSlice"; @@ -23,6 +23,7 @@ const EventsLocationCell = ({ const addFilter = (location: string) => { let filter = filterMap.find(({ name }) => name === "location"); if (!!filter) { + dispatch(goToPage(0)); dispatch(editFilterValue({filterName: filter.name, value: location})); dispatch(fetchEvents()); dispatch(loadEventsIntoTable()); diff --git a/src/components/events/partials/EventsPresentersCell.tsx b/src/components/events/partials/EventsPresentersCell.tsx index e0611a460b..7e5a33c9ef 100644 --- a/src/components/events/partials/EventsPresentersCell.tsx +++ b/src/components/events/partials/EventsPresentersCell.tsx @@ -1,7 +1,7 @@ import React from "react"; import { getFilters } from "../../../selectors/tableFilterSelectors"; import { editFilterValue } from "../../../slices/tableFilterSlice"; -import { loadEventsIntoTable } from "../../../thunks/tableThunks"; +import { loadEventsIntoTable, goToPage } from "../../../thunks/tableThunks"; import { useAppDispatch, useAppSelector } from "../../../store"; import { fetchEvents } from "../../../slices/eventSlice"; import { Event } from "../../../slices/eventSlice"; @@ -25,6 +25,7 @@ const EventsPresentersCell = ({ ({ name }) => name === "presentersBibliographic" ); if (!!filter) { + dispatch(goToPage(0)); await dispatch(editFilterValue({filterName: filter.name, value: presenter})); await dispatch(fetchEvents()); dispatch(loadEventsIntoTable()); diff --git a/src/components/events/partials/EventsSeriesCell.tsx b/src/components/events/partials/EventsSeriesCell.tsx index 2680d425ab..375a93a4da 100644 --- a/src/components/events/partials/EventsSeriesCell.tsx +++ b/src/components/events/partials/EventsSeriesCell.tsx @@ -1,7 +1,7 @@ import React from "react"; import { getFilters } from "../../../selectors/tableFilterSelectors"; import { editFilterValue } from "../../../slices/tableFilterSlice"; -import { loadEventsIntoTable } from "../../../thunks/tableThunks"; +import { loadEventsIntoTable, goToPage } from "../../../thunks/tableThunks"; import { useAppDispatch, useAppSelector } from "../../../store"; import { fetchEvents } from "../../../slices/eventSlice"; import { Event } from "../../../slices/eventSlice"; @@ -23,6 +23,7 @@ const EventsSeriesCell = ({ const addFilter = async (seriesId: string) => { let filter = filterMap.find(({ name }) => name === "series"); if (!!filter) { + dispatch(goToPage(0)); await dispatch(editFilterValue({filterName: filter.name, value: seriesId})); await dispatch(fetchEvents()); dispatch(loadEventsIntoTable()); diff --git a/src/components/events/partials/EventsTechnicalDateCell.tsx b/src/components/events/partials/EventsTechnicalDateCell.tsx index 585e2f711e..dd36674fce 100644 --- a/src/components/events/partials/EventsTechnicalDateCell.tsx +++ b/src/components/events/partials/EventsTechnicalDateCell.tsx @@ -2,7 +2,7 @@ import React from "react"; import { useTranslation } from "react-i18next"; import { getFilters } from "../../../selectors/tableFilterSelectors"; import { editFilterValue } from "../../../slices/tableFilterSlice"; -import { loadEventsIntoTable } from "../../../thunks/tableThunks"; +import { loadEventsIntoTable, goToPage } from "../../../thunks/tableThunks"; import { useAppDispatch, useAppSelector } from "../../../store"; import { fetchEvents } from "../../../slices/eventSlice"; import { renderValidDate } from "../../../utils/dateUtils"; @@ -26,6 +26,7 @@ const EventsTechnicalDateCell = ({ const addFilter = async (date: string) => { let filter = filterMap.find(({ name }) => name === "technicalStart"); if (!!filter) { + dispatch(goToPage(0)); await dispatch(editFilterValue({filterName: filter.name, value: date + "/" + date})); await dispatch(fetchEvents()); dispatch(loadEventsIntoTable()); diff --git a/src/components/shared/Stats.tsx b/src/components/shared/Stats.tsx index 4b13893e51..79e70c80a9 100644 --- a/src/components/shared/Stats.tsx +++ b/src/components/shared/Stats.tsx @@ -9,7 +9,7 @@ import { editTextFilter, removeTextFilter, } from "../../slices/tableFilterSlice"; -import { loadEventsIntoTable } from "../../thunks/tableThunks"; +import { loadEventsIntoTable, goToPage } from "../../thunks/tableThunks"; import { useAppDispatch, useAppSelector } from "../../store"; import { fetchEvents } from "../../slices/eventSlice"; import { ParseKeys } from "i18next"; @@ -38,6 +38,7 @@ const Stats = () => { let filter = filterMap.find(({ name }) => name === f.name); filterValue = f.value; if (!!filter) { + dispatch(goToPage(0)); dispatch(editFilterValue({filterName: filter.name, value: filterValue})); } });