@openmrs/esm-user-onboarding-app 4.0.1-pre.25 → 4.0.1-pre.253

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 (67) 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 -0
  12. package/dist/6399.js.map +1 -0
  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 -0
  18. package/dist/8690.js.map +1 -0
  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/2154.js +0 -1
  57. package/dist/2154.js.map +0 -1
  58. package/dist/553.js +0 -2
  59. package/dist/553.js.map +0 -1
  60. package/dist/8093.js +0 -2
  61. package/dist/8093.js.map +0 -1
  62. package/dist/8557.js +0 -1
  63. package/dist/8557.js.map +0 -1
  64. package/dist/8674.js +0 -1
  65. package/dist/8674.js.map +0 -1
  66. package/src/root.scss +0 -0
  67. /package/dist/{8093.js.LICENSE.txt → 1904.js.LICENSE.txt} +0 -0
package/e2e/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # E2E Tests
2
2
 
3
3
  This directory contains an E2E test suite using the [Playwright](https://playwright.dev)
4
- framework.
4
+ framework.
5
5
 
6
6
  ## Getting Started
7
7
 
@@ -12,6 +12,7 @@ Once everything is set up, make sure the dev server is running by using:
12
12
  ```sh
13
13
  yarn start --sources 'packages/esm-*-app/'
14
14
  ```
15
+
15
16
  Then, in a separate terminal, run:
16
17
 
17
18
  ```sh
@@ -28,15 +29,16 @@ export E2E_BASE_URL=https://dev3.openmrs.org/openmrs
28
29
  # Run all e2e tests:
29
30
  yarn test-e2e --headed
30
31
  ```
32
+
31
33
  To run a specific test by title:
34
+
32
35
  ```sh
33
36
  yarn test-e2e --headed -g "title of the test"
34
37
  ```
35
- Check [this documentation](https://playwright.dev/docs/running-tests#command-line) for more running options.
36
38
 
37
- It is also highly recommended to install the companion VS Code extension:
38
- https://playwright.dev/docs/getting-started-vscode
39
+ Check [this documentation](https://playwright.dev/docs/running-tests#command-line) for more running options.
39
40
 
41
+ It is also highly recommended to install the companion [VS Code extension](https://playwright.dev/docs/getting-started-vscode).
40
42
 
41
43
  ## Writing New Tests
42
44
 
@@ -44,7 +46,7 @@ In general, it is recommended to read through the official [Playwright docs](htt
44
46
  before writing new test cases. The project uses the official Playwright test runner and,
45
47
  generally, follows a very simple project structure:
46
48
 
47
- ```
49
+ ```sh
48
50
  e2e
49
51
  |__ commands
50
52
  | ^ Contains "commands" (simple reusable functions) that can be used in test cases/specs,
@@ -92,14 +94,14 @@ This is very much underdeveloped/WIP. At the moment, there exists a (git-shared)
92
94
  file which can be used for configuring certain test attributes. This is most likely
93
95
  about to change in the future. Stay tuned for updates!
94
96
 
95
-
96
97
  ## Github Action integration
98
+
97
99
  The e2e.yml workflow is made up of two jobs: one for running on pull requests (PRs) and
98
100
  one for running on commits.
99
101
 
100
102
  1. When running on PRs, the workflow will start the dev server, use dev3.openmrs.org as the backend,
101
103
  and run tests only on chromium. This is done in order to quickly provide feedback to the developer.
102
- The tests are designed to generate their own data and clean up after themselves once they are finished.
104
+ The tests are designed to generate their own data and clean up after themselves once they are finished.
103
105
  This ensures that the tests will have minimum effect from changes made to dev3 by other developers.
104
106
  In the future, we plan to use a docker container to run the tests in an isolated environment once we
105
107
  figure out a way to spin up the container within a small amount of time.
package/e2e/core/test.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { APIRequestContext, Page, test as base } from '@playwright/test';
1
+ import { type APIRequestContext, type Page, test as base } from '@playwright/test';
2
2
  import { api } from '../fixtures';
3
3
 
4
4
  // This file sets up our custom test harness using the custom fixtures.
@@ -1,4 +1,4 @@
1
- import { APIRequestContext, PlaywrightWorkerArgs, WorkerFixture } from '@playwright/test';
1
+ import type { APIRequestContext, PlaywrightWorkerArgs, WorkerFixture } from '@playwright/test';
2
2
 
3
3
  /**
4
4
  * A fixture which initializes an [`APIRequestContext`](https://playwright.dev/docs/api/class-apirequestcontext)
@@ -1,9 +1,9 @@
1
- import { Page } from '@playwright/test';
1
+ import type { Page } from '@playwright/test';
2
2
 
3
3
  export class HomePage {
4
4
  constructor(readonly page: Page) {}
5
5
 
6
6
  async goto() {
7
- await this.page.goto(`home`);
7
+ await this.page.goto('/openmrs/spa/home/service-queues');
8
8
  }
9
9
  }
@@ -1,6 +1,5 @@
1
- import { test } from '@playwright/test';
1
+ import { test, expect } from '@playwright/test';
2
2
  import { HomePage } from '../pages';
3
- import { expect } from '@playwright/test';
4
3
 
5
4
  test('Basic Walkthrough', async ({ page }) => {
6
5
  const homePage = new HomePage(page);
@@ -10,7 +9,10 @@ test('Basic Walkthrough', async ({ page }) => {
10
9
  });
11
10
 
12
11
  await test.step('And I click on the help menu button', async () => {
13
- await page.locator('[id="single-spa-application\\:\\@openmrs\\/esm-help-menu-app-page-0"]').getByRole('button').click();
12
+ await page
13
+ .locator('[id="single-spa-application\\:\\@openmrs\\/esm-help-menu-app-page-0"]')
14
+ .getByRole('button')
15
+ .click();
14
16
  });
15
17
 
16
18
  await test.step('And I click on the tutorials button', async () => {
@@ -25,11 +27,7 @@ test('Basic Walkthrough', async ({ page }) => {
25
27
  });
26
28
 
27
29
  await test.step('And I click on the Basic Overview Tutorial', async () => {
28
- await page
29
- .locator('li')
30
- .filter({ hasText: 'Basic Overview' })
31
- .locator('a', { hasText: 'Walkthrough' })
32
- .click();
30
+ await page.locator('li').filter({ hasText: 'Basic Overview' }).locator('a', { hasText: 'Walkthrough' }).click();
33
31
  });
34
32
 
35
33
  await test.step('Then I should see the first Joyride tooltip', async () => {
@@ -49,6 +47,7 @@ test('Basic Walkthrough', async ({ page }) => {
49
47
  page.getByText('This is the search icon. Use it to find patients in the system quickly.'),
50
48
  ).toBeVisible();
51
49
  });
50
+
52
51
  await test.step('And I click the next button', async () => {
53
52
  await page.getByLabel('Next', { exact: true }).click();
54
53
  });
@@ -58,6 +57,7 @@ test('Basic Walkthrough', async ({ page }) => {
58
57
  page.getByText('This is the add patient icon. Click here to register a new patient into the system.'),
59
58
  ).toBeVisible();
60
59
  });
60
+
61
61
  await test.step('And I click the next button', async () => {
62
62
  await page.getByLabel('Next', { exact: true }).click();
63
63
  });
@@ -67,25 +67,6 @@ test('Basic Walkthrough', async ({ page }) => {
67
67
  page.getByText('The user icon. Click here to change your user preferences and settings.'),
68
68
  ).toBeVisible();
69
69
  });
70
- await test.step('And I click the next button', async () => {
71
- await page.getByLabel('Next', { exact: true }).click();
72
- });
73
-
74
- await test.step('Then I should see the active visits Joyride tooltip', async () => {
75
- await expect(
76
- page.getByText('This table displays active visits. Here you can see all the ongoing patient visits.'),
77
- ).toBeVisible();
78
- });
79
-
80
- await test.step('And I click the next button', async () => {
81
- await page.getByLabel('Next', { exact: true }).click();
82
- });
83
-
84
- await test.step('And I should see the appointments table Joyride tooltip', async () => {
85
- await expect(
86
- page.getByText('This table shows appointments. View and manage patient appointments from this section.'),
87
- ).toBeVisible();
88
- });
89
70
 
90
71
  await test.step('And I click the finish button', async () => {
91
72
  await page.getByLabel('Last').click();
package/jest.config.js CHANGED
@@ -4,6 +4,7 @@
4
4
  const path = require('path');
5
5
 
6
6
  module.exports = {
7
+ clearMocks: true,
7
8
  collectCoverageFrom: [
8
9
  '**/src/**/*.component.tsx',
9
10
  '!**/node_modules/**',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-user-onboarding-app",
3
- "version": "4.0.1-pre.25",
3
+ "version": "4.0.1-pre.253",
4
4
  "license": "MPL-2.0",
5
5
  "description": "An OpenMRS microfrontend for user onboarding walkthroughs",
6
6
  "browser": "dist/openmrs-esm-user-onboarding-app.js",
@@ -48,7 +48,7 @@
48
48
  "@openmrs/esm-framework": "*",
49
49
  "dayjs": "1.x",
50
50
  "react": "18.x",
51
- "react-i18next": "11.x",
51
+ "react-i18next": "16.x",
52
52
  "react-router-dom": "6.x",
53
53
  "rxjs": "6.x"
54
54
  },
@@ -64,8 +64,8 @@
64
64
  "@testing-library/react": "^15.0.6",
65
65
  "@testing-library/user-event": "^14.5.2",
66
66
  "@types/jest": "^29.5.12",
67
- "@types/react": "^18.2.14",
68
- "@types/react-dom": "^18.2.6",
67
+ "@types/react": "^18.3.21",
68
+ "@types/react-dom": "^18.3.0",
69
69
  "@types/react-router": "^5.1.20",
70
70
  "@types/react-router-dom": "^5.3.3",
71
71
  "@types/webpack-env": "^1.18.1",
@@ -79,8 +79,8 @@
79
79
  "eslint-plugin-prettier": "^5.1.3",
80
80
  "eslint-plugin-react-hooks": "^4.6.2",
81
81
  "husky": "^8.0.3",
82
- "i18next": "^23.2.8",
83
- "i18next-parser": "^8.0.0",
82
+ "i18next": "^25.0.0",
83
+ "i18next-parser": "^9.3.0",
84
84
  "identity-obj-proxy": "^3.0.0",
85
85
  "jest": "^29.7.0",
86
86
  "jest-cli": "^29.7.0",
@@ -88,14 +88,14 @@
88
88
  "lint-staged": "^15.2.2",
89
89
  "openmrs": "next",
90
90
  "prettier": "^2.8.8",
91
- "react": "^18.2.0",
92
- "react-dom": "^18.2.0",
91
+ "react": "^18.3.1",
92
+ "react-dom": "^18.3.1",
93
93
  "react-i18next": "^11.18.6",
94
94
  "react-router-dom": "^6.14.1",
95
95
  "rxjs": "^6.6.7",
96
96
  "swc-loader": "^0.2.3",
97
97
  "turbo": "^2.5.2",
98
- "typescript": "^4.9.5",
98
+ "typescript": "^5.0.0",
99
99
  "webpack": "^5.99.9",
100
100
  "webpack-cli": "^6.0.1"
101
101
  },
@@ -103,6 +103,6 @@
103
103
  "packages/**/src/**/*.{ts,tsx}": "eslint --cache --fix --max-warnings 0",
104
104
  "*.{css,scss,ts,tsx}": "prettier --write --list-different"
105
105
  },
106
- "packageManager": "yarn@4.9.1",
106
+ "packageManager": "yarn@4.10.3",
107
107
  "stableVersion": "4.0.0"
108
108
  }
@@ -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