-
Notifications
You must be signed in to change notification settings - Fork 189
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
Changes from all commits
4720e42
fcf847e
a253fca
752ae43
edad9bd
06ce47e
5f6fcb3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ import { | |
useConfig, | ||
type ConfigObject, | ||
} from '@openmrs/esm-framework'; | ||
import { ArrowLeft } from '@carbon/react/icons'; | ||
import { type Appointment, SearchTypes } from '../types'; | ||
import styles from './patient-scheduled-visits.scss'; | ||
import { useScheduledVisits } from './hooks/useScheduledVisits'; | ||
|
@@ -293,6 +294,16 @@ const PatientScheduledVisits: React.FC<PatientScheduledVisitsProps> = ({ | |
|
||
return ( | ||
<div className={styles.container}> | ||
<div className={styles.backButton}> | ||
<Button | ||
kind="ghost" | ||
renderIcon={(props) => <ArrowLeft size={24} {...props} />} | ||
iconDescription={t('backToSearchResult', 'Back to search result')} | ||
size="sm" | ||
onClick={closePanel}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
<span>{t('backToSearchResult', 'Back to search result')}</span> | ||
</Button> | ||
</div> | ||
<ScheduledVisits | ||
visitType={visitType.RECENT} | ||
visits={appointments?.recentVisits} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ import { addQueueEntry, useVisitQueueEntries } from '../../active-visits/active- | |
import { convertTime12to24, type amPm } from '../../helpers/time-helpers'; | ||
import { MemoizedRecommendedVisitType } from './recommended-visit-type.component'; | ||
import { useActivePatientEnrollment } from '../hooks/useActivePatientEnrollment'; | ||
import { SearchTypes, type PatientProgram, type NewVisitPayload } from '../../types'; | ||
import { type SearchTypes, type PatientProgram, type NewVisitPayload } from '../../types'; | ||
import styles from './visit-form.scss'; | ||
import { useDefaultLoginLocation } from '../hooks/useDefaultLocation'; | ||
import isEmpty from 'lodash-es/isEmpty'; | ||
|
@@ -203,10 +203,10 @@ const StartVisitForm: React.FC<VisitFormProps> = ({ patientUuid, toggleSearchTyp | |
<Button | ||
kind="ghost" | ||
renderIcon={(props) => <ArrowLeft size={24} {...props} />} | ||
iconDescription={t('backToScheduledVisits', 'Back to scheduled visits')} | ||
iconDescription={t('backToSearchResult', 'Back to search result')} | ||
size="sm" | ||
onClick={() => toggleSearchType(SearchTypes.SCHEDULED_VISITS, patientUuid)}> | ||
<span>{t('backToScheduledVisits', 'Back to scheduled visits')}</span> | ||
onClick={closePanel}> | ||
<span>{t('backToSearchResult', 'Back to search result')}</span> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
</Button> | ||
)} | ||
</div> | ||
|
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.
Why are you adding a third party library for fixing this issue? @sam-sny