@kenyaemr/esm-service-queues-app 7.0.3-pre.88 → 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.
Files changed (186) hide show
  1. package/.turbo/turbo-build.log +18 -17
  2. package/dist/130.js +1 -1
  3. package/dist/130.js.map +1 -1
  4. package/dist/199.js +1 -1
  5. package/dist/236.js +1 -0
  6. package/dist/236.js.map +1 -0
  7. package/dist/265.js +1 -0
  8. package/dist/265.js.map +1 -0
  9. package/dist/271.js +1 -1
  10. package/dist/282.js +1 -0
  11. package/dist/282.js.map +1 -0
  12. package/dist/319.js +1 -1
  13. package/dist/366.js +1 -0
  14. package/dist/366.js.map +1 -0
  15. package/dist/392.js +1 -0
  16. package/dist/392.js.map +1 -0
  17. package/dist/460.js +1 -1
  18. package/dist/484.js +2 -0
  19. package/dist/484.js.map +1 -0
  20. package/dist/574.js +1 -1
  21. package/dist/6.js +1 -1
  22. package/dist/604.js +1 -0
  23. package/dist/604.js.map +1 -0
  24. package/dist/644.js +1 -1
  25. package/dist/670.js +1 -0
  26. package/dist/670.js.map +1 -0
  27. package/dist/727.js +1 -0
  28. package/dist/727.js.map +1 -0
  29. package/dist/752.js +1 -1
  30. package/dist/757.js +1 -1
  31. package/dist/760.js +1 -0
  32. package/dist/760.js.map +1 -0
  33. package/dist/788.js +1 -1
  34. package/dist/800.js +1 -1
  35. package/dist/807.js +1 -1
  36. package/dist/818.js +1 -0
  37. package/dist/818.js.map +1 -0
  38. package/dist/828.js +1 -1
  39. package/dist/833.js +1 -1
  40. package/dist/911.js +1 -0
  41. package/dist/911.js.map +1 -0
  42. package/dist/kenyaemr-esm-service-queues-app.js +1 -1
  43. package/dist/kenyaemr-esm-service-queues-app.js.buildmanifest.json +160 -160
  44. package/dist/kenyaemr-esm-service-queues-app.js.map +1 -1
  45. package/dist/main.js +1 -1
  46. package/dist/main.js.map +1 -1
  47. package/dist/routes.json +1 -1
  48. package/package.json +1 -1
  49. package/src/active-visits/active-visits-table.resource.ts +1 -1
  50. package/src/active-visits/change-status-dialog.scss +11 -11
  51. package/src/active-visits/change-status-dialog.test.tsx +36 -31
  52. package/src/add-patient-toqueue/add-patient-toqueue-dialog.scss +10 -10
  53. package/src/add-provider-queue-room/add-provider-queue-room.component.tsx +4 -4
  54. package/src/add-provider-queue-room/add-provider-queue-room.resource.ts +2 -2
  55. package/src/add-provider-queue-room/add-provider-queue-room.scss +6 -6
  56. package/src/add-provider-queue-room/add-provider-queue-room.test.tsx +44 -38
  57. package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.component.tsx +1 -1
  58. package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.scss +2 -3
  59. package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.test.tsx +15 -15
  60. package/src/config-schema.ts +84 -84
  61. package/src/current-visit/current-visit-summary.component.tsx +1 -1
  62. package/src/current-visit/current-visit-summary.test.tsx +12 -11
  63. package/src/current-visit/current-visit.resource.ts +1 -1
  64. package/src/current-visit/current-visit.scss +4 -4
  65. package/src/current-visit/hooks/useVitalsConceptMetadata.tsx +1 -1
  66. package/src/current-visit/visit-details/triage-note.scss +11 -11
  67. package/src/helpers/helpers.test.ts +24 -0
  68. package/src/helpers/helpers.ts +41 -14
  69. package/src/home.test.tsx +10 -12
  70. package/src/hooks/useQueueService.ts +16 -10
  71. package/src/past-visit/past-visit-details/past-visit-summary.scss +8 -8
  72. package/src/past-visit/past-visit.component.tsx +1 -1
  73. package/src/past-visit/past-visit.resource.ts +1 -1
  74. package/src/past-visit/past-visit.scss +17 -17
  75. package/src/past-visit/past-visit.test.tsx +8 -13
  76. package/src/patient-info/appointment-details.scss +7 -7
  77. package/src/patient-info/appointment-details.test.tsx +11 -6
  78. package/src/patient-info/appointments.resource.ts +1 -1
  79. package/src/patient-info/patient-info.scss +9 -9
  80. package/src/patient-info/patient-info.test.tsx +3 -14
  81. package/src/patient-queue-header/patient-queue-header.component.tsx +4 -1
  82. package/src/patient-queue-header/patient-queue-header.scss +11 -11
  83. package/src/patient-queue-metrics/clinic-metrics.component.tsx +1 -1
  84. package/src/patient-queue-metrics/clinic-metrics.resource.ts +2 -2
  85. package/src/patient-queue-metrics/clinic-metrics.scss +4 -4
  86. package/src/patient-queue-metrics/clinic-metrics.test.tsx +40 -45
  87. package/src/patient-queue-metrics/metrics-card.scss +11 -11
  88. package/src/patient-queue-metrics/metrics-header.scss +2 -2
  89. package/src/patient-search/advanced-search.scss +27 -27
  90. package/src/patient-search/advanced-search.test.tsx +6 -9
  91. package/src/patient-search/basic-search.scss +14 -14
  92. package/src/patient-search/basic-search.test.tsx +2 -7
  93. package/src/patient-search/hooks/useDefaultLocation.ts +1 -1
  94. package/src/patient-search/hooks/useQueueLocations.tsx +1 -0
  95. package/src/patient-search/hooks/useScheduledVisits.ts +1 -1
  96. package/src/patient-search/patient-scheduled-visits.component.tsx +4 -4
  97. package/src/patient-search/patient-scheduled-visits.scss +17 -17
  98. package/src/patient-search/patient-scheduled-visits.test.tsx +18 -23
  99. package/src/patient-search/patient-search.scss +7 -7
  100. package/src/patient-search/patient-search.workspace.tsx +4 -4
  101. package/src/patient-search/search-results.scss +11 -11
  102. package/src/patient-search/search-results.test.tsx +2 -10
  103. package/src/patient-search/visit-form/visit-form.scss +12 -13
  104. package/src/patient-search/visit-form/visit-type-selector.component.tsx +9 -11
  105. package/src/patient-search/visit-form/visit-type-selector.scss +13 -13
  106. package/src/patient-search/visit-form/visit-type-selector.test.tsx +4 -3
  107. package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.scss +1 -3
  108. package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.test.tsx +15 -9
  109. package/src/queue-entry-table-components/edit-entry.scss +1 -1
  110. package/src/queue-entry-table-components/queue-priority.scss +3 -4
  111. package/src/queue-entry-table-components/transition-entry.scss +1 -1
  112. package/src/queue-patient-linelists/queue-linelist-base-table.scss +16 -17
  113. package/src/queue-patient-linelists/queue-linelist-base-table.test.tsx +7 -8
  114. package/src/queue-patient-linelists/queue-linelist-filter.scss +13 -13
  115. package/src/queue-patient-linelists/queue-linelist-filter.test.tsx +9 -6
  116. package/src/queue-patient-linelists/queue-linelist.resource.ts +4 -4
  117. package/src/queue-patient-linelists/scheduled-appointments-table.test.tsx +10 -7
  118. package/src/queue-rooms/queue-room-form.scss +13 -13
  119. package/src/queue-rooms/queue-room-form.test.tsx +10 -8
  120. package/src/queue-screen/queue-screen.scss +6 -4
  121. package/src/queue-screen/queue-screen.test.tsx +6 -6
  122. package/src/queue-services/queue-service-form.scss +13 -13
  123. package/src/queue-services/queue-service-form.test.tsx +15 -8
  124. package/src/queue-table/cells/queue-table-action-cell.component.tsx +2 -2
  125. package/src/queue-table/cells/queue-table-coming-from-cell.component.tsx +1 -1
  126. package/src/queue-table/default-queue-table.component.tsx +63 -61
  127. package/src/queue-table/default-queue-table.test.tsx +61 -61
  128. package/src/queue-table/queue-entry-actions/queue-entry-actions-modal.scss +36 -0
  129. package/src/queue-table/queue-entry-actions/queue-entry-actions.modal.tsx +30 -10
  130. package/src/queue-table/queue-entry-actions/queue-entry-actions.test.tsx +34 -103
  131. package/src/queue-table/queue-entry-actions/queue-entry-confirm-action.test.tsx +42 -25
  132. package/src/queue-table/queue-entry-actions/queue-entry-undo-actions.test.tsx +19 -14
  133. package/src/queue-table/queue-table-by-status-skeleton.component.tsx +1 -5
  134. package/src/queue-table/queue-table-expanded-row.component.tsx +1 -2
  135. package/src/queue-table/queue-table-metrics-card.scss +7 -7
  136. package/src/queue-table/queue-table-metrics.scss +3 -3
  137. package/src/queue-table/queue-table.component.tsx +8 -11
  138. package/src/queue-table/queue-table.scss +32 -26
  139. package/src/queue-table/queue-table.test.tsx +46 -21
  140. package/src/remove-queue-entry-dialog/remove-queue-entry.resource.ts +1 -1
  141. package/src/remove-queue-entry-dialog/remove-queue-entry.scss +2 -2
  142. package/src/remove-queue-entry-dialog/remove-queue-entry.test.tsx +13 -12
  143. package/src/side-menu/side-menu.test.tsx +0 -1
  144. package/src/transition-queue-entry/transition-queue-entry-dialog.component.tsx +1 -1
  145. package/src/transition-queue-entry/transition-queue-entry-dialog.scss +5 -5
  146. package/src/transition-queue-entry/transition-queue-entry-dialog.test.tsx +33 -44
  147. package/src/views/queue-tables-for-all-statuses.component.tsx +14 -14
  148. package/src/visits-missing-inqueue/visits-missing-inqueue.component.tsx +1 -1
  149. package/src/visits-missing-inqueue/visits-missing-inqueue.resource.ts +1 -1
  150. package/src/visits-missing-inqueue/visits-missing-inqueue.scss +17 -14
  151. package/translations/am.json +4 -2
  152. package/translations/ar.json +4 -2
  153. package/translations/en.json +1 -0
  154. package/translations/es.json +4 -2
  155. package/translations/fr.json +39 -37
  156. package/translations/he.json +4 -2
  157. package/translations/km.json +4 -2
  158. package/translations/zh.json +4 -2
  159. package/translations/zh_CN.json +4 -2
  160. package/dist/276.js +0 -1
  161. package/dist/276.js.map +0 -1
  162. package/dist/384.js +0 -2
  163. package/dist/384.js.map +0 -1
  164. package/dist/401.js +0 -1
  165. package/dist/401.js.map +0 -1
  166. package/dist/430.js +0 -1
  167. package/dist/430.js.map +0 -1
  168. package/dist/60.js +0 -1
  169. package/dist/60.js.map +0 -1
  170. package/dist/600.js +0 -1
  171. package/dist/600.js.map +0 -1
  172. package/dist/647.js +0 -1
  173. package/dist/647.js.map +0 -1
  174. package/dist/650.js +0 -1
  175. package/dist/650.js.map +0 -1
  176. package/dist/669.js +0 -1
  177. package/dist/669.js.map +0 -1
  178. package/dist/764.js +0 -1
  179. package/dist/764.js.map +0 -1
  180. package/dist/877.js +0 -1
  181. package/dist/877.js.map +0 -1
  182. package/dist/917.js +0 -1
  183. package/dist/917.js.map +0 -1
  184. package/src/queue-table/queue-entry-actions/queue-entry-actons-modal.scss +0 -36
  185. package/src/root.scss +0 -15
  186. /package/dist/{384.js.LICENSE.txt → 484.js.LICENSE.txt} +0 -0
