@kenyaemr/esm-patient-list-management-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 +17 -16
- package/dist/112.js +1 -0
- package/dist/112.js.map +1 -0
- package/dist/130.js +1 -1
- package/dist/130.js.map +1 -1
- package/dist/271.js +2 -1
- package/dist/271.js.map +1 -0
- package/dist/37.js +1 -0
- package/dist/37.js.map +1 -0
- package/dist/384.js +1 -0
- package/dist/757.js +1 -1
- package/dist/kenyaemr-esm-patient-list-management-app.js +1 -1
- package/dist/kenyaemr-esm-patient-list-management-app.js.buildmanifest.json +78 -78
- 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/add-patient/add-patient.scss +14 -5
- package/src/add-patient-to-patient-list-menu-item.test.tsx +4 -6
- package/src/create-edit-patient-list/create-edit-patient-list.scss +5 -6
- package/src/empty-state/empty-state.scss +6 -6
- package/src/error-state/error-state.scss +1 -1
- package/src/header/header.component.tsx +1 -0
- package/src/header/header.scss +8 -8
- package/src/list-details/list-details.scss +27 -7
- package/src/list-details/list-details.test.tsx +34 -24
- package/src/list-details-table/list-details-table.component.tsx +1 -1
- package/src/list-details-table/list-details-table.scss +18 -18
- package/src/list-details-table/list-details-table.test.tsx +3 -8
- package/src/lists-dashboard/lists-dashboard.scss +12 -13
- package/src/lists-dashboard/lists-dashboard.test.tsx +8 -8
- package/src/lists-table/custom-pagination.scss +9 -9
- package/src/lists-table/lists-table.component.tsx +1 -1
- package/src/lists-table/lists-table.scss +7 -7
- package/src/lists-table/lists-table.test.tsx +12 -12
- package/src/overlay.component.tsx +3 -1
- package/src/overlay.scss +10 -10
- package/src/overlay.test.tsx +16 -24
- package/translations/fr.json +19 -19
- package/dist/139.js +0 -1
- package/dist/139.js.map +0 -1
- package/dist/548.js +0 -1
- package/dist/548.js.map +0 -1
- package/dist/930.js +0 -2
- package/dist/930.js.map +0 -1
- package/src/list-details/patient-list-detail.test.tsx +0 -105
- package/src/style.scss +0 -46
- /package/dist/{930.js.LICENSE.txt → 271.js.LICENSE.txt} +0 -0
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"extensions":[{"name":"patient-lists-dashboard-link","component":"patientListDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"patient-lists","slot":"patient-lists-dashboard-slot","title":"Patient lists"}},{"component":"root","name":"patient-lists-dashboard","slot":"patient-lists-dashboard-slot"},{"name":"list-details-table","component":"listDetailsTable"},{"name":"add-patient-to-patient-list-modal","component":"addPatientToListModal"},{"name":"add-patient-to-patient-list-button","slot":"patient-actions-slot","component":"addPatientToPatientListMenuItem"}],"version":"
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"extensions":[{"name":"patient-lists-dashboard-link","component":"patientListDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"patient-lists","slot":"patient-lists-dashboard-slot","title":"Patient lists"}},{"component":"root","name":"patient-lists-dashboard","slot":"patient-lists-dashboard-slot"},{"name":"list-details-table","component":"listDetailsTable"},{"name":"add-patient-to-patient-list-modal","component":"addPatientToListModal"},{"name":"add-patient-to-patient-list-button","slot":"patient-actions-slot","component":"addPatientToPatientListMenuItem"}],"version":"8.0.1-pre.95"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenyaemr/esm-patient-list-management-app",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.1-pre.95",
|
|
4
4
|
"description": "Microfrontend for managing patient lists in O3",
|
|
5
5
|
"browser": "dist/kenyaemr-esm-patient-list-management-app.js",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"webpack": "^5.74.0"
|
|
54
54
|
},
|
|
55
|
-
"stableVersion": "
|
|
55
|
+
"stableVersion": "8.0.0"
|
|
56
56
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
2
3
|
|
|
3
4
|
.modalContent {
|
|
4
5
|
width: 100%;
|
|
@@ -6,11 +7,11 @@
|
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
.modalHeader {
|
|
9
|
-
margin:
|
|
10
|
+
margin: layout.$spacing-05;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
.patientListList {
|
|
13
|
-
padding: 0
|
|
14
|
+
padding: 0 layout.$spacing-05;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
.checkbox {
|
|
@@ -32,8 +33,8 @@
|
|
|
32
33
|
.itemsCountDisplay {
|
|
33
34
|
position: absolute;
|
|
34
35
|
top: 0;
|
|
35
|
-
left:
|
|
36
|
-
height:
|
|
36
|
+
left: layout.$spacing-05;
|
|
37
|
+
height: layout.$spacing-09;
|
|
37
38
|
display: flex;
|
|
38
39
|
align-items: center;
|
|
39
40
|
color: #525252;
|
|
@@ -49,3 +50,11 @@
|
|
|
49
50
|
justify-content: space-between;
|
|
50
51
|
align-items: flex-start;
|
|
51
52
|
}
|
|
53
|
+
|
|
54
|
+
.productiveHeading03 {
|
|
55
|
+
@include type.type-style('heading-03');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.bodyLong01 {
|
|
59
|
+
@include type.type-style('body-01');
|
|
60
|
+
}
|
|
@@ -2,13 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import { render, screen } from '@testing-library/react';
|
|
4
4
|
import { showModal } from '@openmrs/esm-framework';
|
|
5
|
+
import { mockPatient } from '__mocks__';
|
|
5
6
|
import AddPatientToPatientListMenuItem from './add-patient-to-patient-list-menu-item.component';
|
|
6
7
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
jest.mock('@openmrs/esm-framework');
|
|
10
|
-
|
|
11
|
-
const patientUuid = '6baa7963-68ea-497e-b258-6fb82382bd07';
|
|
8
|
+
const patientUuid = mockPatient.uuid;
|
|
9
|
+
const mockShowModal = jest.mocked(showModal);
|
|
12
10
|
|
|
13
11
|
describe('AddPatientToPatientListMenuItem', () => {
|
|
14
12
|
it('renders the button with the correct title', () => {
|
|
@@ -28,6 +26,6 @@ describe('AddPatientToPatientListMenuItem', () => {
|
|
|
28
26
|
|
|
29
27
|
await user.click(button);
|
|
30
28
|
|
|
31
|
-
expect(
|
|
29
|
+
expect(mockShowModal).toHaveBeenCalledWith('add-patient-to-patient-list-modal', expect.any(Object));
|
|
32
30
|
});
|
|
33
31
|
});
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@import '../style.scss';
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
4
3
|
|
|
5
4
|
.header {
|
|
6
5
|
@include type.type-style('heading-compact-02');
|
|
7
|
-
margin-bottom:
|
|
6
|
+
margin-bottom: layout.$spacing-05;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
.input {
|
|
11
|
-
margin-top:
|
|
10
|
+
margin-top: layout.$spacing-07;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
.button {
|
|
15
|
-
height:
|
|
14
|
+
height: layout.$spacing-10;
|
|
16
15
|
display: flex;
|
|
17
16
|
align-content: flex-start;
|
|
18
17
|
align-items: baseline;
|
|
@@ -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
|
.tile {
|
|
6
6
|
text-align: center;
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.illo {
|
|
11
|
-
margin-top:
|
|
11
|
+
margin-top: layout.$spacing-05;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.content {
|
|
15
15
|
@include type.type-style('heading-compact-01');
|
|
16
16
|
color: $text-02;
|
|
17
|
-
margin-top:
|
|
18
|
-
margin-bottom:
|
|
17
|
+
margin-top: layout.$spacing-05;
|
|
18
|
+
margin-bottom: layout.$spacing-03;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.actionText {
|
package/src/header/header.scss
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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
|
.patientListHeader {
|
|
6
6
|
@include type.type-style('body-compact-02');
|
|
7
7
|
color: $text-02;
|
|
8
|
-
height:
|
|
8
|
+
height: layout.$spacing-12;
|
|
9
9
|
display: flex;
|
|
10
10
|
justify-content: space-between;
|
|
11
11
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
color: $text-02;
|
|
24
|
-
padding:
|
|
24
|
+
padding: layout.$spacing-05 0;
|
|
25
25
|
justify-content: space-between;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
display: flex;
|
|
30
30
|
justify-content: flex-end;
|
|
31
31
|
align-items: center;
|
|
32
|
-
margin-right:
|
|
32
|
+
margin-right: layout.$spacing-05;
|
|
33
33
|
|
|
34
34
|
svg {
|
|
35
|
-
margin-right:
|
|
35
|
+
margin-right: layout.$spacing-03;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
.pageLabels {
|
|
44
44
|
p:first-of-type {
|
|
45
|
-
margin-bottom:
|
|
45
|
+
margin-bottom: layout.$spacing-02;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -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
|
.container {
|
|
6
6
|
display: flex;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
display: flex;
|
|
14
14
|
justify-content: space-between;
|
|
15
15
|
border-bottom: 1px solid $ui-03;
|
|
16
|
-
padding:
|
|
16
|
+
padding: layout.$spacing-04 layout.$spacing-05;
|
|
17
17
|
padding-right: 0;
|
|
18
18
|
background-color: $ui-01;
|
|
19
19
|
}
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
.overflowMenu {
|
|
22
22
|
display: flex;
|
|
23
23
|
align-items: flex-start;
|
|
24
|
-
margin-top:
|
|
24
|
+
margin-top: layout.$spacing-04;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.marginTop {
|
|
28
|
-
margin-top:
|
|
28
|
+
margin-top: layout.$spacing-03;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.menuItem {
|
|
@@ -38,10 +38,30 @@
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.tableContainer {
|
|
41
|
-
padding: 0
|
|
41
|
+
padding: 0 layout.$spacing-05 layout.$spacing-05;
|
|
42
42
|
height: calc(100vh - 11rem);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.menuItem {
|
|
46
46
|
max-width: none;
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
.productiveHeading03 {
|
|
50
|
+
@include type.type-style('heading-03');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.bodyShort01 {
|
|
54
|
+
@include type.type-style('body-compact-01');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.bodyShort02 {
|
|
58
|
+
@include type.type-style('body-compact-02');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.text02 {
|
|
62
|
+
color: $text-02;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.label01 {
|
|
66
|
+
@include type.type-style('label-01');
|
|
67
|
+
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import userEvent from '@testing-library/user-event';
|
|
4
|
+
import type { OpenmrsCohortMember, OpenmrsCohort } from '../api/types';
|
|
4
5
|
import { usePatientListDetails, usePatientListMembers } from '../api/hooks';
|
|
5
6
|
import { deletePatientList } from '../api/api-remote';
|
|
6
7
|
import { getByTextWithMarkup } from 'tools';
|
|
7
8
|
import ListDetails from './list-details.component';
|
|
8
9
|
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const mockUsePatientListDetails = jest.mocked(usePatientListDetails);
|
|
11
|
+
const mockUsePatientListMembers = jest.mocked(usePatientListMembers);
|
|
12
|
+
const mockDeletePatientList = jest.mocked(deletePatientList);
|
|
12
13
|
|
|
13
14
|
jest.mock('../api/hooks', () => ({
|
|
14
15
|
usePatientListDetails: jest.fn(),
|
|
@@ -17,22 +18,18 @@ jest.mock('../api/hooks', () => ({
|
|
|
17
18
|
|
|
18
19
|
jest.mock('../api/api-remote');
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
...jest.requireActual('@openmrs/esm-framework'),
|
|
22
|
-
showSnackbar: jest.fn(),
|
|
23
|
-
navigate: jest.fn(),
|
|
24
|
-
ExtensionSlot: jest.fn(),
|
|
25
|
-
}));
|
|
26
|
-
|
|
27
|
-
const mockedPatientListDetails = {
|
|
21
|
+
const mockPatientListDetails = {
|
|
28
22
|
name: 'Test Patient List',
|
|
29
23
|
description: 'This is a test patient list',
|
|
30
24
|
size: 1,
|
|
31
25
|
startDate: '2023-08-14',
|
|
32
|
-
};
|
|
26
|
+
} as OpenmrsCohort;
|
|
33
27
|
|
|
34
|
-
const
|
|
28
|
+
const mockPatientListMembers = [
|
|
35
29
|
{
|
|
30
|
+
name: 'MINDSCAPE Cohort',
|
|
31
|
+
description:
|
|
32
|
+
'Mental Illness and Neuroimaging Study for Personalized Assessment and Care Evaluation (develops personalized treatment plans for mental illness based on brain imaging and individual factors)',
|
|
36
33
|
patient: {
|
|
37
34
|
person: {
|
|
38
35
|
display: 'John Doe',
|
|
@@ -45,22 +42,31 @@ const mockedPatientListMembers = [
|
|
|
45
42
|
],
|
|
46
43
|
uuid: '7cd38a6d-377e-491b-8284-b04cf8b8c6d8',
|
|
47
44
|
},
|
|
45
|
+
attributes: [],
|
|
46
|
+
endDate: null,
|
|
48
47
|
startDate: '2023-08-10',
|
|
49
48
|
uuid: 'ce7d26fa-e1b4-4e78-a1f5-3a7a5de9c0db',
|
|
49
|
+
voided: false,
|
|
50
50
|
},
|
|
51
|
-
];
|
|
51
|
+
] as OpenmrsCohortMember[];
|
|
52
52
|
|
|
53
53
|
describe('ListDetails', () => {
|
|
54
54
|
beforeEach(() => {
|
|
55
|
-
|
|
56
|
-
listDetails:
|
|
55
|
+
mockUsePatientListDetails.mockReturnValue({
|
|
56
|
+
listDetails: mockPatientListDetails,
|
|
57
|
+
error: null,
|
|
58
|
+
isLoading: false,
|
|
59
|
+
mutateListDetails: jest.fn().mockResolvedValue({}),
|
|
57
60
|
});
|
|
58
61
|
|
|
59
|
-
|
|
60
|
-
listMembers:
|
|
62
|
+
mockUsePatientListMembers.mockReturnValue({
|
|
63
|
+
listMembers: mockPatientListMembers,
|
|
64
|
+
isLoadingListMembers: false,
|
|
65
|
+
error: null,
|
|
66
|
+
mutateListMembers: jest.fn().mockResolvedValue({}),
|
|
61
67
|
});
|
|
62
68
|
|
|
63
|
-
|
|
69
|
+
mockDeletePatientList.mockResolvedValue({});
|
|
64
70
|
});
|
|
65
71
|
|
|
66
72
|
it('renders patient list details page', async () => {
|
|
@@ -77,8 +83,11 @@ describe('ListDetails', () => {
|
|
|
77
83
|
});
|
|
78
84
|
|
|
79
85
|
it('renders an empty state view if a list has no patients', async () => {
|
|
80
|
-
|
|
86
|
+
mockUsePatientListMembers.mockReturnValue({
|
|
81
87
|
listMembers: [],
|
|
88
|
+
isLoadingListMembers: false,
|
|
89
|
+
error: null,
|
|
90
|
+
mutateListMembers: jest.fn().mockResolvedValue({}),
|
|
82
91
|
});
|
|
83
92
|
|
|
84
93
|
render(<ListDetails />);
|
|
@@ -87,12 +96,12 @@ describe('ListDetails', () => {
|
|
|
87
96
|
expect(screen.getByText(/there are no patients in this list/i)).toBeInTheDocument();
|
|
88
97
|
});
|
|
89
98
|
|
|
90
|
-
it('opens overlay with a form when the "Edit name or description" button is clicked', () => {
|
|
99
|
+
it('opens overlay with a form when the "Edit name or description" button is clicked', async () => {
|
|
91
100
|
render(<ListDetails />);
|
|
92
101
|
|
|
93
|
-
userEvent.click(screen.getByText('Actions'));
|
|
102
|
+
await userEvent.click(screen.getByText('Actions'));
|
|
94
103
|
const editBtn = screen.getByText('Edit name or description');
|
|
95
|
-
userEvent.click(editBtn);
|
|
104
|
+
await userEvent.click(editBtn);
|
|
96
105
|
});
|
|
97
106
|
|
|
98
107
|
it('deletes patient list and navigates back to the list page', async () => {
|
|
@@ -105,7 +114,8 @@ describe('ListDetails', () => {
|
|
|
105
114
|
expect(screen.getByText('Delete')).toBeInTheDocument();
|
|
106
115
|
expect(screen.getByText('Cancel')).toBeInTheDocument();
|
|
107
116
|
|
|
108
|
-
|
|
117
|
+
// eslint-disable-next-line testing-library/no-node-access
|
|
118
|
+
expect(screen.getByText('Delete').closest('button')).toBeEnabled();
|
|
109
119
|
|
|
110
120
|
await userEvent.click(screen.getByText('Cancel'));
|
|
111
121
|
});
|
|
@@ -388,7 +388,7 @@ const ListDetailsTable: React.FC<ListDetailsTableProps> = ({
|
|
|
388
388
|
<>
|
|
389
389
|
<BackButton />
|
|
390
390
|
<Layer>
|
|
391
|
-
<Tile className={styles.tile}>
|
|
391
|
+
<Tile className={styles.tile} data-openmrs-role="Patient Empty tile">
|
|
392
392
|
<div className={styles.illo}>
|
|
393
393
|
<EmptyDataIllustration />
|
|
394
394
|
</div>
|
|
@@ -1,11 +1,11 @@
|
|
|
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
|
.searchContainer {
|
|
6
6
|
display: grid;
|
|
7
7
|
grid-template-columns: 1fr 1fr;
|
|
8
|
-
margin-top:
|
|
8
|
+
margin-top: layout.$spacing-05;
|
|
9
9
|
background-color: #ededed;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
.searchOverrides {
|
|
18
18
|
width: 100%;
|
|
19
|
-
max-width:
|
|
19
|
+
max-width: 15.625rem;
|
|
20
20
|
border: 0px !important;
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -29,7 +29,7 @@ div.tableOverride > div {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
div#table-tool-bar {
|
|
32
|
-
margin-top:
|
|
32
|
+
margin-top: layout.$spacing-09;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.table {
|
|
@@ -38,12 +38,12 @@ div#table-tool-bar {
|
|
|
38
38
|
|
|
39
39
|
.desktopRow,
|
|
40
40
|
.desktopHeader {
|
|
41
|
-
height:
|
|
41
|
+
height: layout.$spacing-07 !important;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.tabletRow,
|
|
45
45
|
.tabletHeader {
|
|
46
|
-
height:
|
|
46
|
+
height: layout.$spacing-09 !important;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.paginationOverride {
|
|
@@ -65,32 +65,32 @@ div#table-tool-bar {
|
|
|
65
65
|
|
|
66
66
|
.dataTableSkeleton {
|
|
67
67
|
background-color: transparent;
|
|
68
|
-
padding:
|
|
68
|
+
padding: 0;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
.skeletonContainer {
|
|
72
|
-
margin:
|
|
72
|
+
margin: layout.$spacing-05;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.tile {
|
|
76
76
|
text-align: center;
|
|
77
77
|
border: 1px solid $ui-03;
|
|
78
|
-
margin:
|
|
78
|
+
margin: layout.$spacing-05 0;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
.illo {
|
|
82
|
-
margin-top:
|
|
82
|
+
margin-top: layout.$spacing-05;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
.content {
|
|
86
86
|
@include type.type-style('heading-compact-01');
|
|
87
87
|
color: $text-02;
|
|
88
|
-
margin-top:
|
|
89
|
-
margin-bottom:
|
|
88
|
+
margin-top: layout.$spacing-05;
|
|
89
|
+
margin-bottom: layout.$spacing-03;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
.backButton {
|
|
93
|
-
padding:
|
|
93
|
+
padding: layout.$spacing-03 0;
|
|
94
94
|
max-width: fit-content;
|
|
95
95
|
|
|
96
96
|
a {
|
|
@@ -103,7 +103,7 @@ div#table-tool-bar {
|
|
|
103
103
|
|
|
104
104
|
svg {
|
|
105
105
|
order: 1;
|
|
106
|
-
margin: 0
|
|
106
|
+
margin: 0 layout.$spacing-03;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
span {
|
|
@@ -121,7 +121,7 @@ div#table-tool-bar {
|
|
|
121
121
|
display: flex;
|
|
122
122
|
justify-content: center;
|
|
123
123
|
align-items: center;
|
|
124
|
-
padding:
|
|
124
|
+
padding: layout.$spacing-09 !important;
|
|
125
125
|
text-align: center;
|
|
126
126
|
border: 1px solid $ui-03;
|
|
127
127
|
background-color: white;
|
|
@@ -134,7 +134,7 @@ div#table-tool-bar {
|
|
|
134
134
|
.filterEmptyStateContent {
|
|
135
135
|
@include type.type-style('heading-compact-02');
|
|
136
136
|
color: $text-02;
|
|
137
|
-
margin-bottom:
|
|
137
|
+
margin-bottom: layout.$spacing-03;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
.filterEmptyStateHelper {
|
|
@@ -2,12 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import ListDetailsTable from './list-details-table.component';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
...jest.requireActual('@openmrs/esm-framework'),
|
|
7
|
-
isDesktop: jest.fn(() => true),
|
|
8
|
-
}));
|
|
9
|
-
|
|
10
|
-
describe('ListDetailsTable Component', () => {
|
|
5
|
+
describe('ListDetailsTable', () => {
|
|
11
6
|
const patients = [
|
|
12
7
|
{
|
|
13
8
|
identifier: '123abced',
|
|
@@ -48,12 +43,12 @@ describe('ListDetailsTable Component', () => {
|
|
|
48
43
|
},
|
|
49
44
|
];
|
|
50
45
|
|
|
51
|
-
const
|
|
46
|
+
const mockOnChange = jest.fn();
|
|
52
47
|
|
|
53
48
|
let pagination = {
|
|
54
49
|
usePagination: true,
|
|
55
50
|
currentPage: 1,
|
|
56
|
-
onChange:
|
|
51
|
+
onChange: mockOnChange,
|
|
57
52
|
pageSize: 10,
|
|
58
53
|
totalItems: 100,
|
|
59
54
|
pagesUnknown: false,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@use '@
|
|
4
|
-
@import '../style.scss';
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
5
4
|
|
|
6
5
|
.container {
|
|
7
|
-
margin:
|
|
6
|
+
margin: layout.$spacing-05 0;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
.dashboardContainer {
|
|
@@ -16,7 +15,7 @@
|
|
|
16
15
|
height: 100%;
|
|
17
16
|
width: 100%;
|
|
18
17
|
background-color: $ui-02;
|
|
19
|
-
height: calc(100vh -
|
|
18
|
+
height: calc(100vh - layout.$spacing-09);
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
.tabs {
|
|
@@ -24,7 +23,7 @@
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
.tablist {
|
|
27
|
-
padding: 0
|
|
26
|
+
padding: 0 layout.$spacing-05;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
.tab {
|
|
@@ -46,7 +45,7 @@
|
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
.listsTableContainer {
|
|
49
|
-
padding:
|
|
48
|
+
padding: layout.$spacing-05;
|
|
50
49
|
background-color: $ui-01;
|
|
51
50
|
height: calc(100vh - 12rem);
|
|
52
51
|
}
|
|
@@ -62,12 +61,12 @@
|
|
|
62
61
|
|
|
63
62
|
.desktopRow,
|
|
64
63
|
.desktopHeader {
|
|
65
|
-
height:
|
|
64
|
+
height: layout.$spacing-07 !important;
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
.tabletRow,
|
|
69
68
|
.tabletHeader {
|
|
70
|
-
height:
|
|
69
|
+
height: layout.$spacing-09 !important;
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
// Search Overlay
|
|
@@ -84,7 +83,7 @@
|
|
|
84
83
|
grid-row: 2 / 4;
|
|
85
84
|
grid-column: 1 / 2;
|
|
86
85
|
background-color: $ui-01;
|
|
87
|
-
padding:
|
|
86
|
+
padding: layout.$spacing-05;
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
// Results Overlay
|
|
@@ -93,11 +92,11 @@
|
|
|
93
92
|
@include type.type-style('body-compact-01');
|
|
94
93
|
color: $text-02;
|
|
95
94
|
border-bottom: solid 1px #e0e0e0;
|
|
96
|
-
padding:
|
|
95
|
+
padding: layout.$spacing-04 0;
|
|
97
96
|
}
|
|
98
97
|
|
|
99
98
|
.patientListResultsTableContainer {
|
|
100
|
-
margin:
|
|
99
|
+
margin: layout.$spacing-03;
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
.starButton {
|
|
@@ -2,13 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import { render, screen } from '@testing-library/react';
|
|
4
4
|
import { useLocation } from 'react-router-dom';
|
|
5
|
-
import { openmrsFetch, restBaseUrl, useSession } from '@openmrs/esm-framework';
|
|
5
|
+
import { type FetchResponse, openmrsFetch, restBaseUrl, useSession } from '@openmrs/esm-framework';
|
|
6
6
|
import { mockSession } from '__mocks__';
|
|
7
7
|
import ListsDashboard from './lists-dashboard.component';
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
9
|
+
const mockOpenmrsFetch = jest.mocked(openmrsFetch);
|
|
10
|
+
const mockUseLocation = jest.mocked(useLocation);
|
|
11
|
+
const mockUseSession = jest.mocked(useSession);
|
|
12
12
|
|
|
13
13
|
jest.mock('react-router-dom', () => ({
|
|
14
14
|
...jest.requireActual('react-router-dom'),
|
|
@@ -17,7 +17,7 @@ jest.mock('react-router-dom', () => ({
|
|
|
17
17
|
|
|
18
18
|
describe('ListsDashboard', () => {
|
|
19
19
|
beforeEach(() => {
|
|
20
|
-
|
|
20
|
+
mockUseLocation.mockReturnValue({
|
|
21
21
|
pathname: '/',
|
|
22
22
|
search: '',
|
|
23
23
|
hash: '',
|
|
@@ -25,9 +25,9 @@ describe('ListsDashboard', () => {
|
|
|
25
25
|
key: 'default',
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
mockUseSession.mockReturnValue(mockSession.data);
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
mockOpenmrsFetch.mockResolvedValue({
|
|
31
31
|
data: {
|
|
32
32
|
results: [
|
|
33
33
|
{
|
|
@@ -86,7 +86,7 @@ describe('ListsDashboard', () => {
|
|
|
86
86
|
},
|
|
87
87
|
],
|
|
88
88
|
},
|
|
89
|
-
});
|
|
89
|
+
} as unknown as FetchResponse);
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
it('renders the patient list page UI correctly', async () => {
|