Skip to content
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

Merged
merged 4 commits into from
Jul 15, 2024

Conversation

arodidev
Copy link
Contributor

@arodidev arodidev commented Jul 12, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

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.

@denniskigen denniskigen force-pushed the lab-order-search-bar branch from baf6d6a to f36a72f Compare July 12, 2024 20:26
Copy link
Member

@denniskigen denniskigen left a 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} />
<>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<>
<React.fragment key={testType.conceptUuid}>

@denniskigen denniskigen force-pushed the lab-order-search-bar branch from 16506e2 to 808c91f Compare July 15, 2024 19:04
@denniskigen
Copy link
Member

denniskigen commented Jul 15, 2024

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:

Before

broken-filtering.mp4

After

filtering.mp4

@denniskigen denniskigen requested a review from brandones July 15, 2024 19:13
@denniskigen denniskigen changed the title (fix) O3-3543: Refactor TestTypeSearchResultItem component usage in TestTypeSearchResults (fix) O3-3543: Fix test types search in Lab Order form Jul 15, 2024
@denniskigen denniskigen changed the title (fix) O3-3543: Fix test types search in Lab Order form (fix) O3-3543: Fix test types search in the lab order workspace Jul 15, 2024
@@ -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';
Copy link
Member

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', () => {
Copy link
Member

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} />
Copy link
Member

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.

@denniskigen denniskigen requested a review from ibacher July 15, 2024 19:26
@denniskigen denniskigen merged commit 575ea22 into openmrs:main Jul 15, 2024
6 checks passed
arodidev pushed a commit to arodidev/openmrs-esm-patient-chart that referenced this pull request Jul 16, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants