Skip to content

Commit

Permalink
Fix reusable banner component exports
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen committed Nov 20, 2024
1 parent a0b090d commit ff7399c
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 6 deletions.
42 changes: 42 additions & 0 deletions packages/framework/esm-framework/docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@
- [CustomOverflowMenu](API.md#customoverflowmenu)
- [PatientBannerActionsMenu](API.md#patientbanneractionsmenu)
- [PatientBannerContactDetails](API.md#patientbannercontactdetails)
- [PatientBannerPatientIdentifiers](API.md#patientbannerpatientidentifiers)
- [PatientBannerPatientInfo](API.md#patientbannerpatientinfo)
- [PatientBannerToggleContactDetailsButton](API.md#patientbannertogglecontactdetailsbutton)
- [PatientPhoto](API.md#patientphoto)
- [getFhirServerPaginationHandlers](API.md#getfhirserverpaginationhandlers)
Expand Down Expand Up @@ -6885,6 +6887,46 @@ ___

___

### PatientBannerPatientIdentifiers

▸ **PatientBannerPatientIdentifiers**(`__namedParameters`): `Element`

#### Parameters

| Name | Type |
| :------ | :------ |
| `__namedParameters` | `PatientBannerPatientIdentifiersProps` |

#### Returns

`Element`

#### Defined in

[packages/framework/esm-styleguide/src/patient-banner/patient-info/patient-banner-patient-identifiers.component.tsx:39](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/patient-banner/patient-info/patient-banner-patient-identifiers.component.tsx#L39)

___

### PatientBannerPatientInfo

▸ **PatientBannerPatientInfo**(`__namedParameters`): `Element`

#### Parameters

| Name | Type |
| :------ | :------ |
| `__namedParameters` | `PatientBannerPatientInfoProps` |

#### Returns

`Element`

#### Defined in

[packages/framework/esm-styleguide/src/patient-banner/patient-info/patient-banner-patient-info.component.tsx:43](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/patient-banner/patient-info/patient-banner-patient-info.component.tsx#L43)

___

### PatientBannerToggleContactDetailsButton

▸ **PatientBannerToggleContactDetailsButton**(`__namedParameters`): `Element`
Expand Down
2 changes: 1 addition & 1 deletion packages/framework/esm-framework/mock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const CustomOverflowMenu = jest.fn(({ menuTitle, children }) => (
export const PatientBannerActionsMenu = jest.fn(() => <div>Patient Banner Actions Menu</div>);
export const PatientBannerContactDetails = jest.fn(() => <div>Patient Banner Contact Details</div>);
export const PatientBannerPatientInfo = jest.fn(() => <div>Patient Banner Patient Info</div>);
export const PatientBannerPatientIdentifier = jest.fn(() => <div>Patient Banner Patient Identifier</div>);
export const PatientBannerPatientIdentifiers = jest.fn(() => <div>Patient Banner Patient Identifier</div>);
export const PatientBannerToggleContactDetailsButton = jest.fn(() => (
<div>Patient Banner Toggle Contact Details Button</div>
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ function SecondaryIdentifier({ showIdentifierLabel, type, value }: IdentifiersPr
);
}

function PatientBannerPatientIdentifiers({ identifiers, showIdentifierLabel }: PatientBannerPatientIdentifiersProps) {
export function PatientBannerPatientIdentifiers({
identifiers,
showIdentifierLabel,
}: PatientBannerPatientIdentifiersProps) {
const { excludePatientIdentifierCodeTypes } = useConfig<StyleguideConfigObject>();
const { primaryIdentifierCode } = usePrimaryIdentifierCode();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const getGender = (gender: string): string => {
return getCoreTranslation(key, gender);
};

function PatientBannerPatientInfo({ patient }: PatientBannerPatientInfoProps) {
export function PatientBannerPatientInfo({ patient }: PatientBannerPatientInfoProps) {
const name = `${patient?.name?.[0]?.given?.join(' ')} ${patient?.name?.[0]?.family}`;
const gender = patient?.gender && getGender(patient.gender);

Expand Down Expand Up @@ -76,5 +76,3 @@ function PatientBannerPatientInfo({ patient }: PatientBannerPatientInfoProps) {
</div>
);
}

export default PatientBannerPatientInfo;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { type i18n } from 'i18next';
import { screen, render } from '@testing-library/react';
import { usePrimaryIdentifierCode } from '@openmrs/esm-react-utils';
import PatientBannerPatientInfo from './patient-banner-patient-info.component';
import { PatientBannerPatientInfo } from './patient-banner-patient-info.component';

window.i18next = { language: 'en' } as i18n;
const mockUsePrimaryIdentifierCode = jest.mocked(usePrimaryIdentifierCode);
Expand Down

0 comments on commit ff7399c

Please sign in to comment.