@kenyaemr/esm-patient-list-management-app 7.0.3-pre.89 → 8.0.0
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/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 -3
- 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
|
@@ -13,37 +13,37 @@
|
|
|
13
13
|
justify-content: space-between;
|
|
14
14
|
color: colors.$gray-70;
|
|
15
15
|
background-color: colors.$white-0;
|
|
16
|
-
padding-left:
|
|
16
|
+
padding-left: layout.$spacing-05;
|
|
17
17
|
align-items: center;
|
|
18
18
|
border: 1px solid colors.$gray-20;
|
|
19
19
|
border-top: none;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.desktop :global(.cds--pagination) {
|
|
23
|
-
min-height:
|
|
24
|
-
height:
|
|
23
|
+
min-height: 0;
|
|
24
|
+
height: layout.$spacing-07;
|
|
25
25
|
width: auto;
|
|
26
26
|
border: none;
|
|
27
27
|
|
|
28
28
|
& :global(.cds--select-input),
|
|
29
29
|
:global(.cds--btn),
|
|
30
30
|
:global(.cds--pagination__right) {
|
|
31
|
-
min-height:
|
|
32
|
-
height:
|
|
31
|
+
min-height: 0;
|
|
32
|
+
height: layout.$spacing-07;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.tablet :global(.cds--pagination) {
|
|
37
|
-
min-height:
|
|
38
|
-
height:
|
|
37
|
+
min-height: 0;
|
|
38
|
+
height: layout.$spacing-09;
|
|
39
39
|
width: auto;
|
|
40
40
|
border: none;
|
|
41
41
|
|
|
42
42
|
& :global(.cds--select-input),
|
|
43
43
|
:global(.cds--btn),
|
|
44
44
|
:global(.cds--pagination__right) {
|
|
45
|
-
min-height:
|
|
46
|
-
height:
|
|
45
|
+
min-height: 0;
|
|
46
|
+
height: layout.$spacing-09;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -121,7 +121,7 @@ const ListsTable: React.FC<PatientListTableProps> = ({
|
|
|
121
121
|
rowCount={pageSize}
|
|
122
122
|
showHeader={false}
|
|
123
123
|
showToolbar={false}
|
|
124
|
-
style={{ ...style, backgroundColor: 'transparent', padding: '
|
|
124
|
+
style={{ ...style, backgroundColor: 'transparent', padding: '0' }}
|
|
125
125
|
zebra
|
|
126
126
|
/>
|
|
127
127
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@use '@carbon/colors';
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@use '@carbon/
|
|
4
|
-
@
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
4
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
5
5
|
|
|
6
6
|
.table {
|
|
7
7
|
tr {
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
|
|
21
21
|
.desktopRow,
|
|
22
22
|
.desktopHeader {
|
|
23
|
-
height:
|
|
23
|
+
height: layout.$spacing-07 !important;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.tabletRow,
|
|
27
27
|
.tabletHeader {
|
|
28
|
-
height:
|
|
28
|
+
height: layout.$spacing-09 !important;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.tableBody {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
display: flex;
|
|
60
60
|
justify-content: center;
|
|
61
61
|
align-items: center;
|
|
62
|
-
padding:
|
|
62
|
+
padding: layout.$spacing-09;
|
|
63
63
|
text-align: center;
|
|
64
64
|
border: 1px solid $ui-03;
|
|
65
65
|
background-color: white;
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
.filterEmptyStateContent {
|
|
73
73
|
@include type.type-style('heading-compact-02');
|
|
74
74
|
color: $text-02;
|
|
75
|
-
margin-bottom:
|
|
75
|
+
margin-bottom: layout.$spacing-03;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.filterEmptyStateHelper {
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import { render, screen, within } from '@testing-library/react';
|
|
4
|
-
import { useSession } from '@openmrs/esm-framework';
|
|
5
|
-
import { mockSession } from '__mocks__';
|
|
4
|
+
import { getDefaultsFromConfigSchema, useConfig, useSession } from '@openmrs/esm-framework';
|
|
6
5
|
import type { PatientList } from '../api/types';
|
|
6
|
+
import { type ConfigSchema, configSchema } from '../config-schema';
|
|
7
|
+
import { mockSession } from '__mocks__';
|
|
7
8
|
import ListsTable from './lists-table.component';
|
|
8
9
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
jest.mock('@openmrs/esm-framework', () => ({
|
|
12
|
-
...jest.requireActual('@openmrs/esm-framework'),
|
|
13
|
-
useConfig: jest.fn(() => ({
|
|
14
|
-
patientListsToShow: 10,
|
|
15
|
-
})),
|
|
16
|
-
isDesktop: jest.fn(() => true),
|
|
17
|
-
}));
|
|
10
|
+
const mockUseSession = jest.mocked(useSession);
|
|
11
|
+
const mockUseConfig = jest.mocked(useConfig<ConfigSchema>);
|
|
18
12
|
|
|
19
13
|
const tableHeaders = [
|
|
20
14
|
{ header: 'List name', key: '1' },
|
|
@@ -75,7 +69,13 @@ const patientLists: Array<PatientList> = [
|
|
|
75
69
|
];
|
|
76
70
|
|
|
77
71
|
describe('ListsTable', () => {
|
|
78
|
-
beforeEach(() =>
|
|
72
|
+
beforeEach(() => {
|
|
73
|
+
mockUseSession.mockReturnValue(mockSession.data);
|
|
74
|
+
mockUseConfig.mockReturnValue({
|
|
75
|
+
...getDefaultsFromConfigSchema(configSchema),
|
|
76
|
+
patientListsToShow: 10,
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
79
|
|
|
80
80
|
it('renders a loading state when patient list data is getting fetched', () => {
|
|
81
81
|
render(<ListsTable error={null} headers={tableHeaders} isLoading listType={'My lists'} patientLists={[]} />);
|
|
@@ -15,7 +15,9 @@ const Overlay: React.FC<OverlayProps> = ({ buttonsGroup, children, close, header
|
|
|
15
15
|
const layout = useLayoutType();
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
|
-
<div
|
|
18
|
+
<div
|
|
19
|
+
className={isDesktop(layout) ? styles.desktopOverlay : styles.tabletOverlay}
|
|
20
|
+
data-openmrs-role="Patient List Form">
|
|
19
21
|
{isDesktop(layout) ? (
|
|
20
22
|
<div className={styles.desktopHeader}>
|
|
21
23
|
<span className={styles.headerContent}>{header}</span>
|
package/src/overlay.scss
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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
|
.desktopOverlay {
|
|
6
6
|
position: fixed;
|
|
7
7
|
right: 0;
|
|
8
8
|
width: 37rem;
|
|
9
|
-
top:
|
|
10
|
-
height: calc(100vh -
|
|
9
|
+
top: layout.$spacing-09;
|
|
10
|
+
height: calc(100vh - layout.$spacing-09);
|
|
11
11
|
min-width: 27rem;
|
|
12
12
|
background-color: $ui-01;
|
|
13
13
|
border-left: 1px solid $text-03;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
z-index: 9999;
|
|
28
28
|
background-color: $ui-01;
|
|
29
29
|
overflow: hidden;
|
|
30
|
-
padding-top:
|
|
30
|
+
padding-top: layout.$spacing-09;
|
|
31
31
|
display: grid;
|
|
32
32
|
grid-template-rows: 1fr auto;
|
|
33
33
|
}
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
align-items: center;
|
|
48
48
|
background-color: $ui-03;
|
|
49
49
|
border-bottom: 1px solid $text-03;
|
|
50
|
-
height:
|
|
50
|
+
height: layout.$spacing-09;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.headerContent {
|
|
54
54
|
@include type.type-style('heading-compact-02');
|
|
55
|
-
padding: 0
|
|
55
|
+
padding: 0 layout.$spacing-05;
|
|
56
56
|
color: $ui-05;
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.overlayContent {
|
|
66
|
-
padding:
|
|
66
|
+
padding: layout.$spacing-05;
|
|
67
67
|
overflow-y: auto;
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -84,6 +84,6 @@
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
:global(.omrs-breakpoint-lt-desktop) .buttonsGroup {
|
|
87
|
-
padding:
|
|
87
|
+
padding: layout.$spacing-06 layout.$spacing-05;
|
|
88
88
|
background-color: $ui-02;
|
|
89
89
|
}
|
package/src/overlay.test.tsx
CHANGED
|
@@ -4,57 +4,49 @@ import { render, screen } from '@testing-library/react';
|
|
|
4
4
|
import { useLayoutType, isDesktop } from '@openmrs/esm-framework';
|
|
5
5
|
import Overlay from './overlay.component';
|
|
6
6
|
|
|
7
|
-
const mockUseLayoutType =
|
|
8
|
-
const mockIsDesktop =
|
|
9
|
-
|
|
10
|
-
jest.mock('@openmrs/esm-framework');
|
|
7
|
+
const mockUseLayoutType = jest.mocked(useLayoutType);
|
|
8
|
+
const mockIsDesktop = jest.mocked(isDesktop);
|
|
9
|
+
const mockClose = jest.fn();
|
|
11
10
|
|
|
12
11
|
describe('Overlay', () => {
|
|
13
12
|
it('renders the desktop version of the overlay', () => {
|
|
14
|
-
mockUseLayoutType.
|
|
13
|
+
mockUseLayoutType.mockReturnValue('small-desktop');
|
|
14
|
+
|
|
15
15
|
render(
|
|
16
|
-
<Overlay close={
|
|
16
|
+
<Overlay close={mockClose} header="Test Header">
|
|
17
17
|
Overlay content
|
|
18
18
|
</Overlay>,
|
|
19
19
|
);
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
expect(headerContent).toBeInTheDocument();
|
|
25
|
-
expect(closeButton).toBeInTheDocument();
|
|
21
|
+
expect(screen.getByText('Test Header')).toBeInTheDocument();
|
|
22
|
+
expect(screen.getByRole('button', { name: 'Close overlay' })).toBeInTheDocument();
|
|
26
23
|
});
|
|
27
24
|
|
|
28
25
|
it('renders the tablet version of the overlay', () => {
|
|
29
|
-
mockUseLayoutType.
|
|
30
|
-
mockIsDesktop.
|
|
26
|
+
mockUseLayoutType.mockReturnValue('tablet');
|
|
27
|
+
mockIsDesktop.mockReturnValue(false);
|
|
28
|
+
|
|
31
29
|
render(
|
|
32
|
-
<Overlay close={
|
|
30
|
+
<Overlay close={mockClose} header="Test Header">
|
|
33
31
|
Overlay content
|
|
34
32
|
</Overlay>,
|
|
35
33
|
);
|
|
36
34
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
expect(headerContent).toBeInTheDocument();
|
|
41
|
-
expect(backButton).toBeInTheDocument();
|
|
35
|
+
expect(screen.getByText('Test Header')).toBeInTheDocument();
|
|
36
|
+
expect(screen.getByRole('button', { name: 'Close overlay' })).toBeInTheDocument();
|
|
42
37
|
});
|
|
43
38
|
|
|
44
39
|
it('calls the close function when close button is clicked', async () => {
|
|
45
40
|
const user = userEvent.setup();
|
|
46
|
-
|
|
41
|
+
mockUseLayoutType.mockReturnValue('small-desktop');
|
|
47
42
|
|
|
48
|
-
mockUseLayoutType.mockImplementation(() => 'desktop');
|
|
49
43
|
render(
|
|
50
44
|
<Overlay close={mockClose} header="Test Header">
|
|
51
45
|
Overlay content
|
|
52
46
|
</Overlay>,
|
|
53
47
|
);
|
|
54
48
|
|
|
55
|
-
|
|
56
|
-
await user.click(closeButton);
|
|
57
|
-
|
|
49
|
+
await user.click(screen.getByRole('button', { name: 'Close overlay' }));
|
|
58
50
|
expect(mockClose).toHaveBeenCalled();
|
|
59
51
|
});
|
|
60
52
|
});
|
package/translations/fr.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"actions": "Actions",
|
|
3
3
|
"addPatientToList": "Ajouter le patient à la liste",
|
|
4
4
|
"addToList": "Ajouter à la liste",
|
|
5
|
-
"allLists": "
|
|
6
|
-
"backToListsPage": "
|
|
7
|
-
"cancel": "
|
|
5
|
+
"allLists": "Toutes les listes",
|
|
6
|
+
"backToListsPage": "Retour sur la page des listes",
|
|
7
|
+
"cancel": "Annuler",
|
|
8
8
|
"checkFilters": "Check the filters above",
|
|
9
9
|
"configureList": "Configurez votre liste de patients à l'aide des champs ci-dessous",
|
|
10
10
|
"confirmDeletePatientList": "Are you sure you want to delete this patient list?",
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
"editPatientListHeader": "Modifier la liste des patients",
|
|
22
22
|
"emptyList": "This list has no patients",
|
|
23
23
|
"emptyStateIllustration": "Empty state illustration",
|
|
24
|
-
"emptyStateText": "
|
|
24
|
+
"emptyStateText": "Il n'y a pas de liste de patient {{listType}} à afficher",
|
|
25
25
|
"error": "Erreur",
|
|
26
26
|
"errorAddPatientToList": "Patient non ajouté à la liste",
|
|
27
|
-
"errorCopy": "
|
|
27
|
+
"errorCopy": "Désolé, une erreur s’est produite à l’affichage. Vous pouvez tenter de rafraîchir la page, ou bien contacter l'administrateur du site et transmettre le message d'erreur ci-dessus.",
|
|
28
28
|
"errorCreatingList": "Error creating list",
|
|
29
29
|
"errorDeletingList": "Error deleting patient list",
|
|
30
30
|
"errorRemovingPatientFromList": "Failed to remove patient from list",
|
|
31
31
|
"errorUpdatingList": "Error updating list",
|
|
32
|
-
"home": "
|
|
32
|
+
"home": "Accueil",
|
|
33
33
|
"identifier": "Identifiant",
|
|
34
|
-
"items": "
|
|
35
|
-
"itemsDisplayed": "{{numberOfItemsDisplayed}}
|
|
34
|
+
"items": "eléments",
|
|
35
|
+
"itemsDisplayed": "{{numberOfItemsDisplayed}} eléments",
|
|
36
36
|
"listCreated": "List created successfully",
|
|
37
37
|
"listDescriptionPlaceholder": "par ex. Les patients atteints d'asthme diagnostiqué qui peuvent être disposés à faire partie d'une étude de recherche universitaire",
|
|
38
38
|
"listName": "List name",
|
|
@@ -40,18 +40,18 @@
|
|
|
40
40
|
"listType": "List type",
|
|
41
41
|
"listUpdated": "List updated successfully",
|
|
42
42
|
"listUpToDate": "The list is now up to date",
|
|
43
|
-
"myLists": "
|
|
43
|
+
"myLists": "Mes listes",
|
|
44
44
|
"name": "Nom",
|
|
45
45
|
"newList": "Nouvelle liste",
|
|
46
46
|
"newPatientListDescriptionLabel": "Décrivez le but de cette liste en quelques mots",
|
|
47
47
|
"newPatientListHeader": "Nouvelle liste de patients",
|
|
48
48
|
"newPatientListNameLabel": "Nom de la liste",
|
|
49
|
-
"nextPage": "
|
|
50
|
-
"noMatchingLists": "
|
|
49
|
+
"nextPage": "Page suivante",
|
|
50
|
+
"noMatchingLists": "Aucun liste à afficher",
|
|
51
51
|
"noMatchingPatients": "No matching patients to display",
|
|
52
52
|
"noOfPatients": "No. of patients",
|
|
53
53
|
"noPatientListFound": "Aucune liste de patients trouvée",
|
|
54
|
-
"noPatientsInList": "
|
|
54
|
+
"noPatientsInList": "Il n'y a pas de patient dans cette liste",
|
|
55
55
|
"offlinePatients": "Patients hors ligne",
|
|
56
56
|
"openPatientList": "Ajouter à la liste",
|
|
57
57
|
"patientListMemberCount_one": "This list has {{count}} patient",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"patientLists": "Listes de patients",
|
|
60
60
|
"patientRemovedFromList": "Patient removed from list",
|
|
61
61
|
"patients": "Patients",
|
|
62
|
-
"previousPage": "
|
|
62
|
+
"previousPage": "Page précédente",
|
|
63
63
|
"problemCreatingList": "There was a problem creating the list",
|
|
64
64
|
"problemUpdatingList": "There was a problem updating the list",
|
|
65
65
|
"removeFromList": "Remove from list",
|
|
@@ -68,17 +68,17 @@
|
|
|
68
68
|
"searchForList": "Rechercher une liste",
|
|
69
69
|
"searchThisList": "Search this list",
|
|
70
70
|
"sex": "Sexe",
|
|
71
|
-
"starList": "
|
|
72
|
-
"starred": "
|
|
73
|
-
"starredLists": "
|
|
74
|
-
"starringPatientListFailed": "
|
|
71
|
+
"starList": "Mettre en favori",
|
|
72
|
+
"starred": "favori",
|
|
73
|
+
"starredLists": "Listes de favoris",
|
|
74
|
+
"starringPatientListFailed": "Marquage des listes de patients comme favoris/non favoris échec du marquage",
|
|
75
75
|
"startDate": "Date de début",
|
|
76
76
|
"submitting": "Submitting",
|
|
77
77
|
"successAddPatientToList": "Patient ajouté à la liste",
|
|
78
78
|
"successfullyAdded": "Ajouté avec succès",
|
|
79
79
|
"systemDefined": "system-defined",
|
|
80
|
-
"systemLists": "
|
|
81
|
-
"unstarList": "
|
|
80
|
+
"systemLists": "Listes systemes",
|
|
81
|
+
"unstarList": "Enlever comme favori",
|
|
82
82
|
"updated": "Updated",
|
|
83
83
|
"userDefined": "user-defined"
|
|
84
84
|
}
|