generated from openmrs/openmrs-esm-template-app
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'openmrs:main' into fix-dispensing-module
- Loading branch information
Showing
44 changed files
with
2,896 additions
and
623 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import { Layer } from '@carbon/react'; | ||
import PrescriptionPrintAction from '../print-prescription/prescription-print-action.component'; | ||
import styles from './prescription-actions.scss'; | ||
|
||
type PrescriptionsActionsFooterProps = { | ||
encounterUuid: string; | ||
patientUuid: string; | ||
}; | ||
|
||
const PrescriptionsActionsFooter: React.FC<PrescriptionsActionsFooterProps> = ({ encounterUuid, patientUuid }) => { | ||
return ( | ||
<Layer className={styles.actionsContainer}> | ||
<div className={styles.actionCluster}> | ||
{/* Left buttons */} | ||
<PrescriptionPrintAction encounterUuid={encounterUuid} patientUuid={patientUuid} /> | ||
</div> | ||
|
||
<div className={styles.actionCluster}>{/* Right buttons */}</div> | ||
</Layer> | ||
); | ||
}; | ||
|
||
export default PrescriptionsActionsFooter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@use '@carbon/colors'; | ||
@use '@carbon/layout'; | ||
@use '@carbon/type'; | ||
|
||
.actionsContainer { | ||
flex-direction: row; | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.actionCluster { | ||
gap: layout.$spacing-03; | ||
display: flex; | ||
flex-direction: row; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/print-prescription/prescription-print-action.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React, { useCallback } from 'react'; | ||
import { Button } from '@carbon/react'; | ||
import { Printer } from '@carbon/react/icons'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { showModal } from '@openmrs/esm-framework'; | ||
|
||
type PrescriptionPrintActionProps = { | ||
encounterUuid: string; | ||
patientUuid: string; | ||
}; | ||
|
||
const PrescriptionPrintAction: React.FC<PrescriptionPrintActionProps> = ({ encounterUuid, patientUuid }) => { | ||
const { t } = useTranslation(); | ||
|
||
const handleClick = useCallback(() => { | ||
const dispose = showModal('prescription-print-preview-modal', { | ||
onClose: () => dispose(), | ||
encounterUuid, | ||
patientUuid, | ||
}); | ||
}, [encounterUuid, patientUuid]); | ||
|
||
return ( | ||
<Button renderIcon={Printer} iconDescription={t('print', 'Print')} onClick={handleClick} kind="ghost"> | ||
{t('printPrescriptions', 'Print prescriptions')} | ||
</Button> | ||
); | ||
}; | ||
|
||
export default PrescriptionPrintAction; |
Oops, something went wrong.