Skip to content

Commit e541a00

Browse files
committed
add action to move to next service point
1 parent 6734fbb commit e541a00

File tree

7 files changed

+539
-11
lines changed

7 files changed

+539
-11
lines changed

packages/esm-patient-queues-app/src/active-visits/active-visits-table.component.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
TableToolbarSearch,
1616
Tag,
1717
Tile,
18+
Toggle,
1819
} from '@carbon/react';
1920

2021
import { isDesktop, useLayoutType, usePagination, userHasAccess, useSession } from '@openmrs/esm-framework';
@@ -38,6 +39,7 @@ import NotesActionsMenu from './notes-action-menu.components';
3839
import { PRIVILEGE_ENABLE_EDIT_DEMOGRAPHICS } from '../constants';
3940
import PatientSearch from '../patient-search/patient-search.component';
4041
import { QueueStatus } from '../utils/utils';
42+
import MovetoNextPointAction from './move-patient-to-next-action-menu.components';
4143

4244
interface ActiveVisitsTableProps {
4345
status: string;
@@ -202,10 +204,11 @@ const ActiveVisitsTable: React.FC<ActiveVisitsTableProps> = ({ status }) => {
202204
</>
203205
)}
204206

205-
{entry.status === 'COMPLETED' && (
206-
<ViewActionsMenu to={`\${openmrsSpaBase}/patient/${entry?.patientUuid}/chart`} from={fromPage} />
207-
)}
207+
<ViewActionsMenu to={`\${openmrsSpaBase}/patient/${entry?.patientUuid}/chart`} from={fromPage} />
208+
208209
<NotesActionsMenu note={entry} />
210+
{entry.status === 'SERVING' ||
211+
(entry.status === 'PENDING' && <MovetoNextPointAction patientUuid={entry?.patientUuid} />)}
209212
</div>
210213
),
211214
},
@@ -229,7 +232,7 @@ const ActiveVisitsTable: React.FC<ActiveVisitsTableProps> = ({ status }) => {
229232
<TableContainer className={styles.tableContainer}>
230233
<TableToolbar style={{ position: 'static', height: '3rem', overflow: 'visible', backgroundColor: 'color' }}>
231234
<TableToolbarContent className={styles.toolbarContent}>
232-
<Layer>
235+
<Layer className={styles.toolbarContentLayer}>
233236
<TableToolbarSearch
234237
expanded
235238
className={styles.search}

packages/esm-patient-queues-app/src/active-visits/active-visits-table.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@
139139
td {
140140
padding: 0.5rem;
141141

142-
> div {
142+
>div {
143143
max-height: max-content !important;
144144
background-color: $ui-02;
145145
}
146146
}
147147

148-
th[colspan] td[colspan] > div:first-child {
148+
th[colspan] td[colspan]>div:first-child {
149149
padding: 0 1rem;
150150
}
151151
}
@@ -273,4 +273,4 @@
273273
color: $interactive-01;
274274
margin-top: 0.5rem;
275275
cursor: pointer;
276-
}
276+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Button } from '@carbon/react';
2+
import { ArrowRight } from '@carbon/react/icons';
3+
import React, { useCallback } from 'react';
4+
import { useTranslation } from 'react-i18next';
5+
import { showModal } from '@openmrs/esm-framework';
6+
7+
interface MovetoNextPointActionProps {
8+
patientUuid: string;
9+
}
10+
11+
const MovetoNextPointAction: React.FC<MovetoNextPointActionProps> = ({ patientUuid }) => {
12+
const { t } = useTranslation();
13+
14+
const openModal = useCallback(() => {
15+
const dispose = showModal('queue-table-move-to-next-service-point-modal', {
16+
patientUuid,
17+
closeModal: () => dispose(),
18+
});
19+
}, [patientUuid]);
20+
21+
return (
22+
<Button
23+
kind="ghost"
24+
onClick={openModal}
25+
iconDescription={t('movePatient', 'Move Patient')}
26+
renderIcon={(props) => <ArrowRight size={16} {...props} />}
27+
/>
28+
);
29+
};
30+
export default MovetoNextPointAction;

packages/esm-patient-queues-app/src/active-visits/notes-dialog.component.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ const NotesDialog: React.FC<NotesDialogProps> = ({ queueEntry, closeModal }) =>
3232
<Button kind="secondary" onClick={closeModal}>
3333
{t('cancel', 'Cancel')}
3434
</Button>
35-
<Button type="submit" onClick={closeModal}>
36-
{t('submit', 'Submit')}
37-
</Button>
3835
</ModalFooter>
3936
</Form>
4037
</div>

0 commit comments

Comments
 (0)