@openmrs/esm-user-onboarding-app 4.0.1-pre.27 → 4.0.1-pre.273

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 (63) hide show
  1. package/.husky/pre-commit +1 -1
  2. package/README.md +62 -13
  3. package/dist/1904.js +2 -0
  4. package/dist/1904.js.map +1 -0
  5. package/dist/282.js +2 -0
  6. package/dist/282.js.LICENSE.txt +32 -0
  7. package/dist/282.js.map +1 -0
  8. package/dist/4055.js +1 -1
  9. package/dist/439.js +1 -0
  10. package/dist/6022.js +1 -1
  11. package/dist/6399.js +1 -1
  12. package/dist/6399.js.map +1 -1
  13. package/dist/6478.js +1 -0
  14. package/dist/6478.js.map +1 -0
  15. package/dist/6589.js +1 -0
  16. package/dist/8371.js +1 -0
  17. package/dist/8690.js +1 -1
  18. package/dist/8690.js.map +1 -1
  19. package/dist/8719.js +2 -0
  20. package/dist/{553.js.LICENSE.txt → 8719.js.LICENSE.txt} +0 -20
  21. package/dist/8719.js.map +1 -0
  22. package/dist/9538.js +1 -1
  23. package/dist/961.js +2 -0
  24. package/dist/961.js.LICENSE.txt +19 -0
  25. package/dist/961.js.map +1 -0
  26. package/dist/main.js +1 -1
  27. package/dist/main.js.map +1 -1
  28. package/dist/openmrs-esm-user-onboarding-app.js +1 -1
  29. package/dist/openmrs-esm-user-onboarding-app.js.buildmanifest.json +215 -95
  30. package/dist/openmrs-esm-user-onboarding-app.js.map +1 -1
  31. package/dist/routes.json +1 -1
  32. package/e2e/README.md +9 -7
  33. package/e2e/core/test.ts +1 -1
  34. package/e2e/fixtures/api.ts +1 -1
  35. package/e2e/pages/home-page.ts +2 -2
  36. package/e2e/specs/onboarding-test.spec.ts +8 -27
  37. package/jest.config.js +1 -0
  38. package/package.json +10 -10
  39. package/src/config-schema.ts +76 -112
  40. package/src/index.ts +1 -1
  41. package/src/root.component.tsx +32 -28
  42. package/src/routes.json +5 -5
  43. package/src/tooltip/tooltip.component.tsx +4 -8
  44. package/src/tooltip/tooltip.scss +16 -16
  45. package/src/tutorial/modal.component.tsx +16 -8
  46. package/src/tutorial/{modal.component.test.tsx → modal.test.tsx} +10 -8
  47. package/src/tutorial/styles.scss +7 -35
  48. package/src/tutorial/{tutorial.tsx → tutorial.component.tsx} +1 -5
  49. package/src/types.ts +15 -5
  50. package/translations/cs.json +9 -0
  51. package/translations/fr.json +7 -7
  52. package/translations/it.json +3 -3
  53. package/translations/ro_RO.json +7 -7
  54. package/translations/sq.json +9 -0
  55. package/translations/zh_TW.json +9 -0
  56. package/dist/553.js +0 -2
  57. package/dist/553.js.map +0 -1
  58. package/dist/5930.js +0 -2
  59. package/dist/5930.js.map +0 -1
  60. package/dist/6920.js +0 -1
  61. package/dist/6920.js.map +0 -1
  62. package/src/root.scss +0 -0
  63. /package/dist/{5930.js.LICENSE.txt → 1904.js.LICENSE.txt} +0 -0
