@kenyaemr/esm-service-queues-app 7.0.3-pre.89 → 8.0.1-pre.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +18 -17
- package/dist/130.js +1 -1
- package/dist/130.js.map +1 -1
- package/dist/199.js +1 -1
- package/dist/236.js +1 -0
- package/dist/236.js.map +1 -0
- package/dist/265.js +1 -0
- package/dist/265.js.map +1 -0
- package/dist/271.js +1 -1
- package/dist/282.js +1 -0
- package/dist/282.js.map +1 -0
- package/dist/319.js +1 -1
- package/dist/366.js +1 -0
- package/dist/366.js.map +1 -0
- package/dist/392.js +1 -0
- package/dist/392.js.map +1 -0
- package/dist/460.js +1 -1
- package/dist/484.js +2 -0
- package/dist/484.js.map +1 -0
- package/dist/574.js +1 -1
- package/dist/6.js +1 -1
- package/dist/604.js +1 -0
- package/dist/604.js.map +1 -0
- package/dist/644.js +1 -1
- package/dist/670.js +1 -0
- package/dist/670.js.map +1 -0
- package/dist/727.js +1 -0
- package/dist/727.js.map +1 -0
- package/dist/752.js +1 -1
- package/dist/757.js +1 -1
- package/dist/760.js +1 -0
- package/dist/760.js.map +1 -0
- package/dist/788.js +1 -1
- package/dist/800.js +1 -1
- package/dist/807.js +1 -1
- package/dist/818.js +1 -0
- package/dist/818.js.map +1 -0
- package/dist/828.js +1 -1
- package/dist/833.js +1 -1
- package/dist/911.js +1 -0
- package/dist/911.js.map +1 -0
- package/dist/kenyaemr-esm-service-queues-app.js +1 -1
- package/dist/kenyaemr-esm-service-queues-app.js.buildmanifest.json +160 -160
- package/dist/kenyaemr-esm-service-queues-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +2 -2
- package/src/active-visits/active-visits-table.resource.ts +1 -1
- package/src/active-visits/change-status-dialog.scss +11 -11
- package/src/active-visits/change-status-dialog.test.tsx +36 -31
- package/src/add-patient-toqueue/add-patient-toqueue-dialog.scss +10 -10
- package/src/add-provider-queue-room/add-provider-queue-room.component.tsx +4 -4
- package/src/add-provider-queue-room/add-provider-queue-room.resource.ts +2 -2
- package/src/add-provider-queue-room/add-provider-queue-room.scss +6 -6
- package/src/add-provider-queue-room/add-provider-queue-room.test.tsx +44 -38
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.component.tsx +1 -1
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.scss +2 -3
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.test.tsx +15 -15
- package/src/config-schema.ts +84 -84
- package/src/current-visit/current-visit-summary.component.tsx +1 -1
- package/src/current-visit/current-visit-summary.test.tsx +12 -11
- package/src/current-visit/current-visit.resource.ts +1 -1
- package/src/current-visit/current-visit.scss +4 -4
- package/src/current-visit/hooks/useVitalsConceptMetadata.tsx +1 -1
- package/src/current-visit/visit-details/triage-note.scss +11 -11
- package/src/helpers/helpers.test.ts +24 -0
- package/src/helpers/helpers.ts +41 -14
- package/src/home.test.tsx +10 -12
- package/src/hooks/useQueueService.ts +16 -10
- package/src/past-visit/past-visit-details/past-visit-summary.scss +8 -8
- package/src/past-visit/past-visit.component.tsx +1 -1
- package/src/past-visit/past-visit.resource.ts +1 -1
- package/src/past-visit/past-visit.scss +17 -17
- package/src/past-visit/past-visit.test.tsx +8 -13
- package/src/patient-info/appointment-details.scss +7 -7
- package/src/patient-info/appointment-details.test.tsx +11 -6
- package/src/patient-info/appointments.resource.ts +1 -1
- package/src/patient-info/patient-info.scss +9 -9
- package/src/patient-info/patient-info.test.tsx +3 -14
- package/src/patient-queue-header/patient-queue-header.component.tsx +4 -1
- package/src/patient-queue-header/patient-queue-header.scss +11 -11
- package/src/patient-queue-metrics/clinic-metrics.component.tsx +1 -1
- package/src/patient-queue-metrics/clinic-metrics.resource.ts +2 -2
- package/src/patient-queue-metrics/clinic-metrics.scss +4 -4
- package/src/patient-queue-metrics/clinic-metrics.test.tsx +40 -45
- package/src/patient-queue-metrics/metrics-card.scss +11 -11
- package/src/patient-queue-metrics/metrics-header.scss +2 -2
- package/src/patient-search/advanced-search.scss +27 -27
- package/src/patient-search/advanced-search.test.tsx +6 -9
- package/src/patient-search/basic-search.scss +14 -14
- package/src/patient-search/basic-search.test.tsx +2 -7
- package/src/patient-search/hooks/useDefaultLocation.ts +1 -1
- package/src/patient-search/hooks/useQueueLocations.tsx +1 -0
- package/src/patient-search/hooks/useScheduledVisits.ts +1 -1
- package/src/patient-search/patient-scheduled-visits.component.tsx +4 -4
- package/src/patient-search/patient-scheduled-visits.scss +17 -17
- package/src/patient-search/patient-scheduled-visits.test.tsx +18 -23
- package/src/patient-search/patient-search.scss +7 -7
- package/src/patient-search/patient-search.workspace.tsx +4 -4
- package/src/patient-search/search-results.scss +11 -11
- package/src/patient-search/search-results.test.tsx +2 -10
- package/src/patient-search/visit-form/visit-form.scss +12 -13
- package/src/patient-search/visit-form/visit-type-selector.component.tsx +9 -11
- package/src/patient-search/visit-form/visit-type-selector.scss +13 -13
- package/src/patient-search/visit-form/visit-type-selector.test.tsx +4 -3
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.scss +1 -3
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.test.tsx +15 -9
- package/src/queue-entry-table-components/edit-entry.scss +1 -1
- package/src/queue-entry-table-components/queue-priority.scss +3 -4
- package/src/queue-entry-table-components/transition-entry.scss +1 -1
- package/src/queue-patient-linelists/queue-linelist-base-table.scss +16 -17
- package/src/queue-patient-linelists/queue-linelist-base-table.test.tsx +7 -8
- package/src/queue-patient-linelists/queue-linelist-filter.scss +13 -13
- package/src/queue-patient-linelists/queue-linelist-filter.test.tsx +9 -6
- package/src/queue-patient-linelists/queue-linelist.resource.ts +4 -4
- package/src/queue-patient-linelists/scheduled-appointments-table.test.tsx +10 -7
- package/src/queue-rooms/queue-room-form.scss +13 -13
- package/src/queue-rooms/queue-room-form.test.tsx +10 -8
- package/src/queue-screen/queue-screen.scss +6 -4
- package/src/queue-screen/queue-screen.test.tsx +6 -6
- package/src/queue-services/queue-service-form.scss +13 -13
- package/src/queue-services/queue-service-form.test.tsx +15 -8
- package/src/queue-table/cells/queue-table-action-cell.component.tsx +2 -2
- package/src/queue-table/cells/queue-table-coming-from-cell.component.tsx +1 -1
- package/src/queue-table/default-queue-table.component.tsx +63 -61
- package/src/queue-table/default-queue-table.test.tsx +61 -61
- package/src/queue-table/queue-entry-actions/queue-entry-actions-modal.scss +36 -0
- package/src/queue-table/queue-entry-actions/queue-entry-actions.modal.tsx +30 -10
- package/src/queue-table/queue-entry-actions/queue-entry-actions.test.tsx +34 -103
- package/src/queue-table/queue-entry-actions/queue-entry-confirm-action.test.tsx +42 -25
- package/src/queue-table/queue-entry-actions/queue-entry-undo-actions.test.tsx +19 -14
- package/src/queue-table/queue-table-by-status-skeleton.component.tsx +1 -5
- package/src/queue-table/queue-table-expanded-row.component.tsx +1 -2
- package/src/queue-table/queue-table-metrics-card.scss +7 -7
- package/src/queue-table/queue-table-metrics.scss +3 -3
- package/src/queue-table/queue-table.component.tsx +8 -11
- package/src/queue-table/queue-table.scss +32 -26
- package/src/queue-table/queue-table.test.tsx +46 -21
- package/src/remove-queue-entry-dialog/remove-queue-entry.resource.ts +1 -1
- package/src/remove-queue-entry-dialog/remove-queue-entry.scss +2 -2
- package/src/remove-queue-entry-dialog/remove-queue-entry.test.tsx +13 -12
- package/src/side-menu/side-menu.test.tsx +0 -1
- package/src/transition-queue-entry/transition-queue-entry-dialog.component.tsx +1 -1
- package/src/transition-queue-entry/transition-queue-entry-dialog.scss +5 -5
- package/src/transition-queue-entry/transition-queue-entry-dialog.test.tsx +33 -44
- package/src/views/queue-tables-for-all-statuses.component.tsx +14 -14
- package/src/visits-missing-inqueue/visits-missing-inqueue.component.tsx +1 -1
- package/src/visits-missing-inqueue/visits-missing-inqueue.resource.ts +1 -1
- package/src/visits-missing-inqueue/visits-missing-inqueue.scss +17 -14
- package/translations/am.json +4 -2
- package/translations/ar.json +4 -2
- package/translations/en.json +1 -0
- package/translations/es.json +4 -2
- package/translations/fr.json +39 -37
- package/translations/he.json +4 -2
- package/translations/km.json +4 -2
- package/translations/zh.json +4 -2
- package/translations/zh_CN.json +4 -2
- package/dist/276.js +0 -1
- package/dist/276.js.map +0 -1
- package/dist/384.js +0 -2
- package/dist/384.js.map +0 -1
- package/dist/401.js +0 -1
- package/dist/401.js.map +0 -1
- package/dist/430.js +0 -1
- package/dist/430.js.map +0 -1
- package/dist/60.js +0 -1
- package/dist/60.js.map +0 -1
- package/dist/600.js +0 -1
- package/dist/600.js.map +0 -1
- package/dist/647.js +0 -1
- package/dist/647.js.map +0 -1
- package/dist/650.js +0 -1
- package/dist/650.js.map +0 -1
- package/dist/669.js +0 -1
- package/dist/669.js.map +0 -1
- package/dist/764.js +0 -1
- package/dist/764.js.map +0 -1
- package/dist/877.js +0 -1
- package/dist/877.js.map +0 -1
- package/dist/917.js +0 -1
- package/dist/917.js.map +0 -1
- package/src/queue-table/queue-entry-actions/queue-entry-actons-modal.scss +0 -36
- package/src/root.scss +0 -15
- /package/dist/{384.js.LICENSE.txt → 484.js.LICENSE.txt} +0 -0
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import { type ConfigObject, configSchema } from '../config-schema';
|
|
5
|
+
import { getDefaultsFromConfigSchema, useConfig } from '@openmrs/esm-framework';
|
|
4
6
|
import { mockAppointmentsData } from '__mocks__';
|
|
5
7
|
import AppointmentsTable from './scheduled-appointments-table.component';
|
|
6
8
|
|
|
7
|
-
jest.
|
|
8
|
-
...jest.requireActual('@openmrs/esm-framework'),
|
|
9
|
-
useConfig: () => ({
|
|
10
|
-
appointmentStatuses: ['All', 'Scheduled', 'Completed'],
|
|
11
|
-
}),
|
|
12
|
-
}));
|
|
9
|
+
const mockUseConfig = jest.mocked(useConfig<ConfigObject>);
|
|
13
10
|
|
|
14
11
|
jest.mock('./queue-linelist.resource', () => ({
|
|
15
12
|
useAppointments: () => ({
|
|
@@ -19,6 +16,13 @@ jest.mock('./queue-linelist.resource', () => ({
|
|
|
19
16
|
}));
|
|
20
17
|
|
|
21
18
|
describe('AppointmentsTable', () => {
|
|
19
|
+
beforeEach(() => {
|
|
20
|
+
mockUseConfig.mockReturnValue({
|
|
21
|
+
...getDefaultsFromConfigSchema(configSchema),
|
|
22
|
+
appointmentStatuses: ['All', 'Scheduled', 'Completed'],
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
22
26
|
it('renders appointments when loading is complete', () => {
|
|
23
27
|
render(<AppointmentsTable />);
|
|
24
28
|
|
|
@@ -28,7 +32,6 @@ describe('AppointmentsTable', () => {
|
|
|
28
32
|
|
|
29
33
|
it('filters appointments based on status selection', async () => {
|
|
30
34
|
const user = userEvent.setup();
|
|
31
|
-
|
|
32
35
|
render(<AppointmentsTable />);
|
|
33
36
|
|
|
34
37
|
const statusDropdown = screen.getAllByLabelText('Status:');
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
4
|
|
|
5
5
|
$overlay-header-height: 5.5rem;
|
|
6
6
|
|
|
7
7
|
.heading {
|
|
8
8
|
@include type.type-style('heading-compact-01');
|
|
9
|
-
margin:
|
|
9
|
+
margin: layout.$spacing-05 0 layout.$spacing-05;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.warningContainer {
|
|
13
13
|
background-color: $carbon--red-50;
|
|
14
|
-
padding:
|
|
15
|
-
margin:
|
|
14
|
+
padding: layout.$spacing-04;
|
|
15
|
+
margin: layout.$spacing-03 0 layout.$spacing-03;
|
|
16
16
|
display: flex;
|
|
17
17
|
justify-content: space-between;
|
|
18
18
|
.warning {
|
|
@@ -29,16 +29,16 @@ $overlay-header-height: 5.5rem;
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.grid {
|
|
32
|
-
margin: 0
|
|
33
|
-
padding:
|
|
32
|
+
margin: 0 layout.$spacing-05;
|
|
33
|
+
padding: 0;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.input {
|
|
37
|
-
margin-top:
|
|
37
|
+
margin-top: layout.$spacing-04;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.button {
|
|
41
|
-
height:
|
|
41
|
+
height: layout.$spacing-10;
|
|
42
42
|
display: flex;
|
|
43
43
|
align-content: flex-start;
|
|
44
44
|
align-items: baseline;
|
|
@@ -46,11 +46,11 @@ $overlay-header-height: 5.5rem;
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
.tablet {
|
|
49
|
-
padding:
|
|
49
|
+
padding: layout.$spacing-06 layout.$spacing-05;
|
|
50
50
|
background-color: $ui-02;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.desktop {
|
|
54
|
-
padding:
|
|
55
|
-
margin-top:
|
|
54
|
+
padding: 0;
|
|
55
|
+
margin-top: layout.$spacing-05;
|
|
56
56
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import { useLayoutType } from '@openmrs/esm-framework';
|
|
4
5
|
import QueueRoomForm from './queue-room-form.workspace';
|
|
5
6
|
|
|
6
|
-
jest.
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const mockUseLayoutType = jest.mocked(useLayoutType);
|
|
8
|
+
|
|
9
|
+
jest.mock('../patient-search/hooks/useQueueLocations', () => ({
|
|
10
|
+
...jest.requireActual('../patient-search/hooks/useQueueLocations'),
|
|
9
11
|
useQueueLocations: jest.fn(() => ({
|
|
10
12
|
queueLocations: { uuid: 'e7786d9a-ab62-11ec-b909-0242ac120002', display: 'Location Test' },
|
|
11
13
|
})),
|
|
12
|
-
showSnackbar: jest.fn(),
|
|
13
14
|
}));
|
|
14
15
|
|
|
15
16
|
const workspaceProps = {
|
|
16
17
|
closeWorkspace: jest.fn(),
|
|
17
18
|
promptBeforeClosing: jest.fn(),
|
|
18
19
|
closeWorkspaceWithSavedChanges: jest.fn(),
|
|
20
|
+
setTitle: jest.fn(),
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
jest.mock('./queue-room.resource', () => ({
|
|
@@ -23,6 +25,10 @@ jest.mock('./queue-room.resource', () => ({
|
|
|
23
25
|
}));
|
|
24
26
|
|
|
25
27
|
describe('QueueRoomForm', () => {
|
|
28
|
+
beforeEach(() => {
|
|
29
|
+
mockUseLayoutType.mockReturnValue('tablet');
|
|
30
|
+
});
|
|
31
|
+
|
|
26
32
|
it('renders the form with queue room elements', () => {
|
|
27
33
|
render(<QueueRoomForm {...workspaceProps} />);
|
|
28
34
|
|
|
@@ -39,7 +45,6 @@ describe('QueueRoomForm', () => {
|
|
|
39
45
|
render(<QueueRoomForm {...workspaceProps} />);
|
|
40
46
|
|
|
41
47
|
await user.click(screen.getByText('Save'));
|
|
42
|
-
|
|
43
48
|
expect(screen.getByText('Missing queue room name')).toBeInTheDocument();
|
|
44
49
|
});
|
|
45
50
|
|
|
@@ -52,7 +57,6 @@ describe('QueueRoomForm', () => {
|
|
|
52
57
|
|
|
53
58
|
await user.type(queueRoomNameInput, 'Room 123');
|
|
54
59
|
await user.click(screen.getByText('Save'));
|
|
55
|
-
|
|
56
60
|
expect(screen.getByText('Missing queue room service')).toBeInTheDocument();
|
|
57
61
|
});
|
|
58
62
|
|
|
@@ -63,7 +67,6 @@ describe('QueueRoomForm', () => {
|
|
|
63
67
|
render(<QueueRoomForm {...{ ...workspaceProps, closeWorkspace }} />);
|
|
64
68
|
|
|
65
69
|
await user.click(screen.getByText('Cancel'));
|
|
66
|
-
|
|
67
70
|
expect(closeWorkspace).toHaveBeenCalledTimes(1);
|
|
68
71
|
});
|
|
69
72
|
|
|
@@ -74,7 +77,6 @@ describe('QueueRoomForm', () => {
|
|
|
74
77
|
|
|
75
78
|
const queueRoomNameInput = screen.getByLabelText('Queue room name');
|
|
76
79
|
await user.type(queueRoomNameInput, 'Room 123');
|
|
77
|
-
|
|
78
80
|
expect(queueRoomNameInput).toHaveValue('Room 123');
|
|
79
81
|
});
|
|
80
82
|
});
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
|
|
1
3
|
.gridFlow {
|
|
2
4
|
display: flex;
|
|
3
5
|
flex-direction: row;
|
|
4
|
-
padding:
|
|
6
|
+
padding: layout.$spacing-07;
|
|
5
7
|
flex-wrap: wrap;
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
.card {
|
|
9
11
|
border-radius: 0.9rem;
|
|
10
12
|
border: 1px solid #343332;
|
|
11
|
-
margin:
|
|
13
|
+
margin: layout.$spacing-06;
|
|
12
14
|
padding: 1.3rem;
|
|
13
15
|
width: 30%;
|
|
14
16
|
text-align: center;
|
|
@@ -16,13 +18,13 @@
|
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
.header {
|
|
19
|
-
font-size:
|
|
21
|
+
font-size: layout.$spacing-07;
|
|
20
22
|
font-weight: bold;
|
|
21
23
|
color: black;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
.headerBlinking {
|
|
25
|
-
font-size:
|
|
27
|
+
font-size: layout.$spacing-07;
|
|
26
28
|
font-weight: bold;
|
|
27
29
|
color: red;
|
|
28
30
|
animation: blinker 1s linear infinite;
|
|
@@ -11,15 +11,15 @@ jest.mock('../helpers/helpers', () => ({
|
|
|
11
11
|
|
|
12
12
|
describe('QueueScreen component', () => {
|
|
13
13
|
test('renders loading skeleton when data is loading', () => {
|
|
14
|
-
const
|
|
15
|
-
|
|
14
|
+
const mockUseActiveTickets = useActiveTickets as jest.MockedFunction<typeof useActiveTickets>;
|
|
15
|
+
mockUseActiveTickets.mockReturnValue({ isLoading: true, activeTickets: [], error: undefined, mutate: jest.fn() });
|
|
16
16
|
render(<QueueScreen />);
|
|
17
17
|
expect(screen.getByRole('progressbar')).toBeInTheDocument();
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
test('renders error message when there is an error fetching data', () => {
|
|
21
|
-
const
|
|
22
|
-
|
|
21
|
+
const mockUseActiveTickets = useActiveTickets as jest.MockedFunction<typeof useActiveTickets>;
|
|
22
|
+
mockUseActiveTickets.mockReturnValue({
|
|
23
23
|
error: new Error('Error'),
|
|
24
24
|
isLoading: false,
|
|
25
25
|
activeTickets: [],
|
|
@@ -30,8 +30,8 @@ describe('QueueScreen component', () => {
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
test('renders table with active tickets when data is loaded', () => {
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
const mockUseActiveTickets = useActiveTickets as jest.MockedFunction<typeof useActiveTickets>;
|
|
34
|
+
mockUseActiveTickets.mockReturnValue({
|
|
35
35
|
activeTickets: [
|
|
36
36
|
{
|
|
37
37
|
room: 'Room A',
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
4
|
|
|
5
5
|
.heading {
|
|
6
6
|
@include type.type-style('heading-compact-01');
|
|
7
|
-
margin:
|
|
7
|
+
margin: layout.$spacing-05 0 layout.$spacing-05;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.warningContainer {
|
|
11
11
|
background-color: $carbon--red-50;
|
|
12
|
-
padding:
|
|
13
|
-
margin:
|
|
12
|
+
padding: layout.$spacing-04;
|
|
13
|
+
margin: layout.$spacing-03 0 layout.$spacing-03;
|
|
14
14
|
display: flex;
|
|
15
15
|
justify-content: space-between;
|
|
16
16
|
.warning {
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.grid {
|
|
30
|
-
margin: 0
|
|
31
|
-
padding:
|
|
30
|
+
margin: 0 layout.$spacing-05;
|
|
31
|
+
padding: 0;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.input {
|
|
35
|
-
margin-top:
|
|
35
|
+
margin-top: layout.$spacing-04;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.button {
|
|
39
|
-
height:
|
|
39
|
+
height: layout.$spacing-10;
|
|
40
40
|
display: flex;
|
|
41
41
|
align-content: flex-start;
|
|
42
42
|
align-items: baseline;
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.buttonSet {
|
|
47
|
-
padding:
|
|
48
|
-
margin-top:
|
|
47
|
+
padding: 0;
|
|
48
|
+
margin-top: layout.$spacing-05;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/* Tablet */
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
.buttonSet {
|
|
58
|
-
padding:
|
|
58
|
+
padding: layout.$spacing-06 layout.$spacing-05;
|
|
59
59
|
background-color: $ui-02;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import { useLayoutType } from '@openmrs/esm-framework';
|
|
4
5
|
import QueueServiceForm from './queue-service-form.workspace';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const defaultProps = {
|
|
8
|
+
closeWorkspace: jest.fn(),
|
|
9
|
+
promptBeforeClosing: jest.fn(),
|
|
10
|
+
closeWorkspaceWithSavedChanges: jest.fn(),
|
|
11
|
+
setTitle: jest.fn(),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const mockUseLayoutType = jest.mocked(useLayoutType);
|
|
10
15
|
|
|
11
16
|
jest.mock('./queue-service.resource', () => ({
|
|
12
17
|
useServiceConcepts: () => ({
|
|
@@ -28,22 +33,24 @@ jest.mock('../patient-search/hooks/useQueueLocations', () => ({
|
|
|
28
33
|
}));
|
|
29
34
|
|
|
30
35
|
describe('QueueServiceForm', () => {
|
|
36
|
+
beforeEach(() => {
|
|
37
|
+
mockUseLayoutType.mockReturnValue('tablet');
|
|
38
|
+
});
|
|
39
|
+
|
|
31
40
|
it('should display required error messages when form is submitted with missing fields', async () => {
|
|
32
41
|
const user = userEvent.setup();
|
|
33
42
|
|
|
34
|
-
render(<QueueServiceForm
|
|
43
|
+
render(<QueueServiceForm {...defaultProps} />);
|
|
35
44
|
|
|
36
45
|
const submitButton = screen.getByText('Save');
|
|
37
|
-
|
|
38
46
|
await user.click(submitButton);
|
|
39
|
-
|
|
40
47
|
expect(screen.getByText('Missing queue name')).toBeInTheDocument();
|
|
41
48
|
});
|
|
42
49
|
|
|
43
50
|
it('should submit the form when all fields are filled', async () => {
|
|
44
51
|
const user = userEvent.setup();
|
|
45
52
|
|
|
46
|
-
render(<QueueServiceForm
|
|
53
|
+
render(<QueueServiceForm {...defaultProps} />);
|
|
47
54
|
|
|
48
55
|
const queueNameInput = screen.getByLabelText('Queue name');
|
|
49
56
|
const serviceSelect = screen.getByLabelText('Select a service type');
|
|
@@ -13,7 +13,7 @@ export function QueueTableActionCell({ queueEntry }: QueueTableCellComponentProp
|
|
|
13
13
|
<div className={styles.actionsCell}>
|
|
14
14
|
<Button
|
|
15
15
|
kind="ghost"
|
|
16
|
-
aria-label={t('
|
|
16
|
+
aria-label={t('transition', 'Transition')}
|
|
17
17
|
onClick={() => {
|
|
18
18
|
const dispose = showModal('transition-queue-entry-modal', {
|
|
19
19
|
closeModal: () => dispose(),
|
|
@@ -23,7 +23,7 @@ export function QueueTableActionCell({ queueEntry }: QueueTableCellComponentProp
|
|
|
23
23
|
size={isDesktop(layout) ? 'sm' : 'lg'}>
|
|
24
24
|
{t('transition', 'Transition')}
|
|
25
25
|
</Button>
|
|
26
|
-
<OverflowMenu aria-label="Actions menu" size={isDesktop(layout) ? 'sm' : 'lg'} flipped>
|
|
26
|
+
<OverflowMenu aria-label="Actions menu" size={isDesktop(layout) ? 'sm' : 'lg'} align="left" flipped>
|
|
27
27
|
<OverflowMenuItem
|
|
28
28
|
className={styles.menuItem}
|
|
29
29
|
aria-label={t('edit', 'Edit')}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { type QueueTableColumnFunction, type QueueTableCellComponentProps } from '../../types';
|
|
3
3
|
|
|
4
4
|
export const QueueTableComingFromCell = ({ queueEntry }: QueueTableCellComponentProps) => {
|
|
5
|
-
return <>{queueEntry.queueComingFrom?.display}</>;
|
|
5
|
+
return <>{queueEntry.queueComingFrom?.display ?? '--'}</>;
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export const queueTableComingFromColumn: QueueTableColumnFunction = (key, header) => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
-
import { DataTableSkeleton, Dropdown, TableToolbarSearch } from '@carbon/react';
|
|
2
|
+
import { DataTableSkeleton, Dropdown, Layer, TableToolbarSearch } from '@carbon/react';
|
|
3
3
|
import { Add } from '@carbon/react/icons';
|
|
4
4
|
import {
|
|
5
5
|
closeWorkspace,
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
useLayoutType,
|
|
12
12
|
} from '@openmrs/esm-framework';
|
|
13
13
|
import { useTranslation } from 'react-i18next';
|
|
14
|
-
import ClearQueueEntries from '../clear-queue-entries-dialog/clear-queue-entries.component';
|
|
15
14
|
import {
|
|
16
15
|
updateSelectedQueueStatus,
|
|
17
16
|
updateSelectedService,
|
|
@@ -19,13 +18,14 @@ import {
|
|
|
19
18
|
useSelectedQueueStatus,
|
|
20
19
|
useSelectedService,
|
|
21
20
|
} from '../helpers/helpers';
|
|
21
|
+
import { useColumns } from './cells/columns.resource';
|
|
22
|
+
import useQueueStatuses from '../hooks/useQueueStatuses';
|
|
23
|
+
import useQueueServices from '../hooks/useQueueService';
|
|
24
|
+
import ClearQueueEntries from '../clear-queue-entries-dialog/clear-queue-entries.component';
|
|
22
25
|
import { useMutateQueueEntries, useQueueEntries } from '../hooks/useQueueEntries';
|
|
23
26
|
import QueueTableExpandedRow from './queue-table-expanded-row.component';
|
|
24
27
|
import QueueTable from './queue-table.component';
|
|
25
28
|
import styles from './queue-table.scss';
|
|
26
|
-
import { useColumns } from './cells/columns.resource';
|
|
27
|
-
import useQueueStatuses from '../hooks/useQueueStatuses';
|
|
28
|
-
import useQueueServices from '../hooks/useQueueService';
|
|
29
29
|
|
|
30
30
|
const serviceQueuesPatientSearchWorkspace = 'service-queues-patient-search';
|
|
31
31
|
|
|
@@ -91,63 +91,65 @@ function DefaultQueueTable() {
|
|
|
91
91
|
}, [queueEntries, searchTerm]);
|
|
92
92
|
|
|
93
93
|
return (
|
|
94
|
-
<div className={styles.
|
|
95
|
-
<
|
|
96
|
-
<div className={
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
{!isLoading ? (
|
|
128
|
-
<div className={styles.paddedQueueTable}>
|
|
129
|
-
<QueueTable
|
|
130
|
-
queueEntries={filteredQueueEntries ?? []}
|
|
131
|
-
isValidating={isValidating}
|
|
132
|
-
queueUuid={null}
|
|
133
|
-
statusUuid={null}
|
|
134
|
-
ExpandedRow={QueueTableExpandedRow}
|
|
135
|
-
tableFilter={[
|
|
136
|
-
<QueueDropdownFilter />,
|
|
137
|
-
<StatusDropdownFilter />,
|
|
138
|
-
<TableToolbarSearch
|
|
139
|
-
className={styles.search}
|
|
140
|
-
onChange={(e) => setSearchTerm(e.target.value)}
|
|
141
|
-
placeholder={t('searchThisList', 'Search this list')}
|
|
142
|
-
size={isDesktop(layout) ? 'sm' : 'lg'}
|
|
143
|
-
/>,
|
|
144
|
-
<ClearQueueEntries queueEntries={filteredQueueEntries} />,
|
|
145
|
-
]}
|
|
146
|
-
/>
|
|
94
|
+
<div className={styles.defaultQueueTable}>
|
|
95
|
+
<Layer className={styles.container}>
|
|
96
|
+
<div className={styles.headerContainer}>
|
|
97
|
+
<div className={!isDesktop(layout) ? styles.tabletHeading : styles.desktopHeading}>
|
|
98
|
+
<h4>{t('patientsCurrentlyInQueue', 'Patients currently in queue')}</h4>
|
|
99
|
+
</div>
|
|
100
|
+
<div className={styles.headerButtons}>
|
|
101
|
+
<ExtensionSlot
|
|
102
|
+
name="patient-search-button-slot"
|
|
103
|
+
state={{
|
|
104
|
+
isOpen: isPatientSearchOpen,
|
|
105
|
+
searchQuery: patientSearchQuery,
|
|
106
|
+
buttonText: t('addPatientToQueue', 'Add patient to queue'),
|
|
107
|
+
overlayHeader: t('addPatientToQueue', 'Add patient to queue'),
|
|
108
|
+
buttonProps: {
|
|
109
|
+
kind: 'secondary',
|
|
110
|
+
renderIcon: (props) => <Add size={16} {...props} />,
|
|
111
|
+
size: 'sm',
|
|
112
|
+
},
|
|
113
|
+
searchQueryUpdatedAction: (searchQuery: string) => {
|
|
114
|
+
setPatientSearchQuery(searchQuery);
|
|
115
|
+
},
|
|
116
|
+
selectPatientAction: (selectedPatientUuid: string) => {
|
|
117
|
+
setIsPatientSearchOpen(false);
|
|
118
|
+
launchWorkspace(serviceQueuesPatientSearchWorkspace, {
|
|
119
|
+
selectedPatientUuid,
|
|
120
|
+
currentServiceQueueUuid: selectedService?.serviceUuid,
|
|
121
|
+
handleBackToSearchList,
|
|
122
|
+
});
|
|
123
|
+
},
|
|
124
|
+
}}
|
|
125
|
+
/>
|
|
126
|
+
</div>
|
|
147
127
|
</div>
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
128
|
+
{!isLoading ? (
|
|
129
|
+
<div>
|
|
130
|
+
<QueueTable
|
|
131
|
+
queueEntries={filteredQueueEntries ?? []}
|
|
132
|
+
isValidating={isValidating}
|
|
133
|
+
queueUuid={null}
|
|
134
|
+
statusUuid={null}
|
|
135
|
+
ExpandedRow={QueueTableExpandedRow}
|
|
136
|
+
tableFilter={[
|
|
137
|
+
<QueueDropdownFilter />,
|
|
138
|
+
<StatusDropdownFilter />,
|
|
139
|
+
<TableToolbarSearch
|
|
140
|
+
className={styles.search}
|
|
141
|
+
onChange={(e) => setSearchTerm(e.target.value)}
|
|
142
|
+
placeholder={t('searchThisList', 'Search this list')}
|
|
143
|
+
size={isDesktop(layout) ? 'sm' : 'lg'}
|
|
144
|
+
/>,
|
|
145
|
+
<ClearQueueEntries queueEntries={filteredQueueEntries} />,
|
|
146
|
+
]}
|
|
147
|
+
/>
|
|
148
|
+
</div>
|
|
149
|
+
) : (
|
|
150
|
+
<DataTableSkeleton role="progressbar" />
|
|
151
|
+
)}
|
|
152
|
+
</Layer>
|
|
151
153
|
</div>
|
|
152
154
|
);
|
|
153
155
|
}
|