-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(fix) O3-3543: Fix test types search in the lab order workspace #1910
Conversation
baf6d6a
to
f36a72f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've taken the liberty to add a few more useful refactors, @arodidev.
@@ -103,7 +103,13 @@ function TestTypeSearchResults({ searchTerm, openOrderForm, focusAndClearSearchI | |||
)} | |||
<div className={styles.resultsContainer}> | |||
{testTypes.map((testType) => ( | |||
<TestTypeSearchResultItem key={testType.conceptUuid} testType={testType} openOrderForm={openOrderForm} /> | |||
<> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<> | |
<React.fragment key={testType.conceptUuid}> |
packages/esm-patient-labs-app/src/lab-orders/add-lab-order/lab-order-form.scss
Show resolved
Hide resolved
packages/esm-patient-labs-app/src/lab-orders/add-lab-order/test-type-search.scss
Show resolved
Hide resolved
16506e2
to
808c91f
Compare
So, I've hijacked @arodidev's PR to fix an issue with the search that involves factoring out the filtering logic from the useTestTypes hook and moving it into the TestTypesSearch component: Beforebroken-filtering.mp4Afterfiltering.mp4 |
@@ -11,7 +11,7 @@ import { | |||
type LabOrderBasketItem, | |||
launchPatientWorkspace, | |||
} from '@openmrs/esm-patient-common-lib'; | |||
import { TestTypeSearch } from './test-type-search'; | |||
import { TestTypeSearch } from './test-type-search.component'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to match our naming conventions.
@@ -66,37 +66,3 @@ describe('useTestTypes is configurable', () => { | |||
expect(result.current.testTypes).toEqual([expect.objectContaining({ label: 'Configured concept' })]); | |||
}); | |||
}); | |||
|
|||
describe('useTestTypes filters by text', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed since we're no longer handling filtering in the hook.
{testTypes.map((testType) => ( | ||
<TestTypeSearchResultItem key={testType.conceptUuid} testType={testType} openOrderForm={openOrderForm} /> | ||
{filteredTestTypes.map((testType, index) => ( | ||
<TestTypeSearchResultItem key={index} openOrderForm={openOrderForm} t={t} testType={testType} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally the key should come from the data from the backend, but we need to fix the issue with duplicates first.
packages/esm-patient-labs-app/src/lab-orders/add-lab-order/lab-order-form.scss
Outdated
Show resolved
Hide resolved
…nmrs#1909) * (test) Fix flaky behaviour in Programs and Conditions form tests * Try something else * Fixup (test) Fix yet more flakiness in ConditionsForm tests (chore) Bump React Form Engine library (openmrs#1913) (chore) Bump RFE lib (chore) Update translations from Transifex (openmrs#1906) Co-authored-by: OpenMRS Bot <[email protected]> (fix) O3-2995: Allow empty quantity to dispense and prescription refills in Drug Order Form (openmrs#1754) Co-authored-by: Dennis Kigen <[email protected]> (fix) O3-3543: Fix test types search in the lab order workspace (openmrs#1910) * added fragment * Other useful mods * Factor out filtering from useTestTypes hook * Review feedback --------- Co-authored-by: Dennis Kigen <[email protected]> (fix) O3-3545: Remove duplicate lab tests in lab order workspace (openmrs#1916) * (fix) O3-3545: Remove duplicate copies of labs * Fixup --------- Co-authored-by: Dennis Kigen <[email protected]> Bump loader-utils from 2.0.2 to 2.0.4 (openmrs#1918) Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.2 to 2.0.4. - [Release notes](https://github.com/webpack/loader-utils/releases) - [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.4/CHANGELOG.md) - [Commits](webpack/loader-utils@v2.0.2...v2.0.4) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (feat) Replace fuzzy search with simple filter for test types
Requirements
Summary
This PR fixes various issues related to the test types search in the Lab Order workspace.
Screenshots
Before
broken-filtering.mp4
After
filtering.mp4
Related Issue
https://openmrs.atlassian.net/browse/O3-3543
Other
We need to address the issue of duplicate concepts in the test types response from the backend. The backend lists 48 concepts, but the frontend shows 60. This might be due to an issue on our end.