Skip to content

Commit

Permalink
(fix) Fixup contact attribute config key name in patient banner
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen committed Aug 12, 2024
1 parent a04d7f3 commit 983d981
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/** @module @category UI */
import { ExtensionSlot, useConnectedExtensions } from '@openmrs/esm-react-utils';
import React, { useMemo } from 'react';
import { OverflowMenuVertical } from '@carbon/react/icons';
import styles from './patient-banner-actions-menu.module.scss';
import { CustomOverflowMenu } from '../../custom-overflow-menu/custom-overflow-menu.component';
import { ExtensionSlot, useConnectedExtensions } from '@openmrs/esm-react-utils';
import { getCoreTranslation } from '@openmrs/esm-translations';
import { CustomOverflowMenu } from '../../custom-overflow-menu/custom-overflow-menu.component';
import styles from './patient-banner-actions-menu.module.scss';

export interface PatientBannerActionsMenuProps {
patientUuid: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @module @category UI */
import React, { useMemo } from 'react';
import classNames from 'classnames';
import { InlineLoading } from '@carbon/react';
import { type CoreTranslationKey, getCoreTranslation } from '@openmrs/esm-translations';
import { ConfigurableLink, usePatient } from '@openmrs/esm-react-utils';
Expand All @@ -8,7 +9,6 @@ import { useRelationships } from './useRelationships';
import { usePatientContactAttributes } from './usePatientAttributes';
import { usePatientListsForPatient } from './usePatientListsForPatient';
import styles from './patient-banner-contact-details.module.scss';
import classNames from 'classnames';

interface ContactDetailsProps {
patientId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export function PatientBannerToggleContactDetailsButton({
return (
<Button
className={className}
kind="ghost"
renderIcon={showContactDetails ? ChevronUpIcon : ChevronDownIcon}
iconDescription="Toggle contact details"
kind="ghost"
onClick={toggleContactDetails}
renderIcon={showContactDetails ? ChevronUpIcon : ChevronDownIcon}
>
{showContactDetails
? getCoreTranslation('hideDetails', 'Hide details')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import useSWRImmutable from 'swr/immutable';
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-api';
import { useConfig } from '@openmrs/esm-react-utils';
import useSWRImmutable from 'swr/immutable';
import { type Patient } from './types';

const customRepresentation =
Expand Down Expand Up @@ -31,10 +31,10 @@ export const usePatientAttributes = (patientUuid: string) => {
* @returns Object containing `contactAttribute` {@link Attribute} loading status
*/
export const usePatientContactAttributes = (patientUuid: string) => {
const { contactAttributeType } = useConfig();
const { contactAttributeTypes } = useConfig();
const { attributes, isLoading } = usePatientAttributes(patientUuid);
const contactAttributes = attributes.filter(
({ attributeType }) => contactAttributeType?.some((uuid) => attributeType.uuid === uuid),
({ attributeType }) => contactAttributeTypes?.some((uuid) => attributeType.uuid === uuid),
);
return {
contactAttributes: contactAttributes ?? [],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion packages/framework/esm-translations/src/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export const coreTranslations = {
hideDetails: 'Hide details',
loading: 'Loading',
male: 'Male',
other: 'Other', patientIdentifierSticker: 'Patient identifier sticker',
other: 'Other',
patientIdentifierSticker: 'Patient identifier sticker',
patientLists: 'Patient lists',
print: 'Print',
printError: 'Print error',
Expand Down

0 comments on commit 983d981

Please sign in to comment.