Skip to content

Commit

Permalink
refactor: apply code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kabaros committed Mar 6, 2024
1 parent 70363f7 commit 60e79f8
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/hooks/useTasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EventExport/EventExport.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <EventIcon />

Expand Down
4 changes: 2 additions & 2 deletions src/pages/EventImport/EventImport.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <EventIcon />

Expand Down Expand Up @@ -95,7 +95,7 @@ const EventImport = () => {
<BasicOptions>
<FileUpload
helpText={i18n.t(
'Supported file types: JSON, CSV, and DXF2.',
'Supported file types: JSON and CSV.',
{
nsSeparator: '>',
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/TEIExport/TEIExport.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <TEIIcon />

Expand Down
2 changes: 0 additions & 2 deletions src/pages/TEIExport/form-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ const valuesToParams = (
minParams.programStatus = programStatus
}

console.log('>>>>>', followup, minParams.followup)

if (followup !== 'ALL') {
minParams.followup = followup
}
Expand Down
8 changes: 4 additions & 4 deletions src/pages/TEIImport/TEIImport.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
import {
FileUpload,
Format,
formatNoCsvOptions,
defaultFormatOption,
Identifier,
defaultIdentifierOption,
Expand Down Expand Up @@ -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'
Expand All @@ -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 = <TEIIcon />

Expand Down Expand Up @@ -134,14 +134,14 @@ const TEIImport = () => {
<BasicOptions>
<FileUpload
helpText={i18n.t(
'Supported file types: JSON and DXF2.',
'Supported file types: JSON.',
{
nsSeparator: '>',
}
)}
/>
<Format
availableFormats={formatNoCsvOptions}
availableFormats={formatNoXmlNoCsvOptions}
type="import"
/>
<Identifier />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/TEIImport/form-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const onImport =
.filter((s) => s != '')
.join('&')
const url = `${apiBaseUrl}?${params}`
console.debug('[TEI import url]', url)

try {
await uploadFile({
url,
Expand Down
1 change: 0 additions & 1 deletion src/utils/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 60e79f8

Please sign in to comment.