Skip to content

Commit

Permalink
fix: review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikmv committed Nov 7, 2024
1 parent 4276fbf commit c80b635
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
10 changes: 8 additions & 2 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-10-25T18:18:11.518Z\n"
"PO-Revision-Date: 2024-10-25T18:18:11.518Z\n"
"POT-Creation-Date: 2024-11-07T11:57:59.094Z\n"
"PO-Revision-Date: 2024-11-07T11:57:59.094Z\n"

msgid "Choose one or more dates..."
msgstr "Choose one or more dates..."
Expand Down Expand Up @@ -1532,6 +1532,12 @@ msgstr "Change"
msgid "Value"
msgstr "Value"

msgid "File"
msgstr "File"

msgid "Image"
msgstr "Image"

msgid "New {{trackedEntityTypeName}} relationship"
msgstr "New {{trackedEntityTypeName}} relationship"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export type Props = {|
trackedEntityTypeName: string,
trackedEntityData: Object,
canWriteData: boolean,
trackedEntityData: Object,
onDeleteSuccess?: () => void,
displayChangelog: boolean,
teiId: string,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow
import log from 'loglevel';
import i18n from '@dhis2/d2-i18n';
import { errorCreator } from 'capture-core-utils';
import { dataElementTypes } from '../../../../metaData';
import type { QuerySingleResource } from '../../../../utils/api';
Expand Down Expand Up @@ -35,12 +36,12 @@ const buildTEAUrlByElementType: {|
const { teiId, value } = trackedEntity;
if (!value) return null;
try {
const { id, displayName: name } = await querySingleResource({ resource: `fileResources/${value}` });

if (!latestValue) {
return 'File';
return i18n.t('File');
}

const { id, displayName: name } = await querySingleResource({ resource: `fileResources/${value}` });

return {
id,
name,
Expand All @@ -64,11 +65,10 @@ const buildTEAUrlByElementType: {|
const { teiId, value } = trackedEntity;
if (!value) return null;
try {
const { id, displayName: name } = await querySingleResource({ resource: `fileResources/${value}` });

if (!latestValue) {
return 'Image';
return i18n.t('Image');
}
const { id, displayName: name } = await querySingleResource({ resource: `fileResources/${value}` });

return {
id,
Expand All @@ -93,12 +93,12 @@ const buildDataElementUrlByElementType: {|
if (!value) return null;

try {
const { id, displayName: name } = await querySingleResource({ resource: `fileResources/${value}` });

if (!latestValue) {
return 'File';
return i18n.t('File');
}

const { id, displayName: name } = await querySingleResource({ resource: `fileResources/${value}` });

return {
id,
name,
Expand All @@ -116,12 +116,12 @@ const buildDataElementUrlByElementType: {|
if (!value) return null;

try {
const { id, displayName: name } = await querySingleResource({ resource: `fileResources/${value}` });

if (!latestValue) {
return 'Image';
return i18n.t('Image');
}

const { id, displayName: name } = await querySingleResource({ resource: `fileResources/${value}` });

return {
id,
name,
Expand Down

0 comments on commit c80b635

Please sign in to comment.