From 0050129f9299999d6b63dda80cefc766beb5cb77 Mon Sep 17 00:00:00 2001 From: Akshata Katwal Date: Wed, 27 Nov 2024 12:21:01 +0530 Subject: [PATCH 1/3] Issue Bug PS-2680:Survey forms should show only Active cohorts --- src/pages/observation/[observationId]/index.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pages/observation/[observationId]/index.tsx b/src/pages/observation/[observationId]/index.tsx index 5d4f84d8..97d45b03 100644 --- a/src/pages/observation/[observationId]/index.tsx +++ b/src/pages/observation/[observationId]/index.tsx @@ -116,13 +116,17 @@ const ObservationDetails = () => { if (searchInput !== '' && entity === ObservationEntityType.CENTER) { const filteredData = response[0]?.childData?.filter( (cohort: any) => - cohort?.name - ?.toLowerCase() - .includes(searchInput?.toLowerCase()) + cohort?.name?.toLowerCase()?.includes(searchInput?.toLowerCase()) && + cohort?.status?.toLowerCase() === "active" ); + setMyCohortList(filteredData); } else { - setMyCohortList(response[0]?.childData); + const filteredData = response[0]?.childData?.filter( + (cohort: any) => cohort?.status?.toLowerCase() === "active" + ); + + setMyCohortList(filteredData); } if (selectedCohort === '') { From 30e3db84f73b0d0c9e7968aa4944c55d5479f873 Mon Sep 17 00:00:00 2001 From: suvarnakale Date: Wed, 27 Nov 2024 12:27:14 +0530 Subject: [PATCH 2/3] Issue #PS-2679 bug: Not able to update recurring session- fix --- src/components/PlannedSession.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/PlannedSession.tsx b/src/components/PlannedSession.tsx index 6897bec6..e7e6dea9 100644 --- a/src/components/PlannedSession.tsx +++ b/src/components/PlannedSession.tsx @@ -1509,7 +1509,21 @@ const PlannedSession: React.FC = ({ {t('COMMON.HELD_EVERY_WEEK_ON', { - days: block?.selectedWeekDays?.join(', '), + // days: + // block?.selectedWeekDays?.join(', ') || + // editSession?.recurrencePattern?.daysOfWeek, + days: ( + block?.selectedWeekDays || + editSession?.recurrencePattern?.daysOfWeek || + [] + ) + .map( + (dayIndex: any) => + ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][ + dayIndex + ] + ) + .join(', '), })} From 2eade69f65e6cd6e15ab06fb4dc9daab16c8c1d9 Mon Sep 17 00:00:00 2001 From: suvarnakale Date: Wed, 27 Nov 2024 12:29:36 +0530 Subject: [PATCH 3/3] Issue #PS-2679 bug: Not able to update recurring session- fix --- src/components/PlannedSession.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/PlannedSession.tsx b/src/components/PlannedSession.tsx index e7e6dea9..04e30502 100644 --- a/src/components/PlannedSession.tsx +++ b/src/components/PlannedSession.tsx @@ -1512,11 +1512,7 @@ const PlannedSession: React.FC = ({ // days: // block?.selectedWeekDays?.join(', ') || // editSession?.recurrencePattern?.daysOfWeek, - days: ( - block?.selectedWeekDays || - editSession?.recurrencePattern?.daysOfWeek || - [] - ) + days: (editSession?.recurrencePattern?.daysOfWeek || []) .map( (dayIndex: any) => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][