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: Back to search results button functionality #1044

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

sam-sny
Copy link

@sam-sny sam-sny commented Mar 16, 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

Updated the 'Back to search results' button text and functionality. Replaced the original text with 'Back to search result' and implemented a function to close the panel when the button is clicked. This enhancement ensures a more intuitive user experience by providing clear navigation back to search results.

Screenshots

Before:
Screenshot (195)

After:

patient-scheduled-visit:
Screenshot (191)

visit-form:
Screenshot (193)

Related Issue

https://openmrs.atlassian.net/browse/O3-2467

Other

@mseaton mseaton self-requested a review March 16, 2024 23:56
Copy link
Member

@mseaton mseaton left a comment

Choose a reason for hiding this comment

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

@sam-sny seem my comments. Also, can you please create a branch for your changes rather than issuing changes directly from main?

renderIcon={(props) => <ArrowLeft size={24} {...props} />}
iconDescription={t('backToSearchResult', 'Back to search result')}
size="sm"
onClick={closePanel}>
Copy link
Member

Choose a reason for hiding this comment

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

This would seem to indicate that clicking on this button will close the entire overlay / search panel entirely, not actually return to the search result. If the goal is to return to the search result, can you show that this is what this does?

onClick={() => toggleSearchType(SearchTypes.SCHEDULED_VISITS, patientUuid)}>
<span>{t('backToScheduledVisits', 'Back to scheduled visits')}</span>
onClick={closePanel}>
<span>{t('backToSearchResult', 'Back to search result')}</span>
Copy link
Member

Choose a reason for hiding this comment

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

Same here. Does the "closePanel" function actually return you to the search result? Or does it close the panel entirely? If it closes the panel, this would seem incorrect.

@sam-sny sam-sny requested a review from mseaton March 21, 2024 15:53
Copy link
Member

@mseaton mseaton left a comment

Choose a reason for hiding this comment

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

Not sure what you are presenting here @sam-sny , but I don't think it's intended for this issue.

@@ -21,14 +21,15 @@
"@hookform/resolvers": "^3.3.1",
"classnames": "^2.3.2",
"react-hook-form": "^7.46.2",
"react-joyride": "^2.8.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you adding a third party library for fixing this issue? @sam-sny

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants