From e53014c04e7714c971f81420c8ff4dc8d48a9fb6 Mon Sep 17 00:00:00 2001 From: Makombe Kennedy Date: Fri, 10 Nov 2023 14:28:36 +0300 Subject: [PATCH] (fix) Fix error when clearing the test type field of the lab order form (#1460) Co-authored-by: Dennis Kigen --- .../translations/am.json | 1 - .../translations/ar.json | 1 - .../translations/en.json | 1 - .../translations/es.json | 1 - .../translations/fr.json | 1 - .../translations/he.json | 1 - .../translations/km.json | 1 - packages/esm-patient-labs-app/package.json | 2 +- .../add-lab-order/add-lab-order.workspace.tsx | 4 ++-- ...-form.tsx => lab-order-form.component.tsx} | 4 ++-- .../esm-patient-labs-app/translations/am.json | 11 +++++++++++ .../esm-patient-labs-app/translations/ar.json | 13 ++++++++++++- .../esm-patient-labs-app/translations/en.json | 11 +++++++++++ .../esm-patient-labs-app/translations/es.json | 11 +++++++++++ .../esm-patient-labs-app/translations/fr.json | 11 +++++++++++ .../esm-patient-labs-app/translations/he.json | 19 +++++++++++++++---- .../esm-patient-labs-app/translations/km.json | 11 +++++++++++ 17 files changed, 87 insertions(+), 17 deletions(-) rename packages/esm-patient-labs-app/src/lab-orders/add-lab-order/{lab-order-form.tsx => lab-order-form.component.tsx} (97%) diff --git a/packages/esm-patient-forms-app/translations/am.json b/packages/esm-patient-forms-app/translations/am.json index eaec1db946..b7d4b88c4e 100644 --- a/packages/esm-patient-forms-app/translations/am.json +++ b/packages/esm-patient-forms-app/translations/am.json @@ -1,5 +1,4 @@ { - "checkFilters": "Check the filters above", "clinicalForm": "Clinical form", "editForm": "Edit form", "form": "Form", diff --git a/packages/esm-patient-forms-app/translations/ar.json b/packages/esm-patient-forms-app/translations/ar.json index 23ad912677..360296c209 100644 --- a/packages/esm-patient-forms-app/translations/ar.json +++ b/packages/esm-patient-forms-app/translations/ar.json @@ -1,5 +1,4 @@ { - "checkFilters": "تحقق من الفلاتر أعلاه", "clinicalForm": "النموذج السريري", "editForm": "تعديل النموذج", "form": "نموذج", diff --git a/packages/esm-patient-forms-app/translations/en.json b/packages/esm-patient-forms-app/translations/en.json index 47c750a9c1..61ca08db7b 100644 --- a/packages/esm-patient-forms-app/translations/en.json +++ b/packages/esm-patient-forms-app/translations/en.json @@ -1,5 +1,4 @@ { - "checkFilters": "Check the filters above", "clinicalForm": "Clinical form", "editForm": "Edit form", "form": "Form", diff --git a/packages/esm-patient-forms-app/translations/es.json b/packages/esm-patient-forms-app/translations/es.json index 9cae79644b..cf120fad2d 100644 --- a/packages/esm-patient-forms-app/translations/es.json +++ b/packages/esm-patient-forms-app/translations/es.json @@ -1,5 +1,4 @@ { - "checkFilters": "Verifique los filtros arriba", "clinicalForm": "Formulario clínico", "editForm": "Editar formulario", "form": "Formulario", diff --git a/packages/esm-patient-forms-app/translations/fr.json b/packages/esm-patient-forms-app/translations/fr.json index 51c7d40fab..497c65c4b3 100644 --- a/packages/esm-patient-forms-app/translations/fr.json +++ b/packages/esm-patient-forms-app/translations/fr.json @@ -1,5 +1,4 @@ { - "checkFilters": "Check the filters above", "clinicalForm": "Formulaire clinique", "editForm": "Edit form", "form": "Formulaire", diff --git a/packages/esm-patient-forms-app/translations/he.json b/packages/esm-patient-forms-app/translations/he.json index f546a72c01..c1e11d4678 100644 --- a/packages/esm-patient-forms-app/translations/he.json +++ b/packages/esm-patient-forms-app/translations/he.json @@ -1,5 +1,4 @@ { - "checkFilters": "Check the filters above", "clinicalForm": "טופס קליני", "editForm": "Edit form", "form": "טופס", diff --git a/packages/esm-patient-forms-app/translations/km.json b/packages/esm-patient-forms-app/translations/km.json index 4af73e8d65..5239d01521 100644 --- a/packages/esm-patient-forms-app/translations/km.json +++ b/packages/esm-patient-forms-app/translations/km.json @@ -1,5 +1,4 @@ { - "checkFilters": "ពិនិត្យតម្រងខាងលើ", "clinicalForm": "ទម្រង់គ្លីនិក", "editForm": "កែទម្រង់", "form": "ទម្រង់", diff --git a/packages/esm-patient-labs-app/package.json b/packages/esm-patient-labs-app/package.json index 706737c482..87d6606899 100644 --- a/packages/esm-patient-labs-app/package.json +++ b/packages/esm-patient-labs-app/package.json @@ -17,7 +17,7 @@ "test:watch": "cross-env TZ=UTC jest --watch --config jest.config.js --color", "coverage": "yarn test --coverage", "typescript": "tsc", - "extract-translations": "i18next 'src/**/*.component.tsx' 'src/index.ts' --config ../../tools/i18next-parser.config.js" + "extract-translations": "i18next 'src/**/*.component.tsx' 'src/**/*.workspace.tsx' 'src/index.ts' --config ../../tools/i18next-parser.config.js" }, "browserslist": [ "extends browserslist-config-openmrs" diff --git a/packages/esm-patient-labs-app/src/lab-orders/add-lab-order/add-lab-order.workspace.tsx b/packages/esm-patient-labs-app/src/lab-orders/add-lab-order/add-lab-order.workspace.tsx index 0207136717..ce5981667f 100644 --- a/packages/esm-patient-labs-app/src/lab-orders/add-lab-order/add-lab-order.workspace.tsx +++ b/packages/esm-patient-labs-app/src/lab-orders/add-lab-order/add-lab-order.workspace.tsx @@ -4,11 +4,11 @@ import capitalize from 'lodash-es/capitalize'; import { useTranslation } from 'react-i18next'; import { Button } from '@carbon/react'; import { ArrowLeft } from '@carbon/react/icons'; -import { age, formatDate, parseDate, useLayoutType, usePatient, useSession } from '@openmrs/esm-framework'; +import { age, formatDate, parseDate, useLayoutType, usePatient } from '@openmrs/esm-framework'; import { DefaultWorkspaceProps, launchPatientWorkspace, OrderBasketItem } from '@openmrs/esm-patient-common-lib'; import { LabOrderBasketItem } from '../api'; import { TestTypeSearch } from './test-type-search'; -import { LabOrderForm } from './lab-order-form'; +import { LabOrderForm } from './lab-order-form.component'; import styles from './add-lab-order.scss'; export interface AddLabOrderWorkspaceAdditionalProps { diff --git a/packages/esm-patient-labs-app/src/lab-orders/add-lab-order/lab-order-form.tsx b/packages/esm-patient-labs-app/src/lab-orders/add-lab-order/lab-order-form.component.tsx similarity index 97% rename from packages/esm-patient-labs-app/src/lab-orders/add-lab-order/lab-order-form.tsx rename to packages/esm-patient-labs-app/src/lab-orders/add-lab-order/lab-order-form.component.tsx index 96ede8da78..cb2c15d399 100644 --- a/packages/esm-patient-labs-app/src/lab-orders/add-lab-order/lab-order-form.tsx +++ b/packages/esm-patient-labs-app/src/lab-orders/add-lab-order/lab-order-form.component.tsx @@ -40,14 +40,14 @@ export function LabOrderForm({ initialOrder, closeWorkspace }: LabOrderFormProps closeWorkspace(); launchPatientWorkspace('order-basket'); }, - [orders, setOrders, closeWorkspace, session.currentProvider.uuid, inProgressLabOrder], + [orders, setOrders, closeWorkspace, session?.currentProvider?.uuid, inProgressLabOrder], ); const cancelOrder = useCallback(() => { setOrders(orders.filter((order) => order.testType.conceptUuid !== inProgressLabOrder.testType.conceptUuid)); closeWorkspace(); launchPatientWorkspace('order-basket'); - }, [closeWorkspace, inProgressLabOrder.testType.conceptUuid, orders, setOrders]); + }, [closeWorkspace, inProgressLabOrder?.testType?.conceptUuid, orders, setOrders]); return ( <> diff --git a/packages/esm-patient-labs-app/translations/am.json b/packages/esm-patient-labs-app/translations/am.json index 1b5aba246c..01ce425681 100644 --- a/packages/esm-patient-labs-app/translations/am.json +++ b/packages/esm-patient-labs-app/translations/am.json @@ -1,12 +1,19 @@ { + "additionalInstructions": "Additional instructions", + "backToOrderBasket": "Back to order basket", "backToTimeline": "Back to timeline", "date": "Date", "dateCollected": "Displaying date collected", + "discard": "Discard", "error": "Error", + "errorLoadingTestTypes": "Error occured when loading test types", + "labReferenceNumber": "Lab reference number", + "loading": "Loading", "moreResultsAvailable": "More results available", "observationsDisplayText": "observations", "orderActionNew": "New", "ordered": "Ordered", + "priority": "Priority", "recentResults": "Recent Results", "recentTestResults": "recent test results", "referenceRange": "Reference range", @@ -15,12 +22,15 @@ "resulted": "Resulted", "resultsText": "results", "returnToTimeline": "Return to timeline", + "saveOrder": "Save order", "seeAllResults": "See all results", "showTree": "Show tree", "Test Results": "Test Results", "testName": "Test name", "testResults": "test results", "testResults_title": "Test Results", + "testType": "Test type", + "testTypePlaceholder": "Select one", "timeline": "Timeline", "timeOfTest": "Time of Test", "tree": "Tree", @@ -32,6 +42,7 @@ "trendlineRangeSelector5Years": "5 years", "trendlineRangeSelectorAll": "All", "trendlineRangeSelectorMonths": "6 months", + "tryReopeningTheForm": "Please try launching the form again", "value": "Value", "view": "View" } diff --git a/packages/esm-patient-labs-app/translations/ar.json b/packages/esm-patient-labs-app/translations/ar.json index 12d9feea90..c60ea57d61 100644 --- a/packages/esm-patient-labs-app/translations/ar.json +++ b/packages/esm-patient-labs-app/translations/ar.json @@ -1,12 +1,19 @@ { + "additionalInstructions": "تعليمات إضافية", + "backToOrderBasket": "العودة إلى سلة الطلب", "backToTimeline": "العودة إلى الجدول الزمني", "date": "تاريخ", "dateCollected": "عرض تاريخ الجمع", + "discard": "تجاهل", "error": "خطأ", + "errorLoadingTestTypes": "حدث خطأ أثناء تحميل أنواع الاختبارات", + "labReferenceNumber": "رقم المرجع المخبري", + "loading": "جار التحميل", "moreResultsAvailable": "المزيد من النتائج متاحة", "observationsDisplayText": "ملاحظات", "orderActionNew": "جديد", "ordered": "مُطلوب", + "priority": "الأولوية", "recentResults": "النتائج الأخيرة", "recentTestResults": "نتائج الاختبار الأخيرة", "referenceRange": "نطاق المرجع", @@ -15,12 +22,15 @@ "resulted": "أُظهرت", "resultsText": "نتائج", "returnToTimeline": "العودة إلى الجدول الزمني", + "saveOrder": "حفظ الطلب", "seeAllResults": "عرض جميع النتائج", "showTree": "عرض الشجرة", "Test Results": "نتائج الاختبار", "testName": "اسم الاختبار", "testResults": "نتائج الاختبار", "testResults_title": "نتائج الاختبار", + "testType": "نوع الاختبار", + "testTypePlaceholder": "اختر واحدة", "timeline": "الجدول الزمني", "timeOfTest": "وقت الاختبار", "tree": "شجرة", @@ -32,6 +42,7 @@ "trendlineRangeSelector5Years": "5 سنوات", "trendlineRangeSelectorAll": "الكل", "trendlineRangeSelectorMonths": "6 أشهر", - "value": "قيمة", + "tryReopeningTheForm": "يرجى محاولة فتح النموذج مرة أخرى", + "value": "القيمة", "view": "عرض" } diff --git a/packages/esm-patient-labs-app/translations/en.json b/packages/esm-patient-labs-app/translations/en.json index 1b5aba246c..01ce425681 100644 --- a/packages/esm-patient-labs-app/translations/en.json +++ b/packages/esm-patient-labs-app/translations/en.json @@ -1,12 +1,19 @@ { + "additionalInstructions": "Additional instructions", + "backToOrderBasket": "Back to order basket", "backToTimeline": "Back to timeline", "date": "Date", "dateCollected": "Displaying date collected", + "discard": "Discard", "error": "Error", + "errorLoadingTestTypes": "Error occured when loading test types", + "labReferenceNumber": "Lab reference number", + "loading": "Loading", "moreResultsAvailable": "More results available", "observationsDisplayText": "observations", "orderActionNew": "New", "ordered": "Ordered", + "priority": "Priority", "recentResults": "Recent Results", "recentTestResults": "recent test results", "referenceRange": "Reference range", @@ -15,12 +22,15 @@ "resulted": "Resulted", "resultsText": "results", "returnToTimeline": "Return to timeline", + "saveOrder": "Save order", "seeAllResults": "See all results", "showTree": "Show tree", "Test Results": "Test Results", "testName": "Test name", "testResults": "test results", "testResults_title": "Test Results", + "testType": "Test type", + "testTypePlaceholder": "Select one", "timeline": "Timeline", "timeOfTest": "Time of Test", "tree": "Tree", @@ -32,6 +42,7 @@ "trendlineRangeSelector5Years": "5 years", "trendlineRangeSelectorAll": "All", "trendlineRangeSelectorMonths": "6 months", + "tryReopeningTheForm": "Please try launching the form again", "value": "Value", "view": "View" } diff --git a/packages/esm-patient-labs-app/translations/es.json b/packages/esm-patient-labs-app/translations/es.json index 8b0d4937ee..c59aab7a83 100644 --- a/packages/esm-patient-labs-app/translations/es.json +++ b/packages/esm-patient-labs-app/translations/es.json @@ -1,12 +1,19 @@ { + "additionalInstructions": "Instrucciones adicionales", + "backToOrderBasket": "Back to order basket", "backToTimeline": "Volver al calendario", "date": "Fecha", "dateCollected": "Mostrando fecha de recogida", + "discard": "Descartar", "error": "Error", + "errorLoadingTestTypes": "Error al cargar los tipos de pruebas", + "labReferenceNumber": "Número de referencia del laboratorio", + "loading": "Cargando", "moreResultsAvailable": "Más resultados disponibles", "observationsDisplayText": "observaciones", "orderActionNew": "Nuevo", "ordered": "Pedido", + "priority": "Priority", "recentResults": "Resultados Recientes", "recentTestResults": "Resultados de Pruebas Recientes", "referenceRange": "Rango de Referencia", @@ -15,12 +22,15 @@ "resulted": "Resultados", "resultsText": "resultados", "returnToTimeline": "Volver al calendario", + "saveOrder": "Guardar orden", "seeAllResults": "Ver Todos los Resultados", "showTree": "Mostrar Árbol", "Test Results": "Resultados de Pruebas", "testName": "Nombre de la Prueba", "testResults": "Resultados de la Prueba", "testResults_title": "Resultados de Pruebas", + "testType": "Tipo de prueba", + "testTypePlaceholder": "Selecciona uno", "timeline": "Calendario", "timeOfTest": "Hora de la Prueba", "tree": "Árbol", @@ -32,6 +42,7 @@ "trendlineRangeSelector5Years": "5 años", "trendlineRangeSelectorAll": "Todo", "trendlineRangeSelectorMonths": "6 meses", + "tryReopeningTheForm": "Por favor, intenta lanzar el formulario de nuevo", "value": "Valor", "view": "Ver" } diff --git a/packages/esm-patient-labs-app/translations/fr.json b/packages/esm-patient-labs-app/translations/fr.json index b885dff412..bbec8e6ba7 100644 --- a/packages/esm-patient-labs-app/translations/fr.json +++ b/packages/esm-patient-labs-app/translations/fr.json @@ -1,12 +1,19 @@ { + "additionalInstructions": "Instructions supplémentaires", + "backToOrderBasket": "Retour au panier de commande", "backToTimeline": "Retour à la chronologie", "date": "Date", "dateCollected": "Affichage de la date collectée", + "discard": "Jeter", "error": "Error", + "errorLoadingTestTypes": "Une erreur s'est produite lors du chargement des types de tests", + "labReferenceNumber": "Numéro de référence du laboratoire", + "loading": "Chargement", "moreResultsAvailable": "Plus de résultats disponibles", "observationsDisplayText": "observations", "orderActionNew": "New", "ordered": "Commandé", + "priority": "Priorité", "recentResults": "Résultats récents", "recentTestResults": "Résultats de test récents", "referenceRange": "Plage de référence", @@ -15,12 +22,15 @@ "resulted": "Qui en résulte", "resultsText": "résultats", "returnToTimeline": "Retour à la chronologie", + "saveOrder": "Enregistrer la commande", "seeAllResults": "Voir tous les résultats", "showTree": "Voir l'arborescence", "Test Results": "Test Results", "testName": "Nom de test", "testResults": "Résultats de tests", "testResults_title": "Test Results", + "testType": "Type de test", + "testTypePlaceholder": "Sélectionnez-en un", "timeline": "Chronologie", "timeOfTest": "Heure du test", "tree": "Arborescence", @@ -32,6 +42,7 @@ "trendlineRangeSelector5Years": "5 années", "trendlineRangeSelectorAll": "Tout", "trendlineRangeSelectorMonths": "6 mois", + "tryReopeningTheForm": "Veuillez essayer de relancer le formulaire", "value": "Valeur", "view": "Vue" } diff --git a/packages/esm-patient-labs-app/translations/he.json b/packages/esm-patient-labs-app/translations/he.json index a8ebd4a89e..872e229f08 100644 --- a/packages/esm-patient-labs-app/translations/he.json +++ b/packages/esm-patient-labs-app/translations/he.json @@ -1,26 +1,36 @@ { + "additionalInstructions": "הוראות נוספות", + "backToOrderBasket": "חזור לסל ההזמנות", "backToTimeline": "חזור לציר הזמן", "date": "תאריך", "dateCollected": "מציג תאריך איסוף", - "error": "Error", + "discard": "לבטל", + "error": "שגיאה", + "errorLoadingTestTypes": "אירעה שגיאה בעת טעינת סוגי הבדיקות", + "labReferenceNumber": "מספר התייחסות של המעבדה", + "loading": "טוען", "moreResultsAvailable": "קיימים עוד תוצאות זמינות", "observationsDisplayText": "תצוגת מדדים", - "orderActionNew": "New", + "orderActionNew": "חדש", "ordered": "הוזמן", + "priority": "עדיפות", "recentResults": "תוצאות חדשות", "recentTestResults": "תוצאות בדיקות חדשות", "referenceRange": "טווח התייחסות", - "removeFromBasket": "Remove from basket", + "removeFromBasket": "הסר מהסל", "resetTreeText": "איפוס עץ", "resulted": "נמצא", "resultsText": "תוצאות", "returnToTimeline": "חזור לציר הזמן", + "saveOrder": "שמור הזמנה", "seeAllResults": "ראה את כל התוצאות", "showTree": "הצג עץ", "Test Results": "תוצאות בדיקות", "testName": "שם הבדיקה", "testResults": "תוצאות הבדיקה", - "testResults_title": "Test Results", + "testResults_title": "תוצאות הבדיקה", + "testType": "סוג הבדיקה", + "testTypePlaceholder": "בחר אחד", "timeline": "ציר זמן", "timeOfTest": "שעת הבדיקה", "tree": "עץ", @@ -32,6 +42,7 @@ "trendlineRangeSelector5Years": "5 שנים", "trendlineRangeSelectorAll": "הכל", "trendlineRangeSelectorMonths": "6 חודשים", + "tryReopeningTheForm": "אנא נסה להפעיל מחדש את הטופס", "value": "ערך", "view": "תצוגה" } diff --git a/packages/esm-patient-labs-app/translations/km.json b/packages/esm-patient-labs-app/translations/km.json index c64e6bd4bf..6675f03508 100644 --- a/packages/esm-patient-labs-app/translations/km.json +++ b/packages/esm-patient-labs-app/translations/km.json @@ -1,12 +1,19 @@ { + "additionalInstructions": "សេចក្តីណែនាំបន្ថែម", + "backToOrderBasket": "ត្រឡប់ទៅកន្ត្រកបញ្ជាទិញ", "backToTimeline": "ត្រលប់ទៅបន្ទាត់ពេលវេលា", "date": "កាលបរិច្ឆេទ", "dateCollected": "បង្ហាញកាលបរិច្ឆេទដែលប្រមូលទិន្នន័យបាន", + "discard": "បោះបង់", "error": "មានបញ្ហាបច្ចេកទេស", + "errorLoadingTestTypes": "មានបញ្ហាក្នុងការផ្ទុកប្រភេទតេស្ត", + "labReferenceNumber": "លេខយោងប្រតិបត្តិការប្រតិបត្តិការ", + "loading": "កំពុងផ្ទុក", "moreResultsAvailable": "អាចរកបានលទ្ធផលច្រើនទៀត", "observationsDisplayText": "ការសង្កេត", "orderActionNew": "ថ្មី", "ordered": "បានតម្រៀបតាមលំដាប់លំដោយ", + "priority": "អាទិភាព", "recentResults": "លទ្ធផលថ្មីៗ", "recentTestResults": "លទ្ធផលតេស្តថ្មីៗ", "referenceRange": "ចន្លោះតម្លៃយោង", @@ -15,12 +22,15 @@ "resulted": "លទ្ធផល", "resultsText": "លទ្ធផល", "returnToTimeline": "ត្រឡប់ទៅបន្ទាត់ពេលវេលា", + "saveOrder": "រក្សាទុកលំដាប់", "seeAllResults": "មើលលទ្ធផលទាំងអស់", "showTree": "Sបង្ហាញមែកធាងទិន្នន័យ(Tree)", "Test Results": "លទ្ធផលតេស្ត", "testName": "ធ្វើតេស្តលើឈ្មោះ", "testResults": "លទ្ធផលតេស្ត", "testResults_title": "លទ្ធផលតេស្ត", + "testType": "ប្រភេទតេស្ត", + "testTypePlaceholder": "ជ្រើសរើសមួយ", "timeline": "បន្ទាត់ពេលវេលា", "timeOfTest": "ពេលវេលានៃការធ្វើតេស្ត", "tree": "មែកធាងទិន្នន័យ(Tree)", @@ -32,6 +42,7 @@ "trendlineRangeSelector5Years": "5 ឆ្នាំ", "trendlineRangeSelectorAll": "ទាំងអស់", "trendlineRangeSelectorMonths": "6 ខែ", + "tryReopeningTheForm": "សូមព្យាយាមបើកទម្រង់ឡើងវិញ", "value": "តម្លៃ", "view": "មើល" }