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) UI Issue with Jumbled Search Results when PatientSearchBar Component is used in a workspace #1257

Merged
merged 5 commits into from
Aug 2, 2024

Conversation

amosmachora
Copy link
Contributor

@amosmachora amosmachora commented Jul 28, 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

In this PR I have fixed a small UI issue that showed jumbled search results whever the PatientSearchBar component is used in small windows for lack of a better term i.e workspaces.

The issue was that there is an element that hard coded this style

[data-extension-id=patient-search-bar]>div button {
    height: 3rem;
}

so the above css rule forced the button to a height of 3rem thereby throwing the UI into a complete catastrophe. Fixed it by adding a new rule with height: auto that overrides the original rule. Please check the attached screenshots.

Screenshots

Before

Screenshot 2024-07-27 190914

After

Screenshot 2024-07-27 190938

Related Issue

Other

Copy link
Member

@vasharma05 vasharma05 left a comment

Choose a reason for hiding this comment

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

Hi @amosmachora!
Please follow the PR conventions and mention the ticket in the PR title to move ahead.
Thanks!

Copy link
Member

@vasharma05 vasharma05 left a comment

Choose a reason for hiding this comment

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

Hi @amosmachora!
Please follow the PR conventions and mention the ticket in the PR title to move ahead.
Thanks!

@vasharma05
Copy link
Member

Also, the compact patient search is not meant to be used at any other place than the search bar itself.
Instead you can place a button to search a patient and then select a patient from patient search workspace, which is already implemented in the service queues dashboard.
Thanks!

@amosmachora amosmachora changed the title fix: ui bug that jumbles up ui on small windows (Fix) UI Issue with Jumbled Search Results when PatientSearchBar Component is used in a workspace Jul 29, 2024
@denniskigen
Copy link
Member

denniskigen commented Jul 29, 2024

Isn't this what you ought to fix? Because the styles are not scoped under a class name, they'll apply globally to all instances of the patient-search-bar extension. That's not ideal. The fix should probably happen there and not anywhere else.

See https://o3-docs.openmrs.org/docs/coding-conventions#styling for inspiration.

@amosmachora
Copy link
Contributor Author

You are right I should avoid overriding the original rule. I fear I might break other places where the component is used but let me test to see if we can achieve the same functionality.

@denniskigen
Copy link
Member

Could you post an updated screenshot, @amosmachora?

@amosmachora
Copy link
Contributor Author

amosmachora commented Jul 30, 2024

Here is a screenshot.

Scoping this class to only apply to the searchBarWrapper makes wherever else the component is used the height becomes auto by default.

image

Do not worry of the rendering twice of the extensions. I think that is a local issue because I am running two apps simultaneously.

Copy link
Member

@vasharma05 vasharma05 left a comment

Choose a reason for hiding this comment

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

Thanks @amosmachora !

@vasharma05 vasharma05 merged commit 120257c into openmrs:main Aug 2, 2024
6 checks passed
@denniskigen denniskigen mentioned this pull request Aug 29, 2024
3 tasks
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