@kenyaemr/esm-service-queues-app 7.0.3-pre.89 → 7.0.3-pre.94
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 +1 -1
- 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,6 +1,6 @@
|
|
|
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
|
.patientChart {
|
|
6
6
|
text-decoration: none;
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.patientAvatar {
|
|
28
|
-
width:
|
|
29
|
-
height:
|
|
30
|
-
margin:
|
|
28
|
+
width: layout.$spacing-11;
|
|
29
|
+
height: layout.$spacing-11;
|
|
30
|
+
margin: layout.$spacing-05 layout.$spacing-05 0;
|
|
31
31
|
border-radius: 1px;
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
width: 100%;
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-flow: column wrap;
|
|
38
|
-
margin:
|
|
38
|
+
margin: layout.$spacing-05 0;
|
|
39
39
|
cursor: pointer;
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.actionsContainer {
|
|
54
|
-
padding-top:
|
|
55
|
-
margin-top:
|
|
54
|
+
padding-top: layout.$spacing-03;
|
|
55
|
+
margin-top: layout.$spacing-05;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.sortingCriteriaSelect {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
:global(.cds--list-box__menu-icon) {
|
|
70
|
-
height:
|
|
70
|
+
height: layout.$spacing-05;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
:global(.cds--list-box__menu) {
|
|
@@ -75,6 +75,6 @@
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
:global(.cds--label) {
|
|
78
|
-
margin-right:
|
|
78
|
+
margin-right: layout.$spacing-02;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -3,15 +3,7 @@ import { screen, render } from '@testing-library/react';
|
|
|
3
3
|
import { age } from '@openmrs/esm-framework';
|
|
4
4
|
import SearchResults from './search-results.component';
|
|
5
5
|
|
|
6
|
-
const mockAge =
|
|
7
|
-
|
|
8
|
-
jest.mock('@openmrs/esm-framework', () => {
|
|
9
|
-
const originalModule = jest.requireActual('@openmrs/esm-framework');
|
|
10
|
-
return {
|
|
11
|
-
...originalModule,
|
|
12
|
-
age: jest.fn(),
|
|
13
|
-
};
|
|
14
|
-
});
|
|
6
|
+
const mockAge = jest.mocked(age);
|
|
15
7
|
|
|
16
8
|
const patients = [
|
|
17
9
|
{
|
|
@@ -63,7 +55,7 @@ const mockToggleSearchType = jest.fn();
|
|
|
63
55
|
|
|
64
56
|
describe('Search Results', () => {
|
|
65
57
|
it('should search results page', () => {
|
|
66
|
-
mockAge.mockReturnValue(35);
|
|
58
|
+
mockAge.mockReturnValue('35');
|
|
67
59
|
renderSearchResults();
|
|
68
60
|
expect(screen.getByText(/John Smith/)).toBeInTheDocument();
|
|
69
61
|
expect(screen.getByText(/35/)).toBeInTheDocument();
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
@use '@carbon/styles/scss/spacing';
|
|
2
|
-
@use '@carbon/styles/scss/type';
|
|
3
1
|
@use '@carbon/layout';
|
|
4
|
-
@
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
5
4
|
|
|
6
5
|
.container {
|
|
7
6
|
flex: 1;
|
|
8
7
|
|
|
9
8
|
& section {
|
|
10
|
-
margin:
|
|
9
|
+
margin: layout.$spacing-05 layout.$spacing-05 layout.$spacing-05;
|
|
11
10
|
}
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
.heading {
|
|
15
14
|
@include type.type-style('heading-03');
|
|
16
|
-
margin:
|
|
15
|
+
margin: layout.$spacing-05;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
.sectionTitle {
|
|
20
19
|
@include type.type-style('heading-compact-02');
|
|
21
20
|
color: $text-02;
|
|
22
|
-
margin-bottom:
|
|
21
|
+
margin-bottom: layout.$spacing-05;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
.dateTimeSection {
|
|
@@ -27,7 +26,7 @@
|
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
.radioButton {
|
|
30
|
-
margin:
|
|
29
|
+
margin: layout.$spacing-05 0;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
.headerGridRow {
|
|
@@ -38,7 +37,7 @@
|
|
|
38
37
|
.dataGridRow {
|
|
39
38
|
display: grid;
|
|
40
39
|
grid-template-columns: 50% 10% 1fr;
|
|
41
|
-
margin:
|
|
40
|
+
margin: layout.$spacing-03 layout.$spacing-05;
|
|
42
41
|
width: 100%;
|
|
43
42
|
}
|
|
44
43
|
|
|
@@ -50,7 +49,7 @@
|
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
.button {
|
|
53
|
-
height:
|
|
52
|
+
height: layout.$spacing-10;
|
|
54
53
|
display: flex;
|
|
55
54
|
align-content: flex-start;
|
|
56
55
|
align-items: baseline;
|
|
@@ -58,14 +57,14 @@
|
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
.tabletButtons {
|
|
61
|
-
padding:
|
|
62
|
-
margin-top:
|
|
60
|
+
padding: layout.$spacing-06 layout.$spacing-05;
|
|
61
|
+
margin-top: layout.$spacing-10;
|
|
63
62
|
background-color: $ui-02;
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
.desktopButtons {
|
|
67
|
-
padding:
|
|
68
|
-
margin-top:
|
|
66
|
+
padding: 0;
|
|
67
|
+
margin-top: layout.$spacing-10;
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
@media screen and (max-width: 600px) {
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import React, { useState, useMemo, useEffect } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import debounce from 'lodash-es/debounce';
|
|
4
3
|
import isEmpty from 'lodash-es/isEmpty';
|
|
5
4
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { Layer, Search, RadioButtonGroup, RadioButton, StructuredListSkeleton, Tile } from '@carbon/react';
|
|
7
5
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from '@
|
|
6
|
+
InlineNotification,
|
|
7
|
+
Layer,
|
|
8
|
+
RadioButton,
|
|
9
|
+
RadioButtonGroup,
|
|
10
|
+
Search,
|
|
11
|
+
StructuredListSkeleton,
|
|
12
|
+
Tile,
|
|
13
|
+
} from '@carbon/react';
|
|
14
|
+
import { ResponsiveWrapper, useDebounce, useLayoutType, useVisitTypes, type VisitType } from '@openmrs/esm-framework';
|
|
16
15
|
import EmptyDataIllustration from '../empty-data-illustration.component';
|
|
17
16
|
import styles from './visit-type-selector.scss';
|
|
18
17
|
import { useRecommendedVisitTypes } from '../hooks/useRecommendedVisitTypes';
|
|
19
18
|
import { type PatientProgram } from '../../types';
|
|
20
|
-
import { InlineNotification } from '@carbon/react';
|
|
21
19
|
|
|
22
20
|
export interface VisitTypeSelectorProps {
|
|
23
21
|
onChange: (event) => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
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
|
.visitTypeOverviewWrapper {
|
|
6
|
-
margin:
|
|
6
|
+
margin: layout.$spacing-05 0;
|
|
7
7
|
border: 0.0625rem solid $grey-2;
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -31,22 +31,22 @@
|
|
|
31
31
|
display: flex;
|
|
32
32
|
flex-direction: column;
|
|
33
33
|
align-items: flex-start;
|
|
34
|
-
margin-top:
|
|
35
|
-
min-height:
|
|
34
|
+
margin-top: layout.$spacing-03;
|
|
35
|
+
min-height: layout.$spacing-10;
|
|
36
36
|
width: 100%;
|
|
37
37
|
@include type.type-style('body-compact-01');
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.radioButton {
|
|
41
|
-
padding:
|
|
42
|
-
margin:
|
|
41
|
+
padding: layout.$spacing-02 layout.$spacing-05;
|
|
42
|
+
margin: layout.$spacing-03 0;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.content {
|
|
46
46
|
@include type.type-style('heading-compact-01');
|
|
47
47
|
color: $text-02;
|
|
48
|
-
margin-top:
|
|
49
|
-
margin-bottom:
|
|
48
|
+
margin-top: layout.$spacing-05;
|
|
49
|
+
margin-bottom: layout.$spacing-03;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.desktopHeading {
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
.tabletHeading {
|
|
68
68
|
text-align: left;
|
|
69
69
|
text-transform: capitalize;
|
|
70
|
-
margin-bottom:
|
|
70
|
+
margin-bottom: layout.$spacing-05;
|
|
71
71
|
|
|
72
72
|
h4:after {
|
|
73
73
|
content: '';
|
|
74
74
|
display: block;
|
|
75
|
-
width:
|
|
75
|
+
width: layout.$spacing-07;
|
|
76
76
|
padding-top: 0.188rem;
|
|
77
77
|
border-bottom: 0.375rem solid var(--brand-03);
|
|
78
78
|
}
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
.heading:after {
|
|
82
82
|
content: '';
|
|
83
83
|
display: block;
|
|
84
|
-
width:
|
|
84
|
+
width: layout.$spacing-07;
|
|
85
85
|
padding-top: 0.188rem;
|
|
86
86
|
border-bottom: 0.375rem solid var(--brand-03);
|
|
87
87
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
/* eslint-disable testing-library/no-node-access */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import userEvent from '@testing-library/user-event';
|
|
3
|
-
import { VisitTypeSelector } from './visit-type-selector.component';
|
|
4
4
|
import { render, screen } from '@testing-library/react';
|
|
5
|
-
import {
|
|
5
|
+
import { mockVisitTypes } from '__mocks__';
|
|
6
6
|
import { useVisitTypes } from '@openmrs/esm-framework';
|
|
7
|
+
import { VisitTypeSelector } from './visit-type-selector.component';
|
|
7
8
|
|
|
8
9
|
const mockUseVisitTypes = jest.mocked(useVisitTypes);
|
|
9
10
|
|
|
@@ -28,7 +29,7 @@ describe('VisitTypeSelector', () => {
|
|
|
28
29
|
it('renders the first 5 visit types with a search bar if there are more than 5', () => {
|
|
29
30
|
render(<VisitTypeSelector onChange={() => {}} />);
|
|
30
31
|
|
|
31
|
-
expect(screen.
|
|
32
|
+
expect(screen.getByRole('searchbox')).toBeInTheDocument();
|
|
32
33
|
|
|
33
34
|
mockVisitTypes.slice(0, 5).forEach((visitType) => {
|
|
34
35
|
const radioButton = screen.getByLabelText(visitType.display);
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
+
/* eslint-disable testing-library/no-node-access */
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import userEvent from '@testing-library/user-event';
|
|
3
4
|
import { render, screen } from '@testing-library/react';
|
|
5
|
+
import { getDefaultsFromConfigSchema, useConfig, useLayoutType, useSession } from '@openmrs/esm-framework';
|
|
6
|
+
import { configSchema, type ConfigObject } from '../../config-schema';
|
|
7
|
+
import { mockSession } from '__mocks__';
|
|
4
8
|
import VisitFormQueueFields from './visit-form-queue-fields.component';
|
|
5
|
-
import { defineConfigSchema, useLayoutType, useSession } from '@openmrs/esm-framework';
|
|
6
|
-
import { configSchema } from '../../config-schema';
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
mockUseLayoutType.mockReturnValue('small-desktop');
|
|
12
|
-
|
|
13
|
-
const mockUseSession = useSession as jest.Mock;
|
|
14
|
-
mockUseSession.mockReturnValue({ sessionLocation: { uuid: '1' } });
|
|
10
|
+
const mockUseConfig = jest.mocked(useConfig<ConfigObject>);
|
|
11
|
+
const mockUseLayoutType = jest.mocked(useLayoutType);
|
|
12
|
+
const mockUseSession = jest.mocked(useSession);
|
|
15
13
|
|
|
16
14
|
jest.mock('../hooks/useQueueLocations', () => ({
|
|
17
15
|
useQueueLocations: jest.fn(() => ({
|
|
@@ -35,6 +33,14 @@ jest.mock('../../hooks/useQueues', () => {
|
|
|
35
33
|
});
|
|
36
34
|
|
|
37
35
|
describe('VisitFormQueueFields', () => {
|
|
36
|
+
beforeEach(() => {
|
|
37
|
+
mockUseLayoutType.mockReturnValue('small-desktop');
|
|
38
|
+
mockUseSession.mockReturnValue(mockSession.data);
|
|
39
|
+
mockUseConfig.mockReturnValue({
|
|
40
|
+
...getDefaultsFromConfigSchema(configSchema),
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
38
44
|
it('renders the form fields and returns the set values', async () => {
|
|
39
45
|
const user = userEvent.setup();
|
|
40
46
|
const setFormFields = jest.fn();
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@
|
|
3
|
-
@import '~@openmrs/esm-styleguide/src/vars';
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
3
|
|
|
5
4
|
.tag {
|
|
6
|
-
margin:
|
|
5
|
+
margin: layout.$spacing-02 0;
|
|
7
6
|
white-space: nowrap;
|
|
8
7
|
}
|
|
9
8
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@use '@
|
|
4
|
-
@import '~@openmrs/esm-styleguide/src/vars';
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
5
4
|
|
|
6
5
|
.container {
|
|
7
|
-
padding-bottom:
|
|
6
|
+
padding-bottom: layout.$spacing-07;
|
|
8
7
|
background-color: $ui-01;
|
|
9
8
|
}
|
|
10
9
|
|
|
@@ -16,8 +15,8 @@
|
|
|
16
15
|
display: flex;
|
|
17
16
|
justify-content: space-between;
|
|
18
17
|
align-items: center;
|
|
19
|
-
padding:
|
|
20
|
-
margin:
|
|
18
|
+
padding: layout.$spacing-05;
|
|
19
|
+
margin: layout.$spacing-03;
|
|
21
20
|
border-top: 1px solid $text-03;
|
|
22
21
|
border-bottom: 1px solid $text-03;
|
|
23
22
|
}
|
|
@@ -25,19 +24,19 @@
|
|
|
25
24
|
.title {
|
|
26
25
|
@include type.type-style('body-compact-02');
|
|
27
26
|
|
|
28
|
-
margin: 0
|
|
27
|
+
margin: 0 layout.$spacing-04 layout.$spacing-04;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
.subTitle {
|
|
32
31
|
@include type.type-style('label-01');
|
|
33
32
|
color: $text-02;
|
|
34
|
-
margin:
|
|
35
|
-
margin-left:
|
|
33
|
+
margin: layout.$spacing-01;
|
|
34
|
+
margin-left: layout.$spacing-04;
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
.filterTile {
|
|
39
38
|
border-bottom: 1px solid $text-03;
|
|
40
|
-
margin-bottom:
|
|
39
|
+
margin-bottom: layout.$spacing-04;
|
|
41
40
|
background-color: $ui-01;
|
|
42
41
|
}
|
|
43
42
|
|
|
@@ -46,7 +45,7 @@
|
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
.tableContainer {
|
|
49
|
-
margin: 0
|
|
48
|
+
margin: 0 layout.$spacing-05;
|
|
50
49
|
padding: 0;
|
|
51
50
|
}
|
|
52
51
|
|
|
@@ -66,12 +65,12 @@
|
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
tr {
|
|
69
|
-
width:
|
|
68
|
+
width: layout.$spacing-01;
|
|
70
69
|
}
|
|
71
70
|
|
|
72
71
|
.toolbarContent {
|
|
73
|
-
height:
|
|
74
|
-
margin-bottom:
|
|
72
|
+
height: layout.$spacing-07;
|
|
73
|
+
margin-bottom: layout.$spacing-02;
|
|
75
74
|
}
|
|
76
75
|
}
|
|
77
76
|
|
|
@@ -84,7 +83,7 @@
|
|
|
84
83
|
.tileContainer {
|
|
85
84
|
background-color: $ui-02;
|
|
86
85
|
border-top: 1px solid $ui-03;
|
|
87
|
-
padding:
|
|
86
|
+
padding: layout.$spacing-11 0;
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
.tile {
|
|
@@ -101,7 +100,7 @@
|
|
|
101
100
|
.content {
|
|
102
101
|
@include type.type-style('heading-compact-02');
|
|
103
102
|
color: $text-02;
|
|
104
|
-
margin-bottom:
|
|
103
|
+
margin-bottom: layout.$spacing-03;
|
|
105
104
|
}
|
|
106
105
|
|
|
107
106
|
.helper {
|
|
@@ -38,7 +38,7 @@ const tableHeaders = [
|
|
|
38
38
|
},
|
|
39
39
|
];
|
|
40
40
|
|
|
41
|
-
const
|
|
41
|
+
const defaultProps = {
|
|
42
42
|
title: 'Scheduled appointments',
|
|
43
43
|
patientData: mockMappedAppointmentsData.data,
|
|
44
44
|
headers: tableHeaders,
|
|
@@ -46,13 +46,13 @@ const testProps = {
|
|
|
46
46
|
isLoading: false,
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
describe('QueuePatientBaseTable
|
|
49
|
+
describe('QueuePatientBaseTable', () => {
|
|
50
50
|
it('renders a tabular overview of appointments data when available', async () => {
|
|
51
51
|
const user = userEvent.setup();
|
|
52
52
|
|
|
53
53
|
renderQueueBaseTable();
|
|
54
54
|
|
|
55
|
-
expect(screen.
|
|
55
|
+
expect(screen.getByText(/scheduled appointments/i)).toBeInTheDocument();
|
|
56
56
|
const expectedColumnHeaders = [/name/, /return date/, /gender/, /age/, /visit type/, /phone number/];
|
|
57
57
|
expectedColumnHeaders.forEach((header) => {
|
|
58
58
|
expect(screen.getByRole('columnheader', { name: new RegExp(header, 'i') })).toBeInTheDocument();
|
|
@@ -70,7 +70,7 @@ describe('QueuePatientBaseTable: ', () => {
|
|
|
70
70
|
const searchBox = screen.getByRole('searchbox');
|
|
71
71
|
await user.type(searchBox, 'John');
|
|
72
72
|
|
|
73
|
-
expect(screen.
|
|
73
|
+
expect(screen.getByText(/john wilson/i)).toBeInTheDocument();
|
|
74
74
|
expect(screen.queryByText(/eric test ric/i)).not.toBeInTheDocument();
|
|
75
75
|
|
|
76
76
|
await user.clear(searchBox);
|
|
@@ -80,14 +80,13 @@ describe('QueuePatientBaseTable: ', () => {
|
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
it('renders an empty state view if data is unavailable', async () => {
|
|
83
|
-
|
|
84
|
-
renderQueueBaseTable();
|
|
83
|
+
renderQueueBaseTable({ patientData: [] });
|
|
85
84
|
|
|
86
85
|
expect(screen.getByText(/scheduled appointments/i)).toBeInTheDocument();
|
|
87
86
|
expect(screen.getByText(/no patients to display/i)).toBeInTheDocument();
|
|
88
87
|
});
|
|
89
88
|
});
|
|
90
89
|
|
|
91
|
-
function renderQueueBaseTable() {
|
|
92
|
-
renderWithSwr(<QueuePatientBaseTable {...
|
|
90
|
+
function renderQueueBaseTable(props = {}) {
|
|
91
|
+
renderWithSwr(<QueuePatientBaseTable {...defaultProps} {...props} />);
|
|
93
92
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
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
|
.wrapper {
|
|
6
6
|
background-color: $ui-02;
|
|
7
|
-
padding:
|
|
7
|
+
padding: layout.$spacing-06;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.grid {
|
|
11
|
-
padding: 0
|
|
11
|
+
padding: 0 layout.$spacing-06 layout.$spacing-03;
|
|
12
12
|
background-color: $ui-01;
|
|
13
|
-
margin-bottom:
|
|
13
|
+
margin-bottom: layout.$spacing-05;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.heading {
|
|
17
17
|
color: $text-02;
|
|
18
18
|
@include type.type-style('heading-compact-02');
|
|
19
|
-
margin:
|
|
19
|
+
margin: layout.$spacing-04 0 layout.$spacing-04;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.radioButton {
|
|
23
|
-
margin-top:
|
|
23
|
+
margin-top: layout.$spacing-03;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.button {
|
|
27
|
-
height:
|
|
27
|
+
height: layout.$spacing-10;
|
|
28
28
|
display: flex;
|
|
29
29
|
align-content: flex-start;
|
|
30
30
|
align-items: baseline;
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.numberInputs {
|
|
35
|
-
margin-top:
|
|
35
|
+
margin-top: layout.$spacing-02;
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-direction: row;
|
|
38
38
|
justify-content: space-between;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.tablet {
|
|
42
|
-
padding:
|
|
42
|
+
padding: layout.$spacing-06 layout.$spacing-05;
|
|
43
43
|
background-color: $ui-02;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.desktop {
|
|
47
|
-
padding:
|
|
48
|
-
margin-top:
|
|
47
|
+
padding: 0;
|
|
48
|
+
margin-top: layout.$spacing-05;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.form {
|
|
@@ -1,23 +1,26 @@
|
|
|
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, useVisitTypes } from '@openmrs/esm-framework';
|
|
4
5
|
import { mockVisitTypes } from '__mocks__';
|
|
5
6
|
import QueueLinelistFilter from './queue-linelist-filter.workspace';
|
|
6
7
|
|
|
7
|
-
jest.
|
|
8
|
-
|
|
9
|
-
useLayoutType: jest.fn(() => 'tablet'),
|
|
10
|
-
useVisitTypes: jest.fn(() => mockVisitTypes),
|
|
11
|
-
toOpemrsIsoString: jest.fn(),
|
|
12
|
-
}));
|
|
8
|
+
const mockUseLayoutType = jest.mocked(useLayoutType);
|
|
9
|
+
const mockUseVisitTypes = jest.mocked(useVisitTypes);
|
|
13
10
|
|
|
14
11
|
const workspaceProps = {
|
|
15
12
|
closeWorkspace: jest.fn(),
|
|
16
13
|
promptBeforeClosing: jest.fn(),
|
|
17
14
|
closeWorkspaceWithSavedChanges: jest.fn(),
|
|
15
|
+
setTitle: jest.fn(),
|
|
18
16
|
};
|
|
19
17
|
|
|
20
18
|
describe('QueueLinelistFilter', () => {
|
|
19
|
+
beforeEach(() => {
|
|
20
|
+
mockUseLayoutType.mockReturnValue('tablet');
|
|
21
|
+
mockUseVisitTypes.mockReturnValue(mockVisitTypes);
|
|
22
|
+
});
|
|
23
|
+
|
|
21
24
|
it('renders the form with filter elements', () => {
|
|
22
25
|
render(<QueueLinelistFilter {...workspaceProps} />);
|
|
23
26
|
|
|
@@ -12,7 +12,7 @@ export function useAppointments() {
|
|
|
12
12
|
return {
|
|
13
13
|
appointmentQueueEntries: data ? data?.data : [],
|
|
14
14
|
isLoading,
|
|
15
|
-
|
|
15
|
+
error,
|
|
16
16
|
isValidating,
|
|
17
17
|
};
|
|
18
18
|
}
|
|
@@ -25,7 +25,7 @@ export function useCheckedInAppointments() {
|
|
|
25
25
|
return {
|
|
26
26
|
checkedInAppointments: data ? data?.data : [],
|
|
27
27
|
isLoading,
|
|
28
|
-
|
|
28
|
+
error,
|
|
29
29
|
isValidating,
|
|
30
30
|
};
|
|
31
31
|
}
|
|
@@ -41,7 +41,7 @@ export function useProviders() {
|
|
|
41
41
|
return {
|
|
42
42
|
providers: data ? data.data?.results : [],
|
|
43
43
|
isLoading,
|
|
44
|
-
|
|
44
|
+
error,
|
|
45
45
|
isValidating,
|
|
46
46
|
};
|
|
47
47
|
}
|
|
@@ -77,7 +77,7 @@ export function usePatientAppointments(patientUuid: string, startDate) {
|
|
|
77
77
|
|
|
78
78
|
return {
|
|
79
79
|
upcomingAppointment: upcomingAppointments ? upcomingAppointments?.[0] : null,
|
|
80
|
-
|
|
80
|
+
error,
|
|
81
81
|
isLoading,
|
|
82
82
|
isValidating,
|
|
83
83
|
};
|