From 49240bf686d1a3e7ed483c415e86ed55ab1cdb20 Mon Sep 17 00:00:00 2001 From: Hope Tambala Date: Sun, 10 Sep 2023 16:04:12 -0400 Subject: [PATCH] fix: Translation name of of forms for "Suggested next forms" view --- .../FormGallery/FormsHorizontalView/index.js | 33 +++++++++------- domains/DataCollection/Forms/index.js | 39 ++++++++++++------- 2 files changed, 42 insertions(+), 30 deletions(-) diff --git a/domains/DataCollection/FormGallery/FormsHorizontalView/index.js b/domains/DataCollection/FormGallery/FormsHorizontalView/index.js index 5e12ab34..ccf7d623 100644 --- a/domains/DataCollection/FormGallery/FormsHorizontalView/index.js +++ b/domains/DataCollection/FormGallery/FormsHorizontalView/index.js @@ -20,22 +20,25 @@ const FormsHorizontalView = ({ )} - {forms.map((form) => ( - uuid.v4()} - style={layout.cardSmallStyle} - onPress={() => { - navigateToCustomForm(form); - }} - onLongPress={() => pinForm(form)} - > - - - {form.name} + {forms.map((form) => { + const cardId = uuid.v4(); + return ( + { + navigateToCustomForm(form); + }} + onLongPress={() => pinForm(form)} + > + + + {form.name} + - - - ))} + + ); + })} {forms?.length < 1 && ( uuid.v4()}> diff --git a/domains/DataCollection/Forms/index.js b/domains/DataCollection/Forms/index.js index 4889ca0b..1d87eb61 100644 --- a/domains/DataCollection/Forms/index.js +++ b/domains/DataCollection/Forms/index.js @@ -110,22 +110,31 @@ const Forms = (props) => { {pinnedForms && - pinnedForms.map((form) => ( - { - if (!form.tag) return navigateToCustomForm(form); - return navigateToNewRecord(form.tag); - }} - > - - - {form.name} + pinnedForms.map((form) => { + const { + objectId, + tag, + name, + customForm: isCustomForm, + } = form; + const formName = isCustomForm ? name : I18n.t(name); + return ( + { + if (!form.tag) return navigateToCustomForm(form); + return navigateToNewRecord(tag); + }} + > + + + {formName} + - - - ))} + + ); + })} {pinnedForms.length < 1 && (