From 2f06fbe68b62cd4cf47189f131949377691b21bf Mon Sep 17 00:00:00 2001 From: 9sneha-n <9sneha.n@gmail.com> Date: Thu, 23 May 2024 21:47:38 +0530 Subject: [PATCH] fix: add status filter for prevalence --- .../components/survey-list/SurveyList.tsx | 4 ++ .../survey-list/SurveyListFilters.tsx | 54 ++++++++++--------- .../survey-list/hook/useFilteredSurveys.ts | 2 +- 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/src/webapp/components/survey-list/SurveyList.tsx b/src/webapp/components/survey-list/SurveyList.tsx index 59fb9287..79484a33 100644 --- a/src/webapp/components/survey-list/SurveyList.tsx +++ b/src/webapp/components/survey-list/SurveyList.tsx @@ -133,6 +133,10 @@ export const SurveyList: React.FC = ({ surveyFormType }) => { /> )} + {surveyFormType === "PrevalenceSurveyForm" && ( + + )} + {isPaginatedSurveyList(surveyFormType) ? ( >; - surveyType: SURVEY_TYPES | undefined; - setSurveyType: Dispatch>; + surveyType?: SURVEY_TYPES | undefined; + setSurveyType?: Dispatch>; } export const SurveyListFilters: React.FC = ({ status, @@ -18,7 +18,7 @@ export const SurveyListFilters: React.FC = ({ }) => { return ( - + {i18n.t("Filter by Status")} - - {i18n.t("Filter by Survey Type")} - - + {setSurveyType && ( + + {i18n.t("Filter by Survey Type")} + + + )} ); }; diff --git a/src/webapp/components/survey-list/hook/useFilteredSurveys.ts b/src/webapp/components/survey-list/hook/useFilteredSurveys.ts index 85bba493..dfb2cc29 100644 --- a/src/webapp/components/survey-list/hook/useFilteredSurveys.ts +++ b/src/webapp/components/survey-list/hook/useFilteredSurveys.ts @@ -26,7 +26,7 @@ export function useFilteredSurveys( useEffect(() => { //filters apply only to PPSSurveyForm - if (surveyFormType !== "PPSSurveyForm") { + if (surveyFormType !== "PPSSurveyForm" && surveyFormType !== "PrevalenceSurveyForm") { setStatusFilter(undefined); setSurveyTypeFilter(undefined); }