From 9105ff3e4ca495db11df00821b309f5471ecf583 Mon Sep 17 00:00:00 2001 From: Mozafar Haider Date: Tue, 5 Mar 2024 13:07:22 +0000 Subject: [PATCH] fix(migration-trackedentity): change followupStatus to followup and ensure that the parameter is not selected if ALL is chosen --- src/components/Inputs/FollowUpStatus.js | 6 +++--- src/pages/TEIExport/TEIExport.js | 2 +- src/pages/TEIExport/form-helper.js | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/Inputs/FollowUpStatus.js b/src/components/Inputs/FollowUpStatus.js index d09234ab0..1fc2383d0 100644 --- a/src/components/Inputs/FollowUpStatus.js +++ b/src/components/Inputs/FollowUpStatus.js @@ -5,12 +5,12 @@ import { RadioGroupField } from '../index.js' const followUpStatusOptions = [ { value: 'ALL', label: i18n.t('All') }, - { value: 'TRUE', label: i18n.t('Marked for follow-up') }, - { value: 'FALSE', label: i18n.t('Not marked for follow-up') }, + { value: 'true', label: i18n.t('Marked for follow-up') }, + { value: 'false', label: i18n.t('Not marked for follow-up') }, ] const defaultFollowUpStatusOption = followUpStatusOptions[0].value -const NAME = 'followUpStatus' +const NAME = 'followup' const DATATEST = 'input-follow-up-status' const LABEL = i18n.t('Include only entities with follow-up status') diff --git a/src/pages/TEIExport/TEIExport.js b/src/pages/TEIExport/TEIExport.js index 56c0dd08a..e039acc1d 100644 --- a/src/pages/TEIExport/TEIExport.js +++ b/src/pages/TEIExport/TEIExport.js @@ -68,7 +68,7 @@ const initialValues = { inclusion: defaultInclusionOption, teiTypeFilter: defaultTEITypeFilterOption, programStatus: defaultProgramStatusOption, - followUpStatus: defaultFollowUpStatusOption, + followup: defaultFollowUpStatusOption, enrollmentEnrolledAfter: '', enrollmentEnrolledBefore: '', compression: '', // disable compression until it is properly implemented in the backend diff --git a/src/pages/TEIExport/form-helper.js b/src/pages/TEIExport/form-helper.js index d74f0ed6b..d0ed98e39 100644 --- a/src/pages/TEIExport/form-helper.js +++ b/src/pages/TEIExport/form-helper.js @@ -25,7 +25,7 @@ const valuesToParams = ( assignedUserMode, teiTypeFilter, programStatus, - followUpStatus, + followup, enrollmentEnrolledAfter, enrollmentEnrolledBefore, lastUpdatedFilter, @@ -70,7 +70,11 @@ const valuesToParams = ( minParams.programStatus = programStatus } - minParams.followUpStatus = followUpStatus + console.log('>>>>>', followup, minParams.followup) + + if(followup !== 'ALL') { + minParams.followup = followup + } if (enrollmentEnrolledAfter) { minParams.enrollmentEnrolledAfter = enrollmentEnrolledAfter