Skip to content

Commit

Permalink
(fix) O3-3847 Ward app - hide close button for search patient warning…
Browse files Browse the repository at this point in the history
… notifications and wording change
  • Loading branch information
chibongho committed Jan 9, 2025
1 parent 6d586ac commit 4bba984
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 124 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import React from 'react';
import { of } from 'rxjs';
import { getDefaultsFromConfigSchema, useConfig, useSession } from '@openmrs/esm-framework';
import { screen } from '@testing-library/react';
import { useConfig, useSession, getDefaultsFromConfigSchema } from '@openmrs/esm-framework';
import {
mockServices,
mockSession,
mockLocationSurgery,
mockLocationTriage,
mockQueueEntries,
mockQueueRooms,
mockLocationTriage,
mockLocationSurgery,
mockServices,
mockSession,
} from '__mocks__';
import React from 'react';
import { renderWithSwr } from 'tools';
import { useQueueEntries } from '../hooks/useQueueEntries';
import { useQueueRooms } from '../add-provider-queue-room/add-provider-queue-room.resource';
import { useQueueLocations } from '../create-queue-entry/hooks/useQueueLocations';
import { type ConfigObject, configSchema } from '../config-schema';
import { useQueueLocations } from '../create-queue-entry/hooks/useQueueLocations';
import { useQueueEntries } from '../hooks/useQueueEntries';
import DefaultQueueTable from '../queue-table/default-queue-table.component';

const mockUseConfig = jest.mocked(useConfig<ConfigObject>);
Expand Down Expand Up @@ -44,11 +43,6 @@ jest.mock('../hooks/useQueueEntries', () => ({
useQueueEntries: jest.fn(),
}));

jest.mock('../helpers/helpers', () => ({
...jest.requireActual('../helpers/helpers'),
getSelectedServiceName: jest.fn().mockReturnValue(of({ serviceName: 'All' })),
}));

describe('DefaultQueueTable', () => {
beforeEach(() => {
mockUseConfig.mockReturnValue({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ const AdmitPatientButton: React.FC<AdmitPatientButtonProps> = ({
const disabledButton = isLoadingEmrConfiguration || errorFetchingEmrConfiguration || disabled;
return (
<Button kind="ghost" renderIcon={ArrowRightIcon} size={responsiveSize} disabled={disabledButton} onClick={onAdmit}>
{(dispositionType == 'ADMIT' || disabledButton) && t('admitPatient', 'Admit patient')}
{dispositionType == 'TRANSFER' && t('transferPatient', 'Transfer patient')}
{dispositionType == 'ADMIT' || disabledButton
? t('admitPatient', 'Admit patient')
: t('transferPatient', 'Transfer patient')}
</Button>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,15 @@ const CreateAdmissionEncounterWorkspace: React.FC<CreateAdmissionEncounterWorksp
<InlineNotification
kind="warning"
lowContrast={true}
hideCloseButton={true}
title={t('patientAlreadyAdmittedToCurrentLocation', 'Patient already admitted to current location')}
/>
)}
{isAdmittedToOtherLocation && (
<InlineNotification
kind="warning"
lowContrast={true}
hideCloseButton={true}
title={t(
'patientCurrentlyAdmittedToOtherLocation',
'Patient currently admitted to location {{location}}',
Expand All @@ -116,6 +118,7 @@ const CreateAdmissionEncounterWorkspace: React.FC<CreateAdmissionEncounterWorksp
<InlineNotification
kind="warning"
lowContrast={true}
hideCloseButton={true}
title={t(
'patientHasPendingAdmissionRequest',
'Patient already has a pending admission request to location {{location}}',
Expand Down
Loading

0 comments on commit 4bba984

Please sign in to comment.