diff --git a/backend/app/api/v1/endpoints/cpt/maps/ocm.py b/backend/app/api/v1/endpoints/cpt/maps/ocm.py index c179548..6d8a282 100644 --- a/backend/app/api/v1/endpoints/cpt/maps/ocm.py +++ b/backend/app/api/v1/endpoints/cpt/maps/ocm.py @@ -19,6 +19,5 @@ async def ocmMapper(start_datetime: date, end_datetime: date, size: int, offset: df["testName"] = df["attack"] df["startDate"] = df["metrics.earliest"] df["endDate"] = df["metrics.end"] - return {"data": df, "total": response["total"]} return {"data": pd.DataFrame(), "total": 0} diff --git a/frontend/src/actions/filterActions.js b/frontend/src/actions/filterActions.js index 7f56588..ebdb0b7 100644 --- a/frontend/src/actions/filterActions.js +++ b/frontend/src/actions/filterActions.js @@ -1,29 +1,29 @@ import { + applyCPTDateFilter, removeCPTAppliedFilters, setCPTAppliedFilters, setCPTCatFilters, - setCPTDateFilter, setCPTOtherSummaryFilter, } from "./homeActions"; import { + applyOCPDateFilter, removeOCPAppliedFilters, setOCPAppliedFilters, setOCPCatFilters, - setOCPDateFilter, setOCPOtherSummaryFilter, } from "./ocpActions"; import { + applyQuayDateFilter, removeQuayAppliedFilters, setQuayAppliedFilters, setQuayCatFilters, - setQuayDateFilter, setQuayOtherSummaryFilter, } from "./quayActions"; import { + applyTelcoDateFilter, removeTelcoAppliedFilters, setTelcoAppliedFilters, setTelcoCatFilters, - setTelcoDateFilter, setTelcoOtherSummaryFilter, } from "./telcoActions"; @@ -69,13 +69,13 @@ export const removeAppliedFilters = (key, value, navigation, currType) => { export const setDateFilter = (date, key, navigation, currType) => { if (currType === "cpt") { - dispatch(setCPTDateFilter(date, key, navigation)); + dispatch(applyCPTDateFilter(date, key, navigation)); } else if (currType === "ocp") { - dispatch(setOCPDateFilter(date, key, navigation)); + dispatch(applyOCPDateFilter(date, key, navigation)); } else if (currType === "quay") { - dispatch(setQuayDateFilter(date, key, navigation)); + dispatch(applyQuayDateFilter(date, key, navigation)); } else if (currType === "telco") { - dispatch(setTelcoDateFilter(date, key, navigation)); + dispatch(applyTelcoDateFilter(date, key, navigation)); } }; diff --git a/frontend/src/actions/homeActions.js b/frontend/src/actions/homeActions.js index 303c621..ce51a2c 100644 --- a/frontend/src/actions/homeActions.js +++ b/frontend/src/actions/homeActions.js @@ -211,8 +211,12 @@ export const setCPTDateFilter = }); appendQueryString({ ...appliedFilters, start_date, end_date }, navigate); + }; - // dispatch(fetchOCPJobsData()); +export const applyCPTDateFilter = + (start_date, end_date, navigate) => (dispatch) => { + dispatch(setCPTDateFilter(start_date, end_date, navigate)); + dispatch(fetchOCPJobsData()); }; export const setCPTPage = (pageNo) => ({ diff --git a/frontend/src/actions/ocpActions.js b/frontend/src/actions/ocpActions.js index ecf0174..94657b1 100644 --- a/frontend/src/actions/ocpActions.js +++ b/frontend/src/actions/ocpActions.js @@ -186,10 +186,13 @@ export const setOCPDateFilter = }); appendQueryString({ ...appliedFilters, start_date, end_date }, navigate); + }; +export const applyOCPDateFilter = + (start_date, end_date, navigate) => (dispatch) => { + dispatch(setOCPDateFilter(start_date, end_date, navigate)); dispatch(fetchOCPJobs()); }; - export const setFilterFromURL = (searchParams) => ({ type: TYPES.SET_OCP_APPLIED_FILTERS, payload: searchParams, diff --git a/frontend/src/actions/quayActions.js b/frontend/src/actions/quayActions.js index bcfa0d4..7179188 100644 --- a/frontend/src/actions/quayActions.js +++ b/frontend/src/actions/quayActions.js @@ -191,7 +191,11 @@ export const setQuayDateFilter = }); appendQueryString({ ...appliedFilters, start_date, end_date }, navigate); + }; +export const applyQuayDateFilter = + (start_date, end_date, navigate) => (dispatch) => { + dispatch(setQuayDateFilter(start_date, end_date, navigate)); dispatch(fetchQuayJobsData()); }; diff --git a/frontend/src/actions/telcoActions.js b/frontend/src/actions/telcoActions.js index 59475d5..923c9e6 100644 --- a/frontend/src/actions/telcoActions.js +++ b/frontend/src/actions/telcoActions.js @@ -194,8 +194,12 @@ export const setTelcoDateFilter = }); appendQueryString({ ...appliedFilters, start_date, end_date }, navigate); + }; - //dispatch(fetchTelcoJobsData()); +export const applyTelcoDateFilter = + (start_date, end_date, navigate) => (dispatch) => { + dispatch(setTelcoDateFilter(start_date, end_date, navigate)); + dispatch(fetchTelcoJobsData()); }; export const getTelcoSummary = () => (dispatch, getState) => {