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 patient search results positioning #12

Merged
merged 1 commit into from
Jun 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
@import "carbon-components/scss/globals/scss/typography.scss";
@import "~@openmrs/esm-styleguide/src/vars";

.patientChart {
text-decoration: none;
cursor: pointer;
}
:global(.omrs-breakpoint-gt-tablet) .patientChart {
background-color: $ui-02;
margin: 0rem 1rem;
}

.container {
border-bottom: 0.063rem solid $ui-03;
}

:global(.omrs-breakpoint-gt-tablet) .container {
padding: 0rem 1rem;
}


.patientBanner {
display: flex;
}
Original file line number Diff line number Diff line change
@@ -84,38 +84,39 @@ const PatientSearch: React.FC<PatientSearchProps> = ({ hidePanel }) => {
<Search
className={styles.patientSearchInput}
onChange={($event) => handleChange($event.target.value)}
placeholder={t('searchForPatient', 'Search for a patient')}
placeholder={t('searchForPatient', 'Search for a patient by name or identifier number')}
labelText=""
ref={searchInput}
autoFocus={true}
size="xl"
/>

{!isEmpty(searchResults) && (
<div className={styles.searchResults}>
<p className={styles.resultsText}>{t('patientsFound', { count: searchResults.length })}</p>
<PatientSearchResults hidePanel={hidePanel} searchTerm={searchTerm} patients={results} />
<div className={styles.pagination}>
<PaginationNav itemsShown={resultsPerPage} totalItems={totalPages} onChange={handlePageChange} />
<div className={styles.searchResultsContainer}>
{!isEmpty(searchResults) && (
<div className={styles.searchResults}>
<p className={styles.resultsText}>{t('patientsFound', { count: searchResults.length })}</p>
<PatientSearchResults hidePanel={hidePanel} searchTerm={searchTerm} patients={results} />
<div className={styles.pagination}>
<PaginationNav itemsShown={resultsPerPage} totalItems={totalPages} onChange={handlePageChange} />
</div>
</div>
</div>
)}
{emptyResult && (
<div className={styles.searchResults}>
<p className={styles.resultsText}>{t('noResultsFound', 'No results found')}</p>
<Tile className={styles.emptySearchResultsTile}>
<EmptyDataIllustration />
<p className={styles.emptyResultText}>
{t('noPatientChartsFoundMessage', 'Sorry, no patient charts have been found')}
</p>
<p className={styles.actionText}>
<span>{t('trySearchWithPatientUniqueID', "Try searching with the patient's unique ID number")}</span>
<br />
<span>{t('orPatientName', "OR the patient's name(s)")}</span>
</p>
</Tile>
</div>
)}
)}
{emptyResult && (
<div className={styles.searchResults}>
<p className={styles.resultsText}>{t('noResultsFound', 'No results found')}</p>
<Tile className={styles.emptySearchResultsTile}>
<EmptyDataIllustration />
<p className={styles.emptyResultText}>
{t('noPatientChartsFoundMessage', 'Sorry, no patient charts have been found')}
</p>
<p className={styles.actionText}>
<span>{t('trySearchWithPatientUniqueID', "Try searching with the patient's unique ID number")}</span>
<br />
<span>{t('orPatientName', "OR the patient's name(s)")}</span>
</p>
</Tile>
</div>
)}
</div>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
@import "../root.scss";
@import "~@openmrs/esm-styleguide/src/vars";

.searchResultsContainer {
display: flex;
justify-content: center;
position: fixed;
width: 100vw;
top: 3rem;
bottom: 0;
left: 0;
right: 0;
background-color:$ui-02;
padding: 0rem 1rem;
}

:global(.omrs-breakpoint-gt-tablet) .searchResultsContainer {
padding: 0;
background-color:var(--omrs-color-bg-low-contrast);
}

.searchResults {
margin-top: 3rem;
width: 100%;
padding: 1rem;
background: $ui-background;
min-height: 100vh;
position: relative;
height: 100%;
width: 100vw;
}

:global(.omrs-breakpoint-gt-tablet) .searchResults {
width: 50vw;
}

.searchTerm {
@@ -21,6 +39,11 @@
color: $text-02;
border-bottom: 0.063rem solid $ui-03;
padding: 0.5rem 0rem;

}

:global(.omrs-breakpoint-gt-tablet) .resultsText {
margin: 1rem;
}

.patientSearchInput {
@@ -77,9 +100,6 @@
width: 100vw;
}

:global(.omrs-breakpoint-gt-tablet) .patientSearchInput input {
height: 2.75rem;
}
.patientSearch {
width: 100%;
display: flex;
@@ -90,3 +110,8 @@
margin-top: 1rem;
padding: 3rem 0rem;
}

:global(.omrs-breakpoint-gt-tablet) .emptySearchResultsTile {
margin: 1rem;
background-color: $ui-02;
}
2 changes: 1 addition & 1 deletion packages/esm-patient-search-app/translations/en.json
Original file line number Diff line number Diff line change
@@ -4,6 +4,6 @@
"orPatientName": "OR the patient's name(s)",
"patientsFound": "Found {count, plural, one{{count} patient} other{{count} patients}}",
"patientsFound_plural": "",
"searchForPatient": "Search for a patient",
"searchForPatient": "Search for a patient by name or identifier number",
"trySearchWithPatientUniqueID": "Try searching with the patient's unique ID number"
}