@@ -12,11 +12,14 @@ export const configSchema = {
12
12
  _default: [
13
13
  {
14
14
  title: 'Basic Overview',
15
- description: 'This guide provides a quick look at the essential components that shape the layout and user experience of our homepage.',
16
- steps: [{
17
- target: '[aria-label="OpenMRS"]',
18
- content: 'Welcome to OpenMRS! This is the main dashboard where you can navigate to various features of the system.',
19
- },
15
+ description:
16
+ 'This guide provides a quick look at the essential components that shape the layout and user experience of our homepage.',
17
+ steps: [
18
+ {
19
+ target: '[aria-label="OpenMRS"]',
20
+ content:
21
+ 'Welcome to OpenMRS! This is the main dashboard where you can navigate to various features of the system.',
22
+ },
20
23
  {
21
24
  target: '[name="SearchPatientIcon"]',
22
25
  content: 'This is the search icon. Use it to find patients in the system quickly.',
@@ -29,14 +32,6 @@ export const configSchema = {
29
32
  target: '[name="User"]',
30
33
  content: 'The user icon. Click here to change your user preferences and settings.',
31
34
  },
32
- {
33
- target: '[data-extension-id="active-visits-widget"]',
34
- content: 'This table displays active visits. Here you can see all the ongoing patient visits.',
35
- },
36
- {
37
- target: '[data-extension-id="home-appointments"]',
38
- content: 'This table shows appointments. View and manage patient appointments from this section.',
39
- },
40
35
  ],
41
36
  },
42
37
  {
@@ -83,31 +78,28 @@ export const configSchema = {
83
78
  'Patient chart is the main point of interaction between healthcare professionals and patient data, where you can manage everything related to a single patient.',
84
79
  steps: [
85
80
  {
86
- target: '[data-testid="searchPatientIcon"]',
81
+ target: '[data-tutorial-target="search-patient-icon"]',
87
82
  content:
88
83
  'To access the patient chart, first, you need to select a patient. To start, click here to open the search box so that we can search for a patient.',
89
84
  spotlightClicks: true,
90
85
  hideNextButton: true,
91
86
  data: {
92
- autoNextOn: '[data-testid="patientSearchBar"]',
87
+ autoNextOn: '[data-tutorial-target="patient-search-bar"]',
93
88
  },
94
89
  },
95
90
  {
96
- target: '[data-testid="patientSearchBar"]',
91
+ target: '[data-tutorial-target="patient-search-bar"]',
97
92
  content:
98
93
  'Now, enter the name or the ID of the patient here. Some example patient names that you can search for are: John, Smith, Mary.',
99
- hideNextButton: true,
94
+ hideNextButton: false,
100
95
  hideBackButton: true,
101
96
  spotlightClicks: true,
102
- data: {
103
- autoNextOn: '[data-testid="floatingSearchResultsContainer"]',
104
- },
105
97
  },
106
98
  {
107
- target: '[data-testid="floatingSearchResultsContainer"]',
99
+ target: '[data-tutorial-target="floating-search-results-container"]',
108
100
  content: 'Click on the patient you want to go to their patient chart.',
109
101
  spotlightClicks: true,
110
- disableOverlay : true,
102
+ disableOverlay: false,
111
103
  placement: 'left',
112
104
  hideNextButton: true,
113
105
  hideBackButton: true,
@@ -118,7 +110,8 @@ export const configSchema = {
118
110
  {
119
111
  target: 'body',
120
112
  title: 'Patient Chart',
121
- content: "Welcome to the Patient Chart View! Here, you can quickly see everything about your patient's health history, visits, medications, allergies, and test results—all in one place. It's designed to help you provide the best care efficiently.",
113
+ content:
114
+ "Welcome to the Patient Chart View! Here, you can quickly see everything about your patient's health history, visits, medications, allergies, and test results—all in one place. It's designed to help you provide the best care efficiently.",
122
115
  spotlightClicks: true,
123
116
  hideBackButton: true,
124
117
  placement: 'center',
@@ -161,32 +154,38 @@ export const configSchema = {
161
154
  },
162
155
  {
163
156
  title: 'Finding a Patient',
164
- description: 'Learn how to find a patient in the system using basic and advanced search features, including the use of filters to refine results.',
157
+ description:
158
+ 'Learn how to find a patient in the system using basic and advanced search features, including the use of filters to refine results.',
165
159
  steps: [
166
160
  {
167
- target: '[data-testid="searchPatientIcon"]',
161
+ target: '[data-tutorial-target="search-patient-icon"]',
168
162
  content: 'Click on the search icon to open the search box so that we can search for a patient.',
169
163
  spotlightClicks: true,
170
164
  hideNextButton: true,
171
165
  data: {
172
- autoNextOn: '[data-testid="patientSearchBar"]',
166
+ autoNextOn: '[data-tutorial-target="patient-search-bar"]',
173
167
  },
174
168
  },
175
169
  {
176
- target: '[data-testid="patientSearchBar"]',
170
+ target: '[data-tutorial-target="patient-search-bar"]',
177
171
  content:
178
172
  'Now, enter the name of the patient here. If you know the patient ID, you can use that as well. You will see the results if the patient you entered exists in the system. Some example patient names that you can search for are: John, Smith, Mary.',
179
- hideNextButton: true,
173
+ hideNextButton: false,
180
174
  hideBackButton: true,
181
175
  spotlightClicks: true,
182
- data: {
183
- autoNextOn: '[data-testid="floatingSearchResultsContainer"]',
184
- },
176
+ },
177
+ {
178
+ target: '[data-tutorial-target="floating-search-results-container"]',
179
+ content: 'The search container shows only the top results and if they are not the patient you want, or you cannot find the patient by name or the patient ID, you can use advanced search tools to narrow down your search. Click next to learn more about the advanced search options.',
180
+ spotlightClicks: false,
181
+ disableOverlay: false,
182
+ hideNextButton: false,
183
+ hideBackButton: true,
185
184
  },
186
185
  {
187
186
  target: 'button[type="submit"]',
188
187
  content:
189
- 'If there are a lot of patients in the system, you may need additional fields to search other than the name. Also, the patient you are looking for may not be displayed in the top results if there are multiple patients with the same name. In these scenarios, you can click here to open the advanced search.',
188
+ 'The advanced search provides additional search fields like date of birth and phone number to help find the right patient, which comes in helpful in scenarios where multiple patients have the same name. Click here to access the advanced search tool.',
190
189
  spotlightClicks: true,
191
190
  placement: 'bottom',
192
191
  hideNextButton: true,
@@ -210,7 +209,7 @@ export const configSchema = {
210
209
  placement: 'right',
211
210
  },
212
211
  {
213
- target: '[data-testid="closeSearchIcon"]',
212
+ target: '[data-tutorial-target="close-search-icon"]',
214
213
  content: 'That’s the end of the tutorial. Click on the close button to go back to the home page.',
215
214
  spotlightClicks: true,
216
215
  placement: 'bottom',
@@ -234,18 +233,7 @@ export const configSchema = {
234
233
  spotlightClicks: true,
235
234
  hideNextButton: true,
236
235
  data: {
237
- autoNextOn: '[title="All lists"]',
238
- },
239
- },
240
- {
241
- target: '[title="All lists"]',
242
- content: 'Click here to see all the patient lists we have in the system.',
243
- hideNextButton: true,
244
- hideBackButton: true,
245
- spotlightClicks: true,
246
- spotlightPadding: 20,
247
- data: {
248
- autoNextOn: '[data-testid="patientListsTable"]',
236
+ autoNextOn: '[data-openmrs-role="New List"]',
249
237
  },
250
238
  },
251
239
  {
@@ -256,11 +244,11 @@ export const configSchema = {
256
244
  hideNextButton: true,
257
245
  hideBackButton: true,
258
246
  data: {
259
- autoNextOn: '[data-openmrs-role="Patient List Form"]',
247
+ autoNextOn: '[data-tutorial-target="patient-list-form"]',
260
248
  },
261
249
  },
262
250
  {
263
- target: '[data-openmrs-role="Patient List Form"]',
251
+ target: '[data-tutorial-target="patient-list-form"]',
264
252
  content: 'Enter the necessary details and click on "Create List" to create the list.',
265
253
  spotlightClicks: true,
266
254
  hideBackButton: true,
@@ -271,7 +259,18 @@ export const configSchema = {
271
259
  },
272
260
  },
273
261
  {
274
- target: '[data-testid="patientListsTable"]',
262
+ target: '[data-tutorial-target="all-patient-lists-tab"]',
263
+ content: 'Click here to see all the patient lists we have in the system.',
264
+ hideNextButton: true,
265
+ hideBackButton: true,
266
+ spotlightClicks: true,
267
+ spotlightPadding: 20,
268
+ data: {
269
+ autoNextOn: '[data-tutorial-target="patient-lists-table"]',
270
+ },
271
+ },
272
+ {
273
+ target: '[data-tutorial-target="patient-lists-table"]',
275
274
  content:
276
275
  'Great! We have successfully created a new patient list. Find and click on the patient list you created to proceed. You can use the search option at the top right if needed.',
277
276
  disableOverlay: true,
@@ -285,38 +284,34 @@ export const configSchema = {
285
284
  },
286
285
  {
287
286
  target: '[data-openmrs-role="Patient Empty tile"]',
288
- content: "You can see the patient list is empty since we haven't added any patients to the list yet.",
287
+ content: "You can see the patient list is empty since we haven't added any patients to the list yet. Click on Next to Continue",
289
288
  hideBackButton: true,
290
289
  disableOverlay: true,
291
290
  },
292
291
  {
293
- target: '[data-testid="searchPatientIcon"]',
292
+ target: '[data-tutorial-target="search-patient-icon"]',
294
293
  content:
295
294
  'To add a patient to the list, we have to go to the respective patient’s chart view. Click here to open the search box so that we can search for a patient.',
296
295
  spotlightClicks: true,
297
296
  hideNextButton: true,
298
297
  hideBackButton: true,
299
298
  data: {
300
- autoNextOn: '[data-testid="patientSearchBar"]',
299
+ autoNextOn: '[data-tutorial-target="patient-search-bar"]',
301
300
  },
302
301
  },
303
302
  {
304
- target: '[data-testid="patientSearchBar"]',
303
+ target: '[data-tutorial-target="patient-search-bar"]',
305
304
  content:
306
305
  'Now, enter the name or the ID of the patient here. Some example patient names that you can search for are: John, Smith, Mary.',
307
- hideNextButton: true,
306
+ hideNextButton: false,
308
307
  hideBackButton: true,
309
308
  spotlightClicks: true,
310
- data: {
311
- autoNextOn: '[data-testid="floatingSearchResultsContainer"]',
312
- },
313
309
  },
314
310
  {
315
- target: '[data-testid="floatingSearchResultsContainer"]',
311
+ target: '[data-tutorial-target="floating-search-results-container"]',
316
312
  content:
317
313
  'Click on the patient to go to the patient chart, where we can add the patient to our newly created list.',
318
314
  spotlightClicks: true,
319
- disableOverlay: true,
320
315
  placement: 'left',
321
316
  hideNextButton: true,
322
317
  hideBackButton: true,
@@ -326,9 +321,9 @@ export const configSchema = {
326
321
  },
327
322
  {
328
323
  target: '#custom-actions-overflow-menu-trigger',
329
- content: 'Click on "Action" and select "Add to List" from the drop-down menu.',
324
+ content: 'Click on "Actions" and select "Add to List" from the drop-down menu.',
330
325
  disableOverlay: true,
331
- placement: 'left',
326
+ placement: 'bottom',
332
327
  spotlightClicks: true,
333
328
  hideBackButton: true,
334
329
  hideNextButton: true,
@@ -346,64 +341,36 @@ export const configSchema = {
346
341
  hideNextButton: true,
347
342
  placement: 'left',
348
343
  data: {
349
- autoNextOn: '.omrs-snackbars-container div',
344
+ autoNextOn: '.omrs-snackbars-container div',
350
345
  },
351
- },
352
- {
353
- target: '[aria-label="Close"]',
354
- content:
355
- "We have successfully added a patient to the patient list. Let's go back to the patient lists by closing the patient chart by clicking here.",
356
- spotlightClicks: true,
357
- hideBackButton: true,
358
- hideNextButton: true,
359
- data: {
360
- autoNextOn: '[data-testid="patientsTable"]',
361
- },
362
- },
363
- {
364
- target: '[data-testid="patientsTable"]',
365
- title: 'Patients List',
366
- content: 'You can see the added patient on the list of patients.',
367
- spotlightClicks: true,
368
- hideBackButton: true,
369
- },
370
- {
371
- target: 'body',
372
- content:
373
- 'Congrats! You have now completed the tutorial on creating patient lists and adding patients to the lists.',
374
- placement: 'center',
375
- hideBackButton: true,
376
- },
346
+ }
377
347
  ],
378
348
  },
379
349
  {
380
350
  title: 'Recording Vitals',
381
351
  description:
382
- 'Learn how to record a patient\'s vitals and biometric data, and review the records through the patient chart.',
352
+ "Learn how to record a patient's vitals and biometric data, and review the records through the patient chart.",
383
353
  steps: [
384
354
  {
385
- target: '[data-testid="searchPatientIcon"]',
355
+ target: '[data-tutorial-target="search-patient-icon"]',
386
356
  content:
387
357
  'To capture the vitals of a patient, you need to start by going to the patient chart view of the respective patient. Click on the search icon to open the search box so that you can search for the patient.',
388
358
  spotlightClicks: true,
389
359
  hideNextButton: true,
390
360
  data: {
391
- autoNextOn: '[data-testid="patientSearchBar"]'
392
- },
361
+ autoNextOn: '[data-tutorial-target="patient-search-bar"]',
362
+ },
393
363
  },
394
364
  {
395
- target: '[data-testid="patientSearchBar"]',
365
+ target: '[data-tutorial-target="patient-search-bar"]',
396
366
  content:
397
367
  'Now, enter the name or the ID of the patient here. Some example patient names you can search for are: John, Smith, Mary.',
398
- hideNextButton: true,
368
+ hideNextButton: false,
399
369
  hideBackButton: true,
400
370
  spotlightClicks: true,
401
- data: {
402
- autoNextOn: '[data-testid="floatingSearchResultsContainer"]'
403
- },
404
371
  },
405
372
  {
406
- target: '[data-testid="floatingSearchResultsContainer"]',
373
+ target: '[data-tutorial-target="floating-search-results-container"]',
407
374
  content: 'Click on the patient to go to their patient chart.',
408
375
  placement: 'left',
409
376
  spotlightClicks: true,
@@ -436,7 +403,7 @@ export const configSchema = {
436
403
  hideBackButton: true,
437
404
  hideNextButton: true,
438
405
  data: {
439
- autoNextOn: '.omrs-snackbars-container div'
406
+ autoNextOn: '.omrs-snackbars-container div',
440
407
  },
441
408
  },
442
409
  {
@@ -452,7 +419,7 @@ export const configSchema = {
452
419
  hideNextButton: true,
453
420
  spotlightClicks: true,
454
421
  data: {
455
- autoNextOn: '[data-extension-slot-name="patient-chart-vitals-biometrics-dashboard-slot"]'
422
+ autoNextOn: '[data-extension-slot-name="patient-chart-vitals-biometrics-dashboard-slot"]',
456
423
  },
457
424
  },
458
425
  {
@@ -476,37 +443,34 @@ export const configSchema = {
476
443
  },
477
444
  {
478
445
  title: 'Starting a Patient Visit',
479
- description:
480
- 'Learn how to start a visit for a patient.',
446
+ description: 'Learn how to start a visit for a patient.',
481
447
  steps: [
482
448
  {
483
- target: '[data-testid="searchPatientIcon"]',
449
+ target: '[data-tutorial-target="search-patient-icon"]',
484
450
  content:
485
451
  'To fill out any forms or encounters of a patient, you have to start a visit. To start a patient visit, first you need to go to the patient chart view of the respective patient. Click on the search icon to open the search box so that we can search for the patient. ',
486
452
  disableBeacon: true,
487
453
  spotlightClicks: true,
488
454
  hideNextButton: true,
489
455
  data: {
490
- autoNextOn: '[data-testid="patientSearchBar"]',
456
+ autoNextOn: '[data-tutorial-target="patient-search-bar"]',
491
457
  },
492
458
  },
493
459
  {
494
- target: '[data-testid="patientSearchBar"]',
460
+ target: '[data-tutorial-target="patient-search-bar"]',
495
461
  content:
496
462
  'Now, enter the name or the ID of the patient here. Some example patient names that you can search for are: John, Smith, Mary.',
497
- hideNextButton: true,
463
+ hideNextButton: false,
498
464
  hideBackButton: true,
499
465
  spotlightClicks: true,
500
- data: {
501
- autoNextOn: '[data-testid="floatingSearchResultsContainer"]',
502
- },
466
+
503
467
  },
504
468
  {
505
- target: '[data-testid="floatingSearchResultsContainer"]',
469
+ target: '[data-tutorial-target="floating-search-results-container"]',
506
470
  content:
507
471
  'Click on the patient whose chart you want to access. Make sure to select a patient without the "Active visit" label, as we will start a visit in the next steps of the tutorial.',
508
472
  spotlightClicks: true,
509
- disableOverlay: true,
473
+ disableOverlay: false,
510
474
  placement: 'left',
511
475
  hideNextButton: true,
512
476
  hideBackButton: true,
@@ -608,7 +572,7 @@ export const configSchema = {
608
572
  'Great job! You found the allergies section! This is the end of the tutorial. Feel free to explore the system on your own or check out the other tutorials.',
609
573
  },
610
574
  ],
611
- }
575
+ },
612
576
  ],
613
577
  },
614
578
  };
@@ -623,7 +587,7 @@ export type Config = {
623
587
  title: string;
624
588
  content: string;
625
589
  data?: {
626
- autoNextOn?: boolean;
590
+ autoNextOn?: string;
627
591
  };
628
592
  }[];
629
593
  }[];
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { getAsyncLifecycle, defineConfigSchema, getSyncLifecycle } from '@openmrs/esm-framework';
2
2
  import { configSchema } from './config-schema';
3
- import Tutorial from './tutorial/tutorial';
3
+ import Tutorial from './tutorial/tutorial.component';
4
4
 
5
5
  const moduleName = '@openmrs/esm-user-onboarding-app';
6
6
 
@@ -1,16 +1,16 @@
1
- import React from 'react';
2
- import ReactJoyride, { ACTIONS, type CallBackProps, EVENTS, type Step } from 'react-joyride';
1
+ import React, { useState } from 'react';
2
+ import ReactJoyride, { ACTIONS, type CallBackProps, EVENTS } from 'react-joyride';
3
3
  import { useDefineAppContext } from '@openmrs/esm-framework';
4
- import { type TutorialContext } from './types';
4
+ import { type TutorialContext, type ExtendedStep } from './types';
5
5
  import CustomTooltip from './tooltip/tooltip.component';
6
6
 
7
7
  const RootComponent: React.FC = () => {
8
- const [showTutorial, setShowTutorial] = React.useState(false);
9
- const [steps, setSteps] = React.useState<Step[]>([]);
10
- const [stepIndex, setStepIndex] = React.useState(0);
8
+ const [showTutorial, setShowTutorial] = useState(false);
9
+ const [steps, setSteps] = useState<ExtendedStep[]>([]);
10
+ const [stepIndex, setStepIndex] = useState(0);
11
11
 
12
12
  // Set steps with default step options
13
- const updateSteps = (newSteps: Step[]) => {
13
+ const updateSteps = (newSteps: ExtendedStep[]) => {
14
14
  setSteps(
15
15
  newSteps.map((step) => ({
16
16
  ...step,
@@ -39,7 +39,7 @@ const RootComponent: React.FC = () => {
39
39
  const targetElement = document.querySelector(steps[index].target as string);
40
40
  if (targetElement) {
41
41
  setShowTutorial(true);
42
- clearTimeout(interval);
42
+ clearInterval(interval);
43
43
  }
44
44
  }, 1000);
45
45
  };
@@ -49,7 +49,7 @@ const RootComponent: React.FC = () => {
49
49
  const targetElement = document.querySelector(query);
50
50
  if (targetElement) {
51
51
  setStepIndex(index + 1);
52
- clearTimeout(interval);
52
+ clearInterval(interval);
53
53
  }
54
54
  }, 1000);
55
55
  };
@@ -82,26 +82,30 @@ const RootComponent: React.FC = () => {
82
82
  }
83
83
  };
84
84
 
85
+
86
+
85
87
  return (
86
- <ReactJoyride
87
- callback={handleJoyrideCallback}
88
- continuous
89
- debug={false}
90
- disableOverlayClose={true}
91
- disableScrolling
92
- run={showTutorial}
93
- showProgress
94
- showSkipButton
95
- stepIndex={stepIndex}
96
- steps={steps}
97
- styles={{
98
- options: {
99
- zIndex: 10000,
100
- },
101
- overlay: overlayStyles,
102
- }}
103
- tooltipComponent={(props) => <CustomTooltip {...props} step={steps[props.index]} totalSteps={steps.length} />}
104
- />
88
+ <div onMouseDown={(e)=>{e.stopPropagation()}}>
89
+ <ReactJoyride
90
+ callback={handleJoyrideCallback}
91
+ continuous
92
+ debug={false}
93
+ disableOverlayClose={true}
94
+ disableScrolling
95
+ run={showTutorial}
96
+ showProgress
97
+ showSkipButton
98
+ stepIndex={stepIndex}
99
+ steps={steps}
100
+ styles={{
101
+ options: {
102
+ zIndex: 10000,
103
+ },
104
+ overlay: overlayStyles,
105
+ }}
106
+ tooltipComponent={(props) => <CustomTooltip {...props} step={steps[props.index]} totalSteps={steps.length} />}
107
+ />
108
+ </div>
105
109
  );
106
110
  };
107
111
  export default RootComponent;
package/src/routes.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.openmrs.org/routes.schema.json",
3
3
  "backendDependencies": {
4
4
  "fhir2": ">=1.2",
5
- "webservices.rest": "^2.24.0"
5
+ "webservices.rest": ">=2.2.0"
6
6
  },
7
7
  "extensions": [
8
8
  {
@@ -14,10 +14,10 @@
14
14
  }
15
15
  ],
16
16
  "modals": [
17
- {
18
- "name": "tutorial-modal",
19
- "component": "tutorialModal"
20
- }
17
+ {
18
+ "name": "tutorial-modal",
19
+ "component": "tutorialModal"
20
+ }
21
21
  ],
22
22
  "pages": [
23
23
  {
@@ -2,16 +2,12 @@ import React from 'react';
2
2
  import { Button } from '@carbon/react';
3
3
  import { ArrowLeft, ArrowRight, Close } from '@carbon/react/icons';
4
4
  import { useTranslation } from 'react-i18next';
5
+ import { type TooltipRenderProps } from 'react-joyride';
6
+ import { type ExtendedStep } from '../types';
5
7
  import styles from './tooltip.scss';
6
8
 
7
- interface CustomTooltipProps {
8
- continuous: boolean;
9
- index: number;
10
- step: any;
11
- backProps: any;
12
- skipProps: any;
13
- primaryProps: any;
14
- tooltipProps: any;
9
+ interface CustomTooltipProps extends Omit<TooltipRenderProps, 'step'> {
10
+ step: ExtendedStep;
15
11
  totalSteps: number;
16
12
  }
17
13
 
@@ -1,20 +1,20 @@
1
- @use '@carbon/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type';
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
3
  @use '@openmrs/esm-styleguide/src/vars' as *;
4
4
 
5
5
  .tooltipcontainer {
6
6
  background-color: $ui-02;
7
- padding: spacing.$spacing-05;
7
+ padding: layout.$spacing-05;
8
8
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
9
- max-width: 360px;
10
- border-radius: spacing.$spacing-02;
11
- gap: spacing.$spacing-04;
9
+ max-width: 22.5rem;
10
+ border-radius: layout.$spacing-02;
11
+ gap: layout.$spacing-04;
12
12
 
13
13
  .tooltipheader {
14
14
  display: flex;
15
15
  justify-content: space-between;
16
16
  align-items: center;
17
- margin-bottom: spacing.$spacing-01;
17
+ margin-bottom: layout.$spacing-01;
18
18
 
19
19
  .container {
20
20
  display: flex;
@@ -24,11 +24,11 @@
24
24
 
25
25
  .tooltiptitle {
26
26
  @include type.type-style('heading-02');
27
- margin-bottom: spacing.$spacing-02;
27
+ margin-bottom: layout.$spacing-02;
28
28
  }
29
29
 
30
30
  .closeButton {
31
- min-height: 16px;
31
+ min-height: layout.$spacing-05;
32
32
  padding: 0;
33
33
  align-self: flex-start;
34
34
  }
@@ -38,12 +38,12 @@
38
38
  color: $color-gray-70;
39
39
  @include type.type-style('body-compact-01');
40
40
  width: 100%;
41
- margin-top: spacing.$spacing-01;
41
+ margin-top: layout.$spacing-01;
42
42
  }
43
43
 
44
44
 
45
45
  .tooltipfooter {
46
- margin-top: spacing.$spacing-03;
46
+ margin-top: layout.$spacing-03;
47
47
  display: flex;
48
48
  justify-content: space-between;
49
49
  align-items: center;
@@ -55,27 +55,27 @@
55
55
 
56
56
  .buttonContainer {
57
57
  display: flex;
58
- gap: spacing.$spacing-03;
58
+ gap: layout.$spacing-03;
59
59
 
60
60
  .buttonback,
61
61
  .buttonnext {
62
62
  display: flex;
63
63
  align-items: center;
64
64
  justify-content: center;
65
- padding: spacing.$spacing-02;
66
- width: spacing.$spacing-12;
65
+ padding: layout.$spacing-02;
66
+ width: layout.$spacing-12;
67
67
 
68
68
  .arrowLeft,
69
69
  .arrowContainer {
70
70
  display: flex;
71
71
  align-items: center;
72
72
  justify-content: center;
73
- margin-left: spacing.$spacing-02;
73
+ margin-left: layout.$spacing-02;
74
74
  }
75
75
 
76
76
  .arrowLeft svg {
77
77
  fill: $color-blue-60-2 !important;
78
- margin-right: spacing.$spacing-02;
78
+ margin-right: layout.$spacing-02;
79
79
  }
80
80
  }
81
81
  }