@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.
Files changed (48) hide show
  1. package/.turbo/turbo-build.log +18 -17
  2. package/dist/112.js +1 -0
  3. package/dist/112.js.map +1 -0
  4. package/dist/130.js +1 -1
  5. package/dist/130.js.map +1 -1
  6. package/dist/271.js +2 -1
  7. package/dist/271.js.map +1 -0
  8. package/dist/37.js +1 -0
  9. package/dist/37.js.map +1 -0
  10. package/dist/384.js +1 -0
  11. package/dist/757.js +1 -1
  12. package/dist/kenyaemr-esm-patient-list-management-app.js +1 -1
  13. package/dist/kenyaemr-esm-patient-list-management-app.js.buildmanifest.json +78 -78
  14. package/dist/main.js +1 -1
  15. package/dist/main.js.map +1 -1
  16. package/dist/routes.json +1 -1
  17. package/package.json +2 -3
  18. package/src/add-patient/add-patient.scss +14 -5
  19. package/src/add-patient-to-patient-list-menu-item.test.tsx +4 -6
  20. package/src/create-edit-patient-list/create-edit-patient-list.scss +5 -6
  21. package/src/empty-state/empty-state.scss +6 -6
  22. package/src/error-state/error-state.scss +1 -1
  23. package/src/header/header.component.tsx +1 -0
  24. package/src/header/header.scss +8 -8
  25. package/src/list-details/list-details.scss +27 -7
  26. package/src/list-details/list-details.test.tsx +34 -24
  27. package/src/list-details-table/list-details-table.component.tsx +1 -1
  28. package/src/list-details-table/list-details-table.scss +18 -18
  29. package/src/list-details-table/list-details-table.test.tsx +3 -8
  30. package/src/lists-dashboard/lists-dashboard.scss +12 -13
  31. package/src/lists-dashboard/lists-dashboard.test.tsx +8 -8
  32. package/src/lists-table/custom-pagination.scss +9 -9
  33. package/src/lists-table/lists-table.component.tsx +1 -1
  34. package/src/lists-table/lists-table.scss +7 -7
  35. package/src/lists-table/lists-table.test.tsx +12 -12
  36. package/src/overlay.component.tsx +3 -1
  37. package/src/overlay.scss +10 -10
  38. package/src/overlay.test.tsx +16 -24
  39. package/translations/fr.json +19 -19
  40. package/dist/139.js +0 -1
  41. package/dist/139.js.map +0 -1
  42. package/dist/548.js +0 -1
  43. package/dist/548.js.map +0 -1
  44. package/dist/930.js +0 -2
  45. package/dist/930.js.map +0 -1
  46. package/src/list-details/patient-list-detail.test.tsx +0 -105
  47. package/src/style.scss +0 -46
  48. /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: 1rem;
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: 0rem;
24
- height: 2rem;
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: 0rem;
32
- height: 2rem;
31
+ min-height: 0;
32
+ height: layout.$spacing-07;
33
33
  }
34
34
  }
35
35
 
36
36
  .tablet :global(.cds--pagination) {
37
- min-height: 0rem;
38
- height: 3rem;
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: 0rem;
46
- height: 3rem;
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: '0rem' }}
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/styles/scss/spacing';
3
- @use '@carbon/styles/scss/type';
4
- @import '../style.scss';
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: spacing.$spacing-07 !important;
23
+ height: layout.$spacing-07 !important;
24
24
  }
25
25
 
26
26
  .tabletRow,
27
27
  .tabletHeader {
28
- height: spacing.$spacing-09 !important;
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: spacing.$spacing-09;
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: 0.5rem;
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 mockedUseSession = jest.mocked(useSession);
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(() => mockedUseSession.mockReturnValue(mockSession.data));
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 className={isDesktop(layout) ? styles.desktopOverlay : styles.tabletOverlay}>
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/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type';
3
- @import './style.scss';
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: spacing.$spacing-09;
10
- height: calc(100vh - 3rem);
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: spacing.$spacing-09;
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: 3rem;
50
+ height: layout.$spacing-09;
51
51
  }
52
52
 
53
53
  .headerContent {
54
54
  @include type.type-style('heading-compact-02');
55
- padding: 0 spacing.$spacing-05;
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: spacing.$spacing-05;
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: spacing.$spacing-06 spacing.$spacing-05;
87
+ padding: layout.$spacing-06 layout.$spacing-05;
88
88
  background-color: $ui-02;
89
89
  }
@@ -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 = useLayoutType as jest.Mock;
8
- const mockIsDesktop = isDesktop as jest.Mock;
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.mockImplementation(() => 'desktop');
13
+ mockUseLayoutType.mockReturnValue('small-desktop');
14
+
15
15
  render(
16
- <Overlay close={() => {}} header="Test Header">
16
+ <Overlay close={mockClose} header="Test Header">
17
17
  Overlay content
18
18
  </Overlay>,
19
19
  );
20
20
 
21
- const headerContent = screen.getByText('Test Header');
22
- const closeButton = screen.getByRole('button', { name: 'Close overlay' });
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.mockImplementation(() => 'tablet');
30
- mockIsDesktop.mockImplementation(() => false);
26
+ mockUseLayoutType.mockReturnValue('tablet');
27
+ mockIsDesktop.mockReturnValue(false);
28
+
31
29
  render(
32
- <Overlay close={() => {}} header="Test Header">
30
+ <Overlay close={mockClose} header="Test Header">
33
31
  Overlay content
34
32
  </Overlay>,
35
33
  );
36
34
 
37
- const headerContent = screen.getByText('Test Header');
38
- const backButton = screen.getByRole('button', { name: 'Close overlay' });
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
- const mockClose = jest.fn();
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
- const closeButton = screen.getByRole('button', { name: 'Close overlay' });
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
  });
@@ -2,9 +2,9 @@
2
2
  "actions": "Actions",
3
3
  "addPatientToList": "Ajouter le patient à la liste",
4
4
  "addToList": "Ajouter à la liste",
5
- "allLists": "All lists",
6
- "backToListsPage": "Back to lists page",
7
- "cancel": "Annuller",
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": "There are no {{listType}} patient lists to display",
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": "Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",
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": "Home",
32
+ "home": "Accueil",
33
33
  "identifier": "Identifiant",
34
- "items": "Eléments",
35
- "itemsDisplayed": "{{numberOfItemsDisplayed}} items",
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": "My lists",
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": "Next page",
50
- "noMatchingLists": "No matching lists to display",
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": "There are no patients in this list",
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": "Previous page",
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": "Star list",
72
- "starred": "starred",
73
- "starredLists": "Starred lists",
74
- "starringPatientListFailed": "Marking patient lists starred / unstarred failed",
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": "System lists",
81
- "unstarList": "Unstar list",
80
+ "systemLists": "Listes systemes",
81
+ "unstarList": "Enlever comme favori",
82
82
  "updated": "Updated",
83
83
  "userDefined": "user-defined"
84
84
  }