From 141d4d1b287f57d1cd11bf09a37cfa1239b047ef Mon Sep 17 00:00:00 2001 From: reagan-meant Date: Thu, 3 Oct 2024 23:33:34 +0300 Subject: [PATCH] Minor fixes --- packages/esm-patient-search-app/src/mpi/utils.ts | 11 +++++++---- .../patient-search-button.test.tsx | 6 +++--- .../patient-search-overlay.component.tsx | 2 +- .../patient-search-views.component.tsx | 5 ++--- packages/esm-patient-search-app/translations/en.json | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/esm-patient-search-app/src/mpi/utils.ts b/packages/esm-patient-search-app/src/mpi/utils.ts index d65285342..446caae67 100644 --- a/packages/esm-patient-search-app/src/mpi/utils.ts +++ b/packages/esm-patient-search-app/src/mpi/utils.ts @@ -1,5 +1,6 @@ import { capitalize } from 'lodash-es'; import { type SearchedPatient } from '../types'; +import { getCoreTranslation } from '@openmrs/esm-framework'; export function inferModeFromSearchParams(searchParams: URLSearchParams) { return searchParams.get('mode')?.toLowerCase() === 'external' ? 'external' : 'internal'; } @@ -28,11 +29,13 @@ export function mapToOpenMRSPatient(fhirPatients: Array): Array); @@ -39,11 +39,11 @@ describe('PatientSearchButton', () => { const user = userEvent.setup(); render( - + } /> - , + , ); const searchButton = screen.getByLabelText('Search Patient Button'); diff --git a/packages/esm-patient-search-app/src/patient-search-overlay/patient-search-overlay.component.tsx b/packages/esm-patient-search-app/src/patient-search-overlay/patient-search-overlay.component.tsx index 254971940..637133463 100644 --- a/packages/esm-patient-search-app/src/patient-search-overlay/patient-search-overlay.component.tsx +++ b/packages/esm-patient-search-app/src/patient-search-overlay/patient-search-overlay.component.tsx @@ -1,12 +1,12 @@ import React, { useCallback, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useConfig, useDebounce } from '@openmrs/esm-framework'; +import { useSearchParams } from 'react-router-dom'; import AdvancedPatientSearchComponent from '../patient-search-page/advanced-patient-search.component'; import Overlay from '../ui-components/overlay'; import PatientSearchBar from '../patient-search-bar/patient-search-bar.component'; import { type PatientSearchConfig } from '../config-schema'; import { inferModeFromSearchParams } from '../mpi/utils'; -import { useSearchParams } from 'react-router-dom'; interface PatientSearchOverlayProps { onClose: () => void; diff --git a/packages/esm-patient-search-app/src/patient-search-page/patient-search-views.component.tsx b/packages/esm-patient-search-app/src/patient-search-page/patient-search-views.component.tsx index 8033ba9eb..32be4a324 100644 --- a/packages/esm-patient-search-app/src/patient-search-page/patient-search-views.component.tsx +++ b/packages/esm-patient-search-app/src/patient-search-page/patient-search-views.component.tsx @@ -100,7 +100,7 @@ export const SearchResultsEmptyState: React.FC = ({ inTabletOrOverl

{t( 'trySearchFromClientRegistry', - "You can try searching using the patient's unique ID number or search the external MPI", + "Try searching using the patient's unique ID number or search the external registry", )}

@@ -108,10 +108,9 @@ export const SearchResultsEmptyState: React.FC = ({ inTabletOrOverl kind="ghost" renderIcon={'Search'} onClick={(e) => { - e.preventDefault(); doMPISearch(searchTerm); }}> - {`${t('search', 'Search')} ${'MPIs'}`} + {`${t('search', 'Search')} ${'External Registry'}`} )} diff --git a/packages/esm-patient-search-app/translations/en.json b/packages/esm-patient-search-app/translations/en.json index 05f703834..c47bdf19c 100644 --- a/packages/esm-patient-search-app/translations/en.json +++ b/packages/esm-patient-search-app/translations/en.json @@ -34,7 +34,7 @@ "searchResultsCount_one": "{{count}} search result", "searchResultsCount_other": "{{count}} search results", "sex": "Sex", - "trySearchFromClientRegistry": "You can try searching using the patient's unique ID number or search the external MPI", + "trySearchFromClientRegistry": "Try searching using the patient's unique ID number or search the external registry", "trySearchWithPatientUniqueID": "Try to search again using the patient's unique ID number", "unknown": "Unknown", "yearOfBirth": "Year of Birth"