@@ -1,6 +1,6 @@
1
- @use '@carbon/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type';
3
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
4
4
 
5
5
  .container {
6
6
  flex-grow: 1;
@@ -17,15 +17,15 @@
17
17
  .tileContainer {
18
18
  border: 0.0625rem solid $ui-03;
19
19
  height: 7.875rem;
20
- padding: spacing.$spacing-05;
21
- margin: spacing.$spacing-03 spacing.$spacing-03;
20
+ padding: layout.$spacing-05;
21
+ margin: layout.$spacing-03 layout.$spacing-03;
22
22
  }
23
23
 
24
24
  .tileHeader {
25
25
  display: flex;
26
26
  justify-content: space-between;
27
27
  align-items: baseline;
28
- margin-bottom: spacing.$spacing-03;
28
+ margin-bottom: layout.$spacing-03;
29
29
  }
30
30
 
31
31
  .headerLabel {
@@ -45,15 +45,15 @@
45
45
 
46
46
  .headerLabelContainer {
47
47
  display: flex;
48
- height: spacing.$spacing-07;
48
+ height: layout.$spacing-07;
49
49
 
50
50
  :global(.cds--dropdown__wrapper--inline) {
51
51
  gap: 0;
52
- margin-top: -0.75rem;
52
+ margin-top: -(layout.$spacing-04);
53
53
  }
54
54
 
55
55
  :global(.cds--list-box__menu-icon) {
56
- height: 1rem;
56
+ height: layout.$spacing-05;
57
57
  }
58
58
  }
59
59
 
@@ -64,7 +64,7 @@
64
64
  color: $interactive-01;
65
65
 
66
66
  svg {
67
- margin-left: spacing.$spacing-03;
67
+ margin-left: layout.$spacing-03;
68
68
  }
69
69
  }
70
70
 
@@ -72,7 +72,7 @@
72
72
  html[dir='rtl'] {
73
73
  .link {
74
74
  svg {
75
- margin-right: spacing.$spacing-03;
75
+ margin-right: layout.$spacing-03;
76
76
  margin-left: unset;
77
77
  transform: scale(-1, 1);
78
78
  }
@@ -1,6 +1,6 @@
1
1
  @use '@carbon/layout';
2
2
  @use '@carbon/type';
3
- @import '~@openmrs/esm-styleguide/src/vars';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
4
4
 
5
5
  .metricsContainer {
6
6
  display: flex;
@@ -18,7 +18,7 @@
18
18
 
19
19
  .actionBtn {
20
20
  display: flex;
21
- column-gap: 0.5rem;
21
+ column-gap: layout.$spacing-03;
22
22
  }
23
23
 
24
24
  .comboBtn {
@@ -1,17 +1,17 @@
1
- @use '@carbon/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type';
3
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
4
4
 
5
5
  .form {
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  justify-content: space-between;
9
- height: calc(100vh - 6rem);
9
+ height: calc(100vh - layout.$spacing-11);
10
10
  }
11
11
 
12
12
  .grid {
13
- margin: 0 1rem;
14
- padding: 0rem;
13
+ margin: 0 layout.$spacing-05;
14
+ padding: 0;
15
15
  }
16
16
 
17
17
  .row {
@@ -20,7 +20,7 @@
20
20
  :global(.cds--col) {
21
21
  :global(.cds--form-item) {
22
22
  &:not(:first-of-type):not(:last-of-type) {
23
- margin: 1rem 0;
23
+ margin: layout.$spacing-05 0;
24
24
  }
25
25
  }
26
26
 
@@ -29,18 +29,18 @@
29
29
  }
30
30
 
31
31
  :global(.cds--date-picker.cds--date-picker--single .cds--date-picker__input) {
32
- width: 10rem;
32
+ width: layout.$spacing-13;
33
33
  }
34
34
  }
35
35
  }
36
36
 
37
37
  .heading {
38
38
  @include type.type-style('heading-compact-02');
39
- margin-bottom: 0.5rem;
39
+ margin-bottom: layout.$spacing-03;
40
40
  }
41
41
 
42
42
  .spacer {
43
- margin-top: 2rem;
43
+ margin-top: layout.$spacing-07;
44
44
  display: inline-block;
45
45
  }
46
46
 
@@ -48,7 +48,7 @@
48
48
  align-items: center;
49
49
  display: flex;
50
50
  justify-content: flex-start;
51
- margin: spacing.$spacing-03 0;
51
+ margin: layout.$spacing-03 0;
52
52
  padding: 0;
53
53
  @include type.type-style('body-compact-01');
54
54
 
@@ -57,8 +57,8 @@
57
57
 
58
58
  svg {
59
59
  order: 1;
60
- margin-right: 0.5rem;
61
- margin-left: 0rem !important;
60
+ margin-right: layout.$spacing-03;
61
+ margin-left: 0 !important;
62
62
  }
63
63
 
64
64
  span {
@@ -68,7 +68,7 @@
68
68
  }
69
69
 
70
70
  .advancePatientSearchContainer {
71
- margin: 0 spacing.$spacing-05;
71
+ margin: 0 layout.$spacing-05;
72
72
 
73
73
  & .backButton {
74
74
  margin: 0;
@@ -82,18 +82,18 @@
82
82
  .label01 {
83
83
  @include type.type-style('label-01');
84
84
  color: $text-02;
85
- margin: spacing.$spacing-03 0;
85
+ margin: layout.$spacing-03 0;
86
86
  }
87
87
 
88
88
  .formTextInput {
89
- margin-bottom: spacing.$spacing-04;
89
+ margin-bottom: layout.$spacing-04;
90
90
  }
91
91
 
92
92
  .contentSwitcherContainer {
93
93
  display: flex;
94
94
  align-items: center;
95
- height: spacing.$spacing-09;
96
- margin-bottom: spacing.$spacing-05;
95
+ height: layout.$spacing-09;
96
+ margin-bottom: layout.$spacing-05;
97
97
 
98
98
  & > span {
99
99
  @include type.type-style('heading-compact-01');
@@ -104,21 +104,21 @@
104
104
  .formTitle {
105
105
  font-weight: bold;
106
106
  @include type.type-style('heading-compact-02');
107
- margin-bottom: spacing.$spacing-02;
107
+ margin-bottom: layout.$spacing-02;
108
108
  }
109
109
 
110
110
  .fieldRangeSwitcher {
111
111
  width: 8rem;
112
- margin: 0 spacing.$spacing-03 0;
112
+ margin: 0 layout.$spacing-03 0;
113
113
  }
114
114
 
115
115
  .genderSwitcher {
116
116
  width: 18rem;
117
- margin: 0.25rem 0 1rem;
117
+ margin: layout.$spacing-02 0 layout.$spacing-05;
118
118
  }
119
119
 
120
120
  .button {
121
- height: 4rem;
121
+ height: layout.$spacing-10;
122
122
  display: flex;
123
123
  align-content: flex-start;
124
124
  align-items: baseline;
@@ -126,26 +126,26 @@
126
126
  }
127
127
 
128
128
  .tablet {
129
- padding: 1.5rem 1rem;
129
+ padding: layout.$spacing-06 layout.$spacing-05;
130
130
  background-color: $ui-02;
131
131
  }
132
132
 
133
133
  .desktop {
134
- padding: 0rem;
135
- margin-top: spacing.$spacing-05;
134
+ padding: 0;
135
+ margin-top: layout.$spacing-05;
136
136
  }
137
137
 
138
138
  /* Desktop */
139
139
  :global(.omrs-breakpoint-gt-tablet) {
140
140
  .form {
141
- height: calc(100vh - 6rem);
141
+ height: calc(100vh - layout.$spacing-11);
142
142
  }
143
143
  }
144
144
 
145
145
  /* Tablet */
146
146
  :global(.omrs-breakpoint-lt-desktop) {
147
147
  .form {
148
- height: calc(100vh - 3rem);
148
+ height: calc(100vh - layout.$spacing-09);
149
149
  }
150
150
  }
151
151
 
@@ -2,14 +2,16 @@ import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import AdvancedSearch from './advanced-search.component';
4
4
 
5
- describe('AdvancedSearch: ', () => {
6
- test('renders the advanced patient search in an overlay', () => {
7
- renderAdvancedSearch();
5
+ describe('AdvancedSearch', () => {
6
+ test('renders the advanced patient search in an overlay', async () => {
7
+ render(<AdvancedSearch toggleSearchType={jest.fn()} />);
8
8
 
9
9
  expect(screen.getByRole('button', { name: /back to simple search/i })).toBeInTheDocument();
10
10
  expect(screen.getByRole('button', { name: /cancel/i })).toBeInTheDocument();
11
11
  expect(screen.getByRole('button', { name: /^search$/i })).toBeInTheDocument();
12
- expect(screen.findAllByText(/any/i));
12
+
13
+ await screen.findAllByText(/any/i);
14
+
13
15
  expect(screen.getByRole('tab', { name: /^male$/i })).toBeInTheDocument();
14
16
  expect(screen.getByRole('tab', { name: /^female$/i })).toBeInTheDocument();
15
17
  expect(screen.getByRole('heading', { name: /name/i })).toBeInTheDocument();
@@ -22,8 +24,3 @@ describe('AdvancedSearch: ', () => {
22
24
  expect(screen.getByRole('textbox', { name: /post code/i })).toBeInTheDocument();
23
25
  });
24
26
  });
25
-
26
- function renderAdvancedSearch() {
27
- const toggleSearchType = jest.fn();
28
- render(<AdvancedSearch toggleSearchType={toggleSearchType} />);
29
- }
@@ -1,11 +1,11 @@
1
- @use '@carbon/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type';
3
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
4
4
 
5
5
  .searchboxContainer {
6
6
  display: flex;
7
7
  align-items: center;
8
- margin-bottom: spacing.$spacing-05;
8
+ margin-bottom: layout.$spacing-05;
9
9
  }
10
10
 
11
11
  .searchboxLayer {
@@ -14,7 +14,7 @@
14
14
 
15
15
  .tileContainer {
16
16
  :global(.omrs-breakpoint-gt-tablet) & {
17
- margin: 0 1.5rem 0;
17
+ margin: 0 layout.$spacing-06 0;
18
18
  }
19
19
 
20
20
  :global(.omrs-breakpoint-lt-desktop) & {
@@ -28,7 +28,7 @@
28
28
  flex-flow: column wrap;
29
29
  align-items: center;
30
30
  justify-content: center;
31
- padding: 2rem 0 1.5rem;
31
+ padding: layout.$spacing-07 0 layout.$spacing-06;
32
32
  text-align: center;
33
33
  border: 1px solid $ui-03;
34
34
  }
@@ -43,7 +43,7 @@
43
43
 
44
44
  .secondaryText {
45
45
  width: 12rem;
46
- margin-top: 0.25rem;
46
+ margin-top: layout.$spacing-02;
47
47
  @include type.type-style('body-01');
48
48
  }
49
49
  }
@@ -52,7 +52,7 @@
52
52
  @include type.type-style('heading-03');
53
53
  color: $text-02;
54
54
  width: 12rem;
55
- margin: 3rem auto;
55
+ margin: layout.$spacing-09 auto;
56
56
  overflow: hidden;
57
57
  text-align: center;
58
58
 
@@ -68,12 +68,12 @@
68
68
  }
69
69
 
70
70
  &::before {
71
- right: 1rem;
71
+ right: layout.$spacing-05;
72
72
  margin-left: -50%;
73
73
  }
74
74
 
75
75
  &::after {
76
- left: 1rem;
76
+ left: layout.$spacing-05;
77
77
  margin-right: -50%;
78
78
  }
79
79
  }
@@ -113,13 +113,13 @@
113
113
  @include type.type-style('label-01');
114
114
  color: $text-02;
115
115
  border-bottom: 0.063rem solid $ui-03;
116
- padding: spacing.$spacing-03 0rem;
116
+ padding: layout.$spacing-03 0;
117
117
  }
118
118
 
119
119
  .emptyResultText {
120
120
  @include type.type-style('heading-compact-01');
121
121
  color: $text-02;
122
- margin-top: spacing.$spacing-05;
122
+ margin-top: layout.$spacing-05;
123
123
  margin-bottom: 0.313rem;
124
124
  }
125
125
 
@@ -130,8 +130,8 @@
130
130
 
131
131
  .emptySearchResultsTile {
132
132
  text-align: center;
133
- margin-top: spacing.$spacing-05;
134
- padding: spacing.$spacing-09 0rem;
133
+ margin-top: layout.$spacing-05;
134
+ padding: layout.$spacing-09 0;
135
135
  }
136
136
 
137
137
  :global(.omrs-breakpoint-gt-tablet) .emptySearchResultsTile {
@@ -2,9 +2,9 @@ import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import BasicSearch from './basic-search.component';
4
4
 
5
- describe('BasicSearch: ', () => {
5
+ describe('BasicSearch', () => {
6
6
  test('renders the basic patient search in an overlay', () => {
7
- renderBasicSearch();
7
+ render(<BasicSearch toggleSearchType={jest.fn()} />);
8
8
 
9
9
  const searchbox = screen.getByRole('searchbox', { name: /search for a patient/i });
10
10
  const searchButton = screen.getByRole('button', { name: /^search$/i });
@@ -16,8 +16,3 @@ describe('BasicSearch: ', () => {
16
16
  expect(screen.getByText(/type the patient's name or unique id number/i)).toBeInTheDocument();
17
17
  });
18
18
  });
19
-
20
- function renderBasicSearch() {
21
- const toggleSearchType = jest.fn();
22
- render(<BasicSearch toggleSearchType={toggleSearchType} />);
23
- }
@@ -9,6 +9,6 @@ export const useDefaultLoginLocation = () => {
9
9
  return {
10
10
  defaultFacility: data ? data?.data : null,
11
11
  isLoading: isLoading,
12
- isError: error,
12
+ error,
13
13
  };
14
14
  };
@@ -8,6 +8,7 @@ interface FHIRResponse {
8
8
  type: string;
9
9
  resourceType: string;
10
10
  }
11
+
11
12
  export function useQueueLocations() {
12
13
  const apiUrl = `${fhirBaseUrl}/Location?_summary=data&_tag=queue location`;
13
14
  const { data, error, isLoading } = useSWRImmutable<{ data: FHIRResponse }>(apiUrl, openmrsFetch);
@@ -46,7 +46,7 @@ export function useScheduledVisits(patientUuid: string) {
46
46
 
47
47
  return {
48
48
  appointments: data ? { recentVisits, futureVisits } : null,
49
- isError: error,
49
+ error,
50
50
  isLoading,
51
51
  };
52
52
  }
@@ -1,4 +1,7 @@
1
1
  import React, { useCallback, useEffect, useState } from 'react';
2
+ import dayjs from 'dayjs';
3
+ import head from 'lodash-es/head';
4
+ import { first } from 'rxjs/operators';
2
5
  import { useTranslation } from 'react-i18next';
3
6
  import {
4
7
  Button,
@@ -27,16 +30,13 @@ import {
27
30
  useVisitTypes,
28
31
  } from '@openmrs/esm-framework';
29
32
  import { type Appointment, SearchTypes } from '../types';
30
- import styles from './patient-scheduled-visits.scss';
31
33
  import { postQueueEntry } from './visit-form/queue.resource';
32
- import { first } from 'rxjs/operators';
33
34
  import { convertTime12to24 } from '../helpers/time-helpers';
34
- import dayjs from 'dayjs';
35
- import head from 'lodash-es/head';
36
35
  import { useQueueLocations } from './hooks/useQueueLocations';
37
36
  import { useQueues } from '../hooks/useQueues';
38
37
  import { useMutateQueueEntries } from '../hooks/useQueueEntries';
39
38
  import { type ConfigObject } from '../config-schema';
39
+ import styles from './patient-scheduled-visits.scss';
40
40
 
41
41
  enum visitType {
42
42
  RECENT = 'Recent',
@@ -1,6 +1,6 @@
1
- @use '@carbon/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type';
3
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
4
4
 
5
5
  .container {
6
6
  background-color: $ui-background;
@@ -15,7 +15,7 @@
15
15
  }
16
16
 
17
17
  .visitTile {
18
- margin: spacing.$spacing-05 0;
18
+ margin: layout.$spacing-05 0;
19
19
 
20
20
  &:global(.cds--tile--is-selected:focus) {
21
21
  background-color: $color-blue-10;
@@ -37,19 +37,19 @@
37
37
  }
38
38
 
39
39
  .recentlyScheduledVisitsContainer {
40
- margin-top: spacing.$spacing-06;
41
- margin-bottom: spacing.$spacing-10;
40
+ margin-top: layout.$spacing-06;
41
+ margin-bottom: layout.$spacing-10;
42
42
  }
43
43
 
44
44
  .row {
45
- margin: 0 spacing.$spacing-05 spacing.$spacing-05 spacing.$spacing-05;
45
+ margin: 0 layout.$spacing-05 layout.$spacing-05 layout.$spacing-05;
46
46
  }
47
47
 
48
48
  .backButton {
49
49
  align-items: center;
50
50
  display: flex;
51
51
  justify-content: flex-start;
52
- margin: spacing.$spacing-03 0;
52
+ margin: layout.$spacing-03 0;
53
53
  padding: 0;
54
54
  @include type.type-style('body-compact-01');
55
55
 
@@ -58,8 +58,8 @@
58
58
 
59
59
  svg {
60
60
  order: 1;
61
- margin-right: 0.5rem;
62
- margin-left: 0rem !important;
61
+ margin-right: layout.$spacing-03;
62
+ margin-left: 0 !important;
63
63
  }
64
64
 
65
65
  span {
@@ -84,7 +84,7 @@
84
84
  }
85
85
 
86
86
  .button {
87
- height: 4rem;
87
+ height: layout.$spacing-10;
88
88
  display: flex;
89
89
  align-content: flex-start;
90
90
  align-items: baseline;
@@ -94,7 +94,7 @@
94
94
  .text-divider {
95
95
  display: flex;
96
96
  align-items: center;
97
- margin: spacing.$spacing-08 25%;
97
+ margin: layout.$spacing-08 25%;
98
98
  @include type.type-style('heading-03');
99
99
  color: $text-02;
100
100
  }
@@ -108,24 +108,24 @@
108
108
  }
109
109
 
110
110
  .text-divider::before {
111
- margin-right: spacing.$spacing-05;
111
+ margin-right: layout.$spacing-05;
112
112
  }
113
113
 
114
114
  .text-divider::after {
115
- margin-left: spacing.$spacing-05;
115
+ margin-left: layout.$spacing-05;
116
116
  }
117
117
 
118
118
  .buttonContainer {
119
119
  display: flex;
120
120
  align-items: center;
121
121
  justify-content: center;
122
- margin-bottom: spacing.$spacing-03;
122
+ margin-bottom: layout.$spacing-03;
123
123
  }
124
124
 
125
125
  .prioritySwitcher {
126
- margin: spacing.$spacing-03 0 spacing.$spacing-03;
126
+ margin: layout.$spacing-03 0 layout.$spacing-03;
127
127
  }
128
128
 
129
129
  .emptyAppointment {
130
- margin: spacing.$spacing-05;
130
+ margin: layout.$spacing-05;
131
131
  }
@@ -1,44 +1,39 @@
1
1
  import React from 'react';
2
2
  import { screen } from '@testing-library/react';
3
+ import { getDefaultsFromConfigSchema, useConfig, useLocations, useSession } from '@openmrs/esm-framework';
3
4
  import { renderWithSwr } from 'tools';
5
+ import { type ConfigObject, configSchema } from '../config-schema';
4
6
  import { mockLocations, mockPatient, mockPatientsVisits, mockSession } from '__mocks__';
5
- import { type ConfigObject, useConfig } from '@openmrs/esm-framework';
6
7
  import PatientScheduledVisits from './patient-scheduled-visits.component';
7
8
 
8
- const mockedUseConfig = useConfig as jest.Mock;
9
+ const mockUseConfig = jest.mocked(useConfig<ConfigObject>);
9
10
  const mockToggleSearchType = jest.fn();
11
+ const mockUseLocations = useLocations as jest.Mock;
12
+ const mockUseSession = jest.mocked(useSession);
10
13
 
11
- const testProps = {
14
+ const defaultProps = {
12
15
  appointments: { recentVisits: mockPatientsVisits.recentVisits, futureVisits: [] },
13
- toggleSearchType: mockToggleSearchType,
14
- patientUuid: mockPatient.uuid,
15
16
  closePanel: () => false,
17
+ closeWorkspace: jest.fn(),
18
+ patientUuid: mockPatient.uuid,
19
+ toggleSearchType: mockToggleSearchType,
16
20
  };
17
21
 
18
- jest.mock('@openmrs/esm-framework', () => {
19
- const originalModule = jest.requireActual('@openmrs/esm-framework');
20
- return {
21
- ...originalModule,
22
- openmrsFetch: jest.fn(),
23
- useLocations: jest.fn().mockImplementation(() => mockLocations.data),
24
- useSession: jest.fn().mockImplementation(() => mockSession.data),
25
- };
26
- });
27
22
  describe('ScheduledVisits', () => {
28
- beforeEach(() =>
29
- mockedUseConfig.mockReturnValue({
23
+ beforeEach(() => {
24
+ mockUseConfig.mockReturnValue({
25
+ ...getDefaultsFromConfigSchema(configSchema),
30
26
  concepts: {},
31
- } as ConfigObject),
32
- );
27
+ } as ConfigObject);
28
+ mockUseLocations.mockReturnValue(mockLocations.data.results);
29
+ mockUseSession.mockReturnValue(mockSession.data);
30
+ });
31
+
33
32
  it('should display recent and future scheduled visits', async () => {
34
- renderPatientScheduledVisits();
33
+ renderWithSwr(<PatientScheduledVisits {...defaultProps} />);
35
34
 
36
35
  expect(screen.getByText(/Cardiology Consultation 1/i)).toBeInTheDocument();
37
36
  expect(screen.getByText(/08-Aug-2022, 02:56 PM · 10 Engineer VCT/i)).toBeInTheDocument();
38
37
  expect(screen.getByText(/No appointments found/i)).toBeInTheDocument();
39
38
  });
40
39
  });
41
-
42
- function renderPatientScheduledVisits() {
43
- renderWithSwr(<PatientScheduledVisits {...testProps} />);
44
- }
@@ -1,6 +1,6 @@
1
- @use '@carbon/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type';
3
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
4
4
 
5
5
  .patientSearchContainer {
6
6
  height: 100%;
@@ -22,14 +22,14 @@
22
22
  }
23
23
 
24
24
  .patientPhoto {
25
- margin: 1rem;
25
+ margin: layout.$spacing-05;
26
26
  }
27
27
 
28
28
  .backButton {
29
29
  align-items: center;
30
30
  display: flex;
31
31
  justify-content: flex-start;
32
- margin: spacing.$spacing-03 0;
32
+ margin: layout.$spacing-03 0;
33
33
  padding: 0;
34
34
  @include type.type-style('body-compact-01');
35
35
 
@@ -38,8 +38,8 @@
38
38
 
39
39
  svg {
40
40
  order: 1;
41
- margin-right: spacing.$spacing-03;
42
- margin-left: 0rem !important;
41
+ margin-right: layout.$spacing-03;
42
+ margin-left: 0 !important;
43
43
  }
44
44
 
45
45
  span {
@@ -43,7 +43,7 @@ const PatientSearch: React.FC<PatientSearchProps> = ({
43
43
  const { activeVisit } = useVisit(selectedPatientUuid);
44
44
  const [searchType, setSearchType] = useState<SearchTypes>(SearchTypes.SCHEDULED_VISITS);
45
45
  const [showContactDetails, setContactDetails] = useState(false);
46
- const { appointments, isLoading, isError } = useScheduledVisits(selectedPatientUuid);
46
+ const { appointments, isLoading, error } = useScheduledVisits(selectedPatientUuid);
47
47
 
48
48
  const hasAppointments = !(isNil(appointments?.futureVisits) && isNil(appointments?.recentVisits));
49
49
 
@@ -109,11 +109,11 @@ const PatientSearch: React.FC<PatientSearchProps> = ({
109
109
  <ExistingVisitFormComponent visit={activeVisit} closeWorkspace={closeWorkspace} />
110
110
  ) : (
111
111
  <>
112
- {isError ? (
113
- <ErrorState headerTitle={t('errorFetchingAppointments', 'Error fetching appointments')} error={isError} />
112
+ {error ? (
113
+ <ErrorState headerTitle={t('errorFetchingAppointments', 'Error fetching appointments')} error={error} />
114
114
  ) : null}
115
115
 
116
- {isLoading && !isError ? (
116
+ {isLoading && !error ? (
117
117
  <DataTableSkeleton role="progressbar" />
118
118
  ) : searchType === SearchTypes.SCHEDULED_VISITS && hasAppointments ? (
119
119
  <PatientScheduledVisits