From 60e79f84e9bf12056ac6e1a9a985510c4ab427ff Mon Sep 17 00:00:00 2001 From: Mozafar Haider Date: Wed, 6 Mar 2024 09:41:12 +0000 Subject: [PATCH] refactor: apply code review comments --- src/hooks/useTasks.js | 1 - src/pages/EventExport/EventExport.js | 2 +- src/pages/EventImport/EventImport.js | 4 ++-- src/pages/TEIExport/TEIExport.js | 2 +- src/pages/TEIExport/form-helper.js | 2 -- src/pages/TEIImport/TEIImport.js | 8 ++++---- src/pages/TEIImport/form-helper.js | 2 +- src/utils/helper.js | 1 - 8 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/hooks/useTasks.js b/src/hooks/useTasks.js index efd55ae75..7b52c2794 100644 --- a/src/hooks/useTasks.js +++ b/src/hooks/useTasks.js @@ -48,7 +48,6 @@ const defaultRefetchPeriod = 2000 const createFetchEvents = (engine, setTasks, fetchSummary) => (type, id, task) => { const fetchEvents = async () => { - console.debug('[fetch event]', type, id, task) if (task.completed) { return } diff --git a/src/pages/EventExport/EventExport.js b/src/pages/EventExport/EventExport.js index a00aa71ad..eb1d8e860 100644 --- a/src/pages/EventExport/EventExport.js +++ b/src/pages/EventExport/EventExport.js @@ -41,7 +41,7 @@ const { Form } = ReactFinalForm // PAGE INFO export const PAGE_NAME = i18n.t('Event export') export const PAGE_DESCRIPTION = i18n.t( - 'Export event data for programs, stages and tracked entities to JSON, CSV, or DXF2 format.' + 'Export event data for programs, stages and tracked entities to JSON or CSV format.' ) const PAGE_ICON = diff --git a/src/pages/EventImport/EventImport.js b/src/pages/EventImport/EventImport.js index d078443aa..ef0c66139 100644 --- a/src/pages/EventImport/EventImport.js +++ b/src/pages/EventImport/EventImport.js @@ -34,7 +34,7 @@ import { onImport } from './form-helper.js' // PAGE INFO export const PAGE_NAME = i18n.t('Event import') export const PAGE_DESCRIPTION = i18n.t( - 'Import event data for programs, stages and tracked entities to JSON, CSV, or DXF2 format.' + 'Import event data for programs, stages and tracked entities from JSON or CSV format.' ) const PAGE_ICON = @@ -95,7 +95,7 @@ const EventImport = () => { ', } diff --git a/src/pages/TEIExport/TEIExport.js b/src/pages/TEIExport/TEIExport.js index 2c6f717e4..2acefc9df 100644 --- a/src/pages/TEIExport/TEIExport.js +++ b/src/pages/TEIExport/TEIExport.js @@ -54,7 +54,7 @@ const { Form } = ReactFinalForm // PAGE INFO export const PAGE_NAME = i18n.t('Tracked entities export') export const PAGE_DESCRIPTION = i18n.t( - 'Export tracked entities in JSON, CSV, or DXF2 format.' + 'Export tracked entities in JSON or CSV format.' ) const PAGE_ICON = diff --git a/src/pages/TEIExport/form-helper.js b/src/pages/TEIExport/form-helper.js index 49dda1e0b..8c9ba7e21 100644 --- a/src/pages/TEIExport/form-helper.js +++ b/src/pages/TEIExport/form-helper.js @@ -70,8 +70,6 @@ const valuesToParams = ( minParams.programStatus = programStatus } - console.log('>>>>>', followup, minParams.followup) - if (followup !== 'ALL') { minParams.followup = followup } diff --git a/src/pages/TEIImport/TEIImport.js b/src/pages/TEIImport/TEIImport.js index ca3b614ad..aeb5c11d5 100644 --- a/src/pages/TEIImport/TEIImport.js +++ b/src/pages/TEIImport/TEIImport.js @@ -14,7 +14,6 @@ import { import { FileUpload, Format, - formatNoCsvOptions, defaultFormatOption, Identifier, defaultIdentifierOption, @@ -46,6 +45,7 @@ import { defaultIdSchemeOption, OrgUnitIdScheme, defaultOrgUnitIdSchemeOption, + formatNoXmlNoCsvOptions, } from '../../components/Inputs/index.js' import { TaskContext, getNewestTask } from '../../contexts/index.js' import { getPrevJobDetails, getInitialBoolValue } from '../../utils/helper.js' @@ -56,7 +56,7 @@ const { Form } = ReactFinalForm // PAGE INFO export const PAGE_NAME = i18n.t('Tracked entities import') export const PAGE_DESCRIPTION = i18n.t( - 'Import tracked entities using JSON or DXF2 format.' + 'Import tracked entities using JSON format.' ) const PAGE_ICON = @@ -134,14 +134,14 @@ const TEIImport = () => { ', } )} /> diff --git a/src/pages/TEIImport/form-helper.js b/src/pages/TEIImport/form-helper.js index fd6d8e59d..ed3b60cba 100644 --- a/src/pages/TEIImport/form-helper.js +++ b/src/pages/TEIImport/form-helper.js @@ -49,7 +49,7 @@ const onImport = .filter((s) => s != '') .join('&') const url = `${apiBaseUrl}?${params}` - console.debug('[TEI import url]', url) + try { await uploadFile({ url, diff --git a/src/utils/helper.js b/src/utils/helper.js index a37774538..853274c24 100644 --- a/src/utils/helper.js +++ b/src/utils/helper.js @@ -104,7 +104,6 @@ const uploadFile = ({ onResponse: (response) => { const { error, id, msg, typeReports } = response let entry - console.debug('response from uploading file', response) if (!isAsync) { // we are done entry = {