@openmrs/esm-user-onboarding-app 4.0.1-pre.2 → 4.0.1-pre.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.husky/pre-commit +1 -1
- package/.tx/config +11 -0
- package/README.md +62 -13
- package/dist/1119.js +1 -0
- package/dist/1197.js +1 -0
- package/dist/2146.js +1 -0
- package/dist/2690.js +1 -0
- package/dist/282.js +2 -0
- package/dist/282.js.LICENSE.txt +32 -0
- package/dist/282.js.map +1 -0
- package/dist/3099.js +1 -0
- package/dist/3184.js +2 -0
- package/dist/3184.js.LICENSE.txt +14 -0
- package/dist/3184.js.map +1 -0
- package/dist/3584.js +1 -0
- package/dist/4055.js +1 -0
- package/dist/4132.js +1 -0
- package/dist/4300.js +1 -0
- package/dist/4335.js +1 -0
- package/dist/4353.js +1 -0
- package/dist/4353.js.map +1 -0
- package/dist/4618.js +1 -0
- package/dist/4652.js +1 -0
- package/dist/4944.js +1 -0
- package/dist/5059.js +1 -0
- package/dist/5059.js.map +1 -0
- package/dist/5173.js +1 -0
- package/dist/5241.js +1 -0
- package/dist/5442.js +1 -0
- package/dist/5661.js +1 -0
- package/dist/6022.js +1 -0
- package/dist/6399.js +1 -0
- package/dist/6399.js.map +1 -0
- package/dist/6468.js +1 -0
- package/dist/6478.js +1 -0
- package/dist/6478.js.map +1 -0
- package/dist/6540.js +2 -0
- package/dist/6540.js.map +1 -0
- package/dist/6679.js +1 -0
- package/dist/6840.js +1 -0
- package/dist/6859.js +1 -0
- package/dist/7097.js +1 -0
- package/dist/7159.js +1 -0
- package/dist/723.js +1 -0
- package/dist/7617.js +1 -0
- package/dist/7688.js +2 -0
- package/dist/7688.js.LICENSE.txt +24 -0
- package/dist/7688.js.map +1 -0
- package/dist/795.js +1 -0
- package/dist/8163.js +1 -0
- package/dist/8349.js +1 -0
- package/dist/844.js +1 -0
- package/dist/844.js.map +1 -0
- package/dist/8618.js +1 -0
- package/dist/8690.js +1 -0
- package/dist/8690.js.map +1 -0
- package/dist/8719.js +2 -0
- package/dist/{985.js.LICENSE.txt → 8719.js.LICENSE.txt} +0 -20
- package/dist/8719.js.map +1 -0
- package/dist/890.js +1 -0
- package/dist/9214.js +1 -0
- package/dist/9538.js +1 -0
- package/dist/9569.js +1 -0
- package/dist/961.js +2 -0
- package/dist/961.js.LICENSE.txt +19 -0
- package/dist/961.js.map +1 -0
- package/dist/986.js +1 -0
- package/dist/9879.js +1 -0
- package/dist/9895.js +1 -0
- package/dist/9900.js +1 -0
- package/dist/9913.js +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-user-onboarding-app.js +1 -1
- package/dist/openmrs-esm-user-onboarding-app.js.buildmanifest.json +976 -104
- package/dist/openmrs-esm-user-onboarding-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/e2e/README.md +9 -7
- package/e2e/core/test.ts +1 -1
- package/e2e/fixtures/api.ts +1 -1
- package/e2e/pages/home-page.ts +2 -2
- package/e2e/specs/onboarding-test.spec.ts +8 -27
- package/jest.config.js +3 -2
- package/package.json +10 -9
- package/src/config-schema.ts +76 -112
- package/src/declarations.d.ts +2 -0
- package/src/index.ts +1 -1
- package/src/root.component.tsx +32 -28
- package/src/routes.json +4 -4
- package/src/tooltip/tooltip.component.tsx +4 -8
- package/src/tooltip/tooltip.scss +17 -17
- package/src/tutorial/modal.component.tsx +16 -8
- package/src/tutorial/{modal.component.test.tsx → modal.test.tsx} +10 -8
- package/src/tutorial/styles.scss +8 -36
- package/src/tutorial/{tutorial.tsx → tutorial.component.tsx} +1 -5
- package/src/types.ts +15 -5
- package/translations/am.json +9 -1
- package/translations/ar.json +9 -0
- package/translations/ar_SY.json +9 -0
- package/translations/bn.json +9 -0
- package/translations/de.json +9 -0
- package/translations/en_US.json +9 -0
- package/translations/es.json +9 -1
- package/translations/es_MX.json +9 -0
- package/translations/fr.json +9 -1
- package/translations/he.json +9 -1
- package/translations/hi.json +9 -0
- package/translations/hi_IN.json +9 -0
- package/translations/id.json +9 -0
- package/translations/it.json +9 -0
- package/translations/ka.json +9 -0
- package/translations/km.json +9 -1
- package/translations/ku.json +9 -0
- package/translations/ky.json +9 -0
- package/translations/lg.json +9 -0
- package/translations/ne.json +9 -0
- package/translations/pl.json +9 -0
- package/translations/pt.json +9 -0
- package/translations/pt_BR.json +9 -0
- package/translations/qu.json +9 -0
- package/translations/ro_RO.json +9 -0
- package/translations/ru_RU.json +9 -0
- package/translations/si.json +9 -0
- package/translations/sw.json +9 -0
- package/translations/sw_KE.json +9 -0
- package/translations/tr.json +9 -0
- package/translations/tr_TR.json +9 -0
- package/translations/uk.json +9 -0
- package/translations/uz.json +9 -0
- package/translations/uz@Latn.json +9 -0
- package/translations/uz_UZ.json +9 -0
- package/translations/vi.json +9 -0
- package/translations/zh.json +9 -0
- package/translations/zh_CN.json +9 -0
- package/tsconfig.json +2 -1
- package/dist/151.js +0 -2
- package/dist/151.js.LICENSE.txt +0 -3
- package/dist/151.js.map +0 -1
- package/dist/197.js +0 -1
- package/dist/300.js +0 -1
- package/dist/335.js +0 -1
- package/dist/422.js +0 -1
- package/dist/422.js.map +0 -1
- package/dist/540.js +0 -2
- package/dist/540.js.map +0 -1
- package/dist/55.js +0 -1
- package/dist/570.js +0 -1
- package/dist/570.js.map +0 -1
- package/dist/59.js +0 -1
- package/dist/59.js.map +0 -1
- package/dist/652.js +0 -1
- package/dist/743.js +0 -1
- package/dist/743.js.map +0 -1
- package/dist/917.js +0 -1
- package/dist/917.js.map +0 -1
- package/dist/985.js +0 -2
- package/dist/985.js.map +0 -1
- package/dist/99.js +0 -1
- package/src/root.scss +0 -0
- /package/dist/{540.js.LICENSE.txt → 6540.js.LICENSE.txt} +0 -0
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ArrowRight } from '@carbon/react/icons';
|
|
3
|
+
import { ModalHeader, ModalBody, Link } from '@carbon/react';
|
|
2
4
|
import { useTranslation } from 'react-i18next';
|
|
3
5
|
import { useConfig, useAppContext, navigate } from '@openmrs/esm-framework';
|
|
4
|
-
import styles from './styles.scss';
|
|
5
6
|
import { type TutorialContext } from '../types';
|
|
6
|
-
import
|
|
7
|
-
|
|
7
|
+
import styles from './styles.scss';
|
|
8
|
+
|
|
9
|
+
interface TutorialModalProps {
|
|
10
|
+
open: boolean;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
}
|
|
8
13
|
|
|
9
|
-
const TutorialModal = ({ open, onClose }) => {
|
|
14
|
+
const TutorialModal: React.FC<TutorialModalProps> = ({ open, onClose }) => {
|
|
10
15
|
const { t } = useTranslation();
|
|
11
16
|
const config = useConfig();
|
|
12
17
|
const tutorials = config.tutorialData;
|
|
@@ -14,7 +19,7 @@ const TutorialModal = ({ open, onClose }) => {
|
|
|
14
19
|
|
|
15
20
|
const handleWalkthroughClick = (index: number) => {
|
|
16
21
|
const basePath = window.getOpenmrsSpaBase();
|
|
17
|
-
const homePath = `${basePath}home`;
|
|
22
|
+
const homePath = `${basePath}home/service-queues`;
|
|
18
23
|
const currentPath = window.location.pathname;
|
|
19
24
|
const tutorial = tutorials[index];
|
|
20
25
|
|
|
@@ -40,7 +45,7 @@ const TutorialModal = ({ open, onClose }) => {
|
|
|
40
45
|
|
|
41
46
|
return (
|
|
42
47
|
<React.Fragment>
|
|
43
|
-
<ModalHeader closeModal={onClose} title={t('tutorial', 'Tutorial')}
|
|
48
|
+
<ModalHeader closeModal={onClose} title={t('tutorial', 'Tutorial')}>
|
|
44
49
|
<p className={styles.description}>
|
|
45
50
|
{t('modalDescription', 'Find walkthroughs and video tutorials on some of the core features of OpenMRS.')}
|
|
46
51
|
</p>
|
|
@@ -51,8 +56,11 @@ const TutorialModal = ({ open, onClose }) => {
|
|
|
51
56
|
<li className={styles.tutorialItem} key={index}>
|
|
52
57
|
<h3 className={styles.tutorialTitle}>{tutorial.title}</h3>
|
|
53
58
|
<p className={styles.tutorialDescription}>{tutorial.description}</p>
|
|
54
|
-
<Link
|
|
55
|
-
|
|
59
|
+
<Link
|
|
60
|
+
onClick={() => handleWalkthroughClick(index)}
|
|
61
|
+
className={styles.tutorialLink}
|
|
62
|
+
renderIcon={() => <ArrowRight aria-label="Arrow Right" />}
|
|
63
|
+
>
|
|
56
64
|
{t('walkthrough', 'Walkthrough')}
|
|
57
65
|
</Link>
|
|
58
66
|
</li>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { render, screen, waitFor } from '@testing-library/react';
|
|
4
|
+
import { useAppContext, useConfig, navigate } from '@openmrs/esm-framework';
|
|
3
5
|
import TutorialModal from './modal.component';
|
|
4
|
-
import {useAppContext, useConfig, navigate} from "@openmrs/esm-framework";
|
|
5
|
-
import userEvent from '@testing-library/user-event'
|
|
6
6
|
|
|
7
7
|
jest.mock('@openmrs/esm-framework', () => ({
|
|
8
8
|
useConfig: jest.fn(),
|
|
@@ -57,7 +57,6 @@ mockUseAppContext.mockReturnValue({
|
|
|
57
57
|
|
|
58
58
|
describe('TutorialModal', () => {
|
|
59
59
|
afterEach(() => {
|
|
60
|
-
jest.clearAllMocks();
|
|
61
60
|
delete window.location;
|
|
62
61
|
window.location = { pathname: '/patient-registration' } as any;
|
|
63
62
|
});
|
|
@@ -72,14 +71,18 @@ describe('TutorialModal', () => {
|
|
|
72
71
|
},
|
|
73
72
|
});
|
|
74
73
|
|
|
75
|
-
render(<TutorialModal open={true} onClose={jest.fn()}/>);
|
|
74
|
+
render(<TutorialModal open={true} onClose={jest.fn()} />);
|
|
76
75
|
|
|
77
76
|
const walkthroughButton = screen.getAllByText('Walkthrough');
|
|
78
77
|
await user.click(walkthroughButton[0]);
|
|
79
78
|
|
|
80
|
-
expect(
|
|
79
|
+
expect(mockNavigate).toHaveBeenCalledWith(
|
|
80
|
+
expect.objectContaining({
|
|
81
|
+
to: expect.stringContaining('/spa-base/home/service-queues'),
|
|
82
|
+
}),
|
|
83
|
+
);
|
|
81
84
|
Object.defineProperty(window.location, 'pathname', {
|
|
82
|
-
value: '/spa-base/home',
|
|
85
|
+
value: '/spa-base/home/service-queues',
|
|
83
86
|
});
|
|
84
87
|
|
|
85
88
|
await waitFor(() => expect(setSteps).toHaveBeenCalledWith(mockTutorialData[0].steps));
|
|
@@ -95,4 +98,3 @@ describe('TutorialModal', () => {
|
|
|
95
98
|
});
|
|
96
99
|
});
|
|
97
100
|
});
|
|
98
|
-
|
package/src/tutorial/styles.scss
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
@use '@carbon/styles/scss/spacing';
|
|
2
|
-
@use '@carbon/styles/scss/type';
|
|
3
1
|
@use '@carbon/layout';
|
|
4
|
-
@
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
5
4
|
|
|
6
5
|
.description {
|
|
7
|
-
margin-bottom:
|
|
6
|
+
margin-bottom: layout.$spacing-04;
|
|
8
7
|
@include type.type-style('body-compact-01');
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
.tutorialModal {
|
|
12
11
|
display: flex;
|
|
13
12
|
flex-direction: column;
|
|
14
|
-
gap:
|
|
13
|
+
gap: layout.$spacing-04;
|
|
15
14
|
|
|
16
15
|
.tutorialItem {
|
|
17
16
|
border-bottom: 1px solid $ui-03;
|
|
18
|
-
padding-bottom:
|
|
17
|
+
padding-bottom: layout.$spacing-02;
|
|
19
18
|
|
|
20
19
|
.tutorialTitle {
|
|
21
|
-
margin-bottom:
|
|
20
|
+
margin-bottom: layout.$spacing-04;
|
|
22
21
|
@include type.type-style('heading-02');
|
|
23
22
|
}
|
|
24
23
|
|
|
@@ -28,37 +27,10 @@
|
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
.tutorialLink {
|
|
31
|
-
margin-bottom:
|
|
32
|
-
margin-top:
|
|
30
|
+
margin-bottom: layout.$spacing-04;
|
|
31
|
+
margin-top: layout.$spacing-04;
|
|
33
32
|
cursor: pointer;
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
.modalHeader {
|
|
39
|
-
:global {
|
|
40
|
-
.cds--modal-close-button {
|
|
41
|
-
position: absolute;
|
|
42
|
-
inset-block-start: 0;
|
|
43
|
-
inset-inline-end: 0;
|
|
44
|
-
margin: 0;
|
|
45
|
-
margin-top: calc(-1 * #{layout.$spacing-05});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.cds--modal-close {
|
|
49
|
-
background-color: rgba(0, 0, 0, 0);
|
|
50
|
-
|
|
51
|
-
&:hover {
|
|
52
|
-
background-color: var(--cds-layer-hover);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.cds--popover--left > .cds--popover > .cds--popover-content {
|
|
57
|
-
transform: translate(-4rem, 0.85rem);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.cds--popover--left > .cds--popover > .cds--popover-caret {
|
|
61
|
-
transform: translate(-3.75rem, 1.25rem);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -12,11 +12,7 @@ const Tutorial = () => {
|
|
|
12
12
|
});
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
return (
|
|
16
|
-
<>
|
|
17
|
-
<div onClick={handleOpenModal}>{t('tutorials', 'Tutorials')}</div>
|
|
18
|
-
</>
|
|
19
|
-
);
|
|
15
|
+
return <div onClick={handleOpenModal}>{t('tutorials', 'Tutorials')}</div>;
|
|
20
16
|
};
|
|
21
17
|
|
|
22
18
|
export default Tutorial;
|
package/src/types.ts
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import {type Step} from
|
|
1
|
+
import { type Step } from 'react-joyride';
|
|
2
|
+
|
|
3
|
+
export interface ExtendedStep extends Step {
|
|
4
|
+
hideBackButton?: boolean;
|
|
5
|
+
hideNextButton?: boolean;
|
|
6
|
+
hideFooter?: boolean;
|
|
7
|
+
hideCloseButton?: boolean;
|
|
8
|
+
data?: {
|
|
9
|
+
autoNextOn?: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
2
12
|
|
|
3
13
|
export interface Tutorial {
|
|
4
14
|
title: string;
|
|
5
15
|
description: string;
|
|
6
|
-
steps:
|
|
16
|
+
steps: ExtendedStep[];
|
|
7
17
|
}
|
|
8
18
|
|
|
9
19
|
export interface TutorialContext {
|
|
10
20
|
showTutorial: boolean;
|
|
11
|
-
steps:
|
|
21
|
+
steps: ExtendedStep[];
|
|
12
22
|
setShowTutorial: (showTutorial: boolean) => void;
|
|
13
|
-
setSteps: (steps:
|
|
23
|
+
setSteps: (steps: ExtendedStep[]) => void;
|
|
24
|
+
[key: string | number | symbol]: unknown;
|
|
14
25
|
}
|
|
15
|
-
|
package/translations/am.json
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"back": "Back",
|
|
3
|
+
"finish": "Finish",
|
|
4
|
+
"modalDescription": "Find walkthroughs and video tutorials on some of the core features of OpenMRS.",
|
|
5
|
+
"next": "Next",
|
|
6
|
+
"tutorial": "Tutorials",
|
|
7
|
+
"walkthrough": "Walkthrough",
|
|
8
|
+
"welcome": "Welcome to OpenMRS!"
|
|
9
|
+
}
|
package/translations/es.json
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"back": "Back",
|
|
3
|
+
"finish": "Finish",
|
|
4
|
+
"modalDescription": "Find walkthroughs and video tutorials on some of the core features of OpenMRS.",
|
|
5
|
+
"next": "Next",
|
|
6
|
+
"tutorial": "Tutorials",
|
|
7
|
+
"walkthrough": "Walkthrough",
|
|
8
|
+
"welcome": "Welcome to OpenMRS!"
|
|
9
|
+
}
|
package/translations/fr.json
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"back": "Retour",
|
|
3
|
+
"finish": "Terminer",
|
|
4
|
+
"modalDescription": "Vous trouverez des guides et des tutoriels vidéo sur certaines des principales fonctionnalités d'OpenMRS.",
|
|
5
|
+
"next": "Suivant",
|
|
6
|
+
"tutorial": "Tutoriels",
|
|
7
|
+
"walkthrough": "Visite guidée",
|
|
8
|
+
"welcome": "Bienvenue sur OpenMRS !"
|
|
9
|
+
}
|
package/translations/he.json
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"back": "Back",
|
|
3
|
+
"finish": "Finish",
|
|
4
|
+
"modalDescription": "Find walkthroughs and video tutorials on some of the core features of OpenMRS.",
|
|
5
|
+
"next": "Next",
|
|
6
|
+
"tutorial": "Tutorials",
|
|
7
|
+
"walkthrough": "Walkthrough",
|
|
8
|
+
"welcome": "Welcome to OpenMRS!"
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"back": "Kembali",
|
|
3
|
+
"finish": "Selesai",
|
|
4
|
+
"modalDescription": "Temukan panduan dan tutorial video tentang beberapa fitur inti OpenMRS.",
|
|
5
|
+
"next": "Berikutnya",
|
|
6
|
+
"tutorial": "Tutorial",
|
|
7
|
+
"walkthrough": "Panduan",
|
|
8
|
+
"welcome": "Selamat datang di OpenMRS!"
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"back": "Indietro",
|
|
3
|
+
"finish": "Finish",
|
|
4
|
+
"modalDescription": "Find walkthroughs and video tutorials on some of the core features of OpenMRS.",
|
|
5
|
+
"next": "Avanti",
|
|
6
|
+
"tutorial": "Tutorials",
|
|
7
|
+
"walkthrough": "Walkthrough",
|
|
8
|
+
"welcome": "Benvenuto in OpenMRS!"
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"back": "უკან",
|
|
3
|
+
"finish": "დასრულება",
|
|
4
|
+
"modalDescription": "Find walkthroughs and video tutorials on some of the core features of OpenMRS.",
|
|
5
|
+
"next": "შემდეგი",
|
|
6
|
+
"tutorial": "სახელმძღვანელოები",
|
|
7
|
+
"walkthrough": "სწრაფი გავლა",
|
|
8
|
+
"welcome": "მოგესალმებათ OpenMRS!"
|
|
9
|
+
}
|
package/translations/km.json
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"back": "Back",
|
|
3
|
+
"finish": "Finish",
|
|
4
|
+
"modalDescription": "Find walkthroughs and video tutorials on some of the core features of OpenMRS.",
|
|
5
|
+
"next": "Next",
|
|
6
|
+
"tutorial": "Tutorials",
|
|
7
|
+
"walkthrough": "Walkthrough",
|
|
8
|
+
"welcome": "Welcome to OpenMRS!"
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"back": "Înapoi",
|
|
3
|
+
"finish": "Finalizare",
|
|
4
|
+
"modalDescription": "Găsește ghiduri pas cu pas și tutoriale video despre unele dintre funcționalitățile de bază ale OpenMRS.",
|
|
5
|
+
"next": "Următorul",
|
|
6
|
+
"tutorial": "Tutoriale",
|
|
7
|
+
"walkthrough": "Ghid pas cu pas",
|
|
8
|
+
"welcome": "Bine ai venit în OpenMRS!"
|
|
9
|
+
}
|