@mbehenri/openmrs-esm-opentms-meet-app 1.0.1 → 1.0.3

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 (109) hide show
  1. package/.eslintrc +1 -1
  2. package/.husky/pre-commit +2 -2
  3. package/.husky/pre-push +0 -0
  4. package/.turbo.json +1 -1
  5. package/README.md +25 -14
  6. package/__mocks__/react-i18next.js +9 -14
  7. package/dist/147.js +1 -0
  8. package/dist/147.js.map +1 -0
  9. package/dist/184.js +2 -0
  10. package/dist/184.js.LICENSE.txt +14 -0
  11. package/dist/184.js.map +1 -0
  12. package/dist/197.js +1 -0
  13. package/dist/23.js +1 -0
  14. package/dist/23.js.map +1 -0
  15. package/dist/26.js +1 -0
  16. package/dist/26.js.map +1 -0
  17. package/dist/282.js +2 -0
  18. package/dist/282.js.LICENSE.txt +32 -0
  19. package/dist/282.js.map +1 -0
  20. package/dist/300.js +1 -0
  21. package/dist/335.js +1 -0
  22. package/dist/353.js +1 -0
  23. package/dist/353.js.map +1 -0
  24. package/dist/471.js +1 -0
  25. package/dist/471.js.map +1 -0
  26. package/dist/509.js +2 -0
  27. package/dist/509.js.LICENSE.txt +54 -0
  28. package/dist/509.js.map +1 -0
  29. package/dist/51.js +1 -0
  30. package/dist/51.js.map +1 -0
  31. package/dist/540.js +2 -0
  32. package/dist/540.js.LICENSE.txt +9 -0
  33. package/dist/540.js.map +1 -0
  34. package/dist/55.js +1 -0
  35. package/dist/652.js +1 -0
  36. package/dist/740.js +1 -0
  37. package/dist/740.js.map +1 -0
  38. package/dist/852.js +1 -0
  39. package/dist/852.js.map +1 -0
  40. package/dist/864.js +1 -0
  41. package/dist/864.js.map +1 -0
  42. package/dist/897.js +2 -0
  43. package/dist/897.js.LICENSE.txt +24 -0
  44. package/dist/897.js.map +1 -0
  45. package/dist/91.js +1 -0
  46. package/dist/91.js.map +1 -0
  47. package/dist/961.js +2 -0
  48. package/dist/961.js.LICENSE.txt +19 -0
  49. package/dist/961.js.map +1 -0
  50. package/dist/99.js +1 -0
  51. package/dist/b8b28cec32e885bb.png +0 -0
  52. package/dist/main.js +1 -0
  53. package/dist/main.js.map +1 -0
  54. package/dist/openmrs-esm-opentms-meet-app.js +1 -0
  55. package/dist/openmrs-esm-opentms-meet-app.js.buildmanifest.json +678 -0
  56. package/dist/openmrs-esm-opentms-meet-app.js.map +1 -0
  57. package/dist/routes.json +1 -0
  58. package/e2e/core/global-setup.ts +8 -8
  59. package/e2e/core/index.ts +1 -1
  60. package/e2e/core/test.ts +3 -3
  61. package/e2e/fixtures/api.ts +2 -9
  62. package/e2e/fixtures/index.ts +1 -1
  63. package/e2e/pages/index.ts +1 -1
  64. package/e2e/pages/root-page.ts +32 -0
  65. package/e2e/specs/template-app.spec.ts +23 -0
  66. package/e2e/support/github/Dockerfile +1 -1
  67. package/e2e/support/github/docker-compose.yml +2 -2
  68. package/e2e/support/github/run-e2e-docker-env.sh +13 -25
  69. package/jest.config.js +19 -17
  70. package/package.json +44 -45
  71. package/playwright.config.ts +9 -11
  72. package/prettier.config.js +8 -0
  73. package/src/components/Appointment/index.scss +1 -1
  74. package/src/components/Appointment/index.tsx +30 -58
  75. package/src/components/Demand/tab.scss +1 -1
  76. package/src/components/Demand/tab.tsx +38 -58
  77. package/src/components/EmptyLayout/index.scss +1 -1
  78. package/src/components/MeetIframe/index.tsx +16 -35
  79. package/src/config-schema.ts +5 -5
  80. package/src/dashboard.meta.ts +6 -6
  81. package/src/extensions/AppointmentTabExt.tsx +17 -0
  82. package/src/{Extensions → extensions}/DemandTabExt.tsx +2 -2
  83. package/src/{Extensions → extensions}/MeetIframeExt.tsx +2 -2
  84. package/src/{Extensions → extensions}/ValidateDemandFormExt.tsx +5 -6
  85. package/src/index.ts +11 -31
  86. package/src/pages/home/home.component.tsx +2 -2
  87. package/src/repositories/opentms/index.ts +10 -0
  88. package/src/repositories/{Opencare → opentms}/prodRepository.ts +36 -65
  89. package/src/repositories/{Opencare → opentms}/repository.ts +5 -8
  90. package/src/root.component.tsx +8 -19
  91. package/src/root.scss +5 -5
  92. package/src/root.test.tsx +9 -14
  93. package/src/routes.json +6 -11
  94. package/src/services/doctor.ts +13 -22
  95. package/{i18next-parser.config.js → tools/i18next-parser.config.js} +19 -19
  96. package/tools/setup-tests.ts +1 -0
  97. package/tools/update-openmrs-deps.mjs +43 -0
  98. package/translations/am.json +24 -0
  99. package/translations/en.json +24 -1
  100. package/tsconfig.json +1 -1
  101. package/webpack.config.js +1 -1
  102. package/.yarn/install-state.gz +0 -0
  103. package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +0 -541
  104. package/.yarn/releases/yarn-3.6.1.cjs +0 -874
  105. package/.yarnrc.yml +0 -9
  106. package/e2e/pages/home-page.ts +0 -9
  107. package/e2e/specs/sample-test.spec.ts +0 -11
  108. package/src/Extensions/AppointmentTabExt.tsx +0 -23
  109. package/src/repositories/Opencare/index.ts +0 -12
@@ -1,56 +1,44 @@
1
- import React, { useCallback, useEffect, useMemo, useState } from "react";
2
- import { useTranslation } from "react-i18next";
3
- import {
4
- ContentSwitcher,
5
- DataTableSkeleton,
6
- Layer,
7
- Switch,
8
- Tile,
9
- } from "@carbon/react";
1
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { ContentSwitcher, DataTableSkeleton, Layer, Switch, Tile } from '@carbon/react';
10
4
  import {
11
5
  getCurrentUser,
12
6
  useConfig,
13
7
  useLayoutType,
14
8
  useSession,
15
9
  //launchWorkspaces
16
- } from "@openmrs/esm-framework";
17
- import PatientAppointmentsTable from "./tab";
18
- import styles from "./index.scss";
19
- import DoctorService, { AppointmentTypes } from "../../services/doctor";
20
- import env from "../../repositories/env";
21
- import { MeetIframe } from "../MeetIframe";
10
+ } from '@openmrs/esm-framework';
11
+ import PatientAppointmentsTable from './tab';
12
+ import styles from './index.scss';
13
+ import DoctorService, { AppointmentTypes } from '../../services/doctor';
14
+ import env from '../../repositories/env';
15
+ import { MeetIframe } from '../MeetIframe';
22
16
 
23
17
  interface PatientAppointmentsBaseProps {
24
18
  patientUuid: string;
25
19
  }
26
20
 
27
- const PatientAppointmentsBase: React.FC<PatientAppointmentsBaseProps> = ({
28
- patientUuid,
29
- }) => {
21
+ const PatientAppointmentsBase: React.FC<PatientAppointmentsBaseProps> = ({ patientUuid }) => {
30
22
  //I. hooks
31
23
  const { t } = useTranslation();
32
- const isTablet = useLayoutType() === "tablet";
33
- const [contentSwitcherValue, setContentSwitcherValue] = useState(
34
- AppointmentTypes.UPCOMING
35
- );
24
+ const isTablet = useLayoutType() === 'tablet';
25
+ const [contentSwitcherValue, setContentSwitcherValue] = useState(AppointmentTypes.UPCOMING);
36
26
  const [loading, setLoading] = useState(true);
37
27
  const [error, setError] = useState(false);
38
- const [appointments, setAppointments] = useState<Map<number, Array<any>>>(
39
- new Map()
40
- );
28
+ const [appointments, setAppointments] = useState<Map<number, Array<any>>>(new Map());
41
29
 
42
- const [tokenNextcloud, setTokenNextcloud] = useState("");
30
+ const [tokenNextcloud, setTokenNextcloud] = useState('');
43
31
 
44
32
  const { user } = useSession();
45
33
 
46
- const [url, setUrl] = useState("");
34
+ const [url, setUrl] = useState('');
47
35
 
48
36
  //recupération de la configuration
49
37
  const conf = useConfig();
50
38
 
51
39
  // update env variable
52
- env.API_SECURE = conf["API_SECURE"];
53
- env.API_BASE_URL = conf["API_BASE_URL"];
40
+ env.API_SECURE = conf['API_SECURE'];
41
+ env.API_BASE_URL = conf['API_BASE_URL'];
54
42
  const doctorService = useMemo(() => DoctorService.getInstance(), []);
55
43
 
56
44
  // chargement des appointements
@@ -96,7 +84,7 @@ const PatientAppointmentsBase: React.FC<PatientAppointmentsBaseProps> = ({
96
84
 
97
85
  const handleUrlMeeting = useCallback((url: string) => {
98
86
  setUrl(url);
99
- /* launchWorkspace("opencare-meet-iframe", {
87
+ /* launchWorkspace("opentms-meet-iframe", {
100
88
  url,
101
89
  context: "view",
102
90
  }); */
@@ -115,14 +103,14 @@ const PatientAppointmentsBase: React.FC<PatientAppointmentsBaseProps> = ({
115
103
  <>
116
104
  <div className={styles.contentSwitcherWrapper}>
117
105
  <ContentSwitcher
118
- size={isTablet ? "md" : "sm"}
106
+ size={isTablet ? 'md' : 'sm'}
119
107
  onChange={({ index }) => {
120
108
  setContentSwitcherValue(index);
121
109
  }}
122
110
  >
123
- <Switch name={"upcoming"} text={t("upcoming", "Upcoming")} />
124
- <Switch name={"today"} text={t("today", "Today")} />
125
- <Switch name={"past"} text={t("past", "Past")} />
111
+ <Switch name={'upcoming'} text={t('upcoming', 'Upcoming')} />
112
+ <Switch name={'today'} text={t('today', 'Today')} />
113
+ <Switch name={'past'} text={t('past', 'Past')} />
126
114
  </ContentSwitcher>
127
115
  </div>
128
116
 
@@ -141,8 +129,8 @@ const PatientAppointmentsBase: React.FC<PatientAppointmentsBaseProps> = ({
141
129
  <Tile className={styles.tile}>
142
130
  <p className={styles.content}>
143
131
  {t(
144
- "noUpcomingAppointmentsForPatient",
145
- "There are no upcoming appointments to display for this patient"
132
+ 'noUpcomingAppointmentsForPatient',
133
+ 'There are no upcoming appointments to display for this patient',
146
134
  )}
147
135
  </p>
148
136
  </Tile>
@@ -154,9 +142,7 @@ const PatientAppointmentsBase: React.FC<PatientAppointmentsBaseProps> = ({
154
142
  <Layer>
155
143
  <Tile className={styles.tile}>
156
144
  <p className={styles.content}>
157
- {
158
- "There are no appointments scheduled for today to display for this patient"
159
- }
145
+ {'There are no appointments scheduled for today to display for this patient'}
160
146
  </p>
161
147
  </Tile>
162
148
  </Layer>
@@ -166,34 +152,20 @@ const PatientAppointmentsBase: React.FC<PatientAppointmentsBaseProps> = ({
166
152
  return (
167
153
  <Layer>
168
154
  <Tile className={styles.tile}>
169
- <p className={styles.content}>
170
- {"There are no past appointments to display for this patient"}
171
- </p>
155
+ <p className={styles.content}>{'There are no past appointments to display for this patient'}</p>
172
156
  </Tile>
173
157
  </Layer>
174
158
  );
175
159
  }
176
160
 
177
- if (url != "") {
178
- return (
179
- <iframe
180
- title="Web Meeting"
181
- src={url}
182
- style={{ width: "100%", height: "500px" }}
183
- />
184
- );
161
+ if (url != '') {
162
+ return <iframe title="Web Meeting" src={url} style={{ width: '100%', height: '500px' }} />;
185
163
  }
186
164
  })()}
187
165
 
188
166
  {(() => {
189
- if (url != "") {
190
- return (
191
- <MeetIframe
192
- url={url}
193
- username={user.display}
194
- token={tokenNextcloud}
195
- />
196
- );
167
+ if (url != '') {
168
+ return <MeetIframe url={url} username={user.display} token={tokenNextcloud} />;
197
169
  }
198
170
  })()}
199
171
  </>
@@ -1,7 +1,7 @@
1
1
  @use '@carbon/colors';
2
2
  @use '@carbon/layout';
3
3
  @use '@carbon/type';
4
- @import '~@openmrs/esm-styleguide/src/vars';
4
+ @use '@openmrs/esm-styleguide/src/vars' as *;
5
5
 
6
6
  .totalDemand {
7
7
  @include type.type-style('heading-compact-02');
@@ -1,5 +1,5 @@
1
- import React, { useCallback, useEffect, useMemo } from "react";
2
- import { useState } from "react";
1
+ import React, { useCallback, useEffect, useMemo } from 'react';
2
+ import { useState } from 'react';
3
3
  import {
4
4
  Button,
5
5
  DataTable,
@@ -15,7 +15,7 @@ import {
15
15
  TableRow,
16
16
  Tile,
17
17
  Pagination,
18
- } from "@carbon/react";
18
+ } from '@carbon/react';
19
19
 
20
20
  import {
21
21
  type ToastType,
@@ -27,14 +27,14 @@ import {
27
27
  formatDatetime,
28
28
  parseDate,
29
29
  usePagination,
30
- } from "@openmrs/esm-framework";
31
- import { EmptyLayout } from "../EmptyLayout";
32
- import styles from "./tab.scss";
33
- import DoctorService from "../../services/doctor";
34
- import env from "../../repositories/env";
35
- import { Search } from "@carbon/react";
36
- import { useTranslation } from "react-i18next";
37
- import { getPageSizes } from "../../utils";
30
+ } from '@openmrs/esm-framework';
31
+ import { EmptyLayout } from '../EmptyLayout';
32
+ import styles from './tab.scss';
33
+ import DoctorService from '../../services/doctor';
34
+ import env from '../../repositories/env';
35
+ import { Search } from '@carbon/react';
36
+ import { useTranslation } from 'react-i18next';
37
+ import { getPageSizes } from '../../utils';
38
38
 
39
39
  const DemandTab: React.FC = (/* {} */) => {
40
40
  //I. hooks
@@ -42,9 +42,9 @@ const DemandTab: React.FC = (/* {} */) => {
42
42
  const { t } = useTranslation();
43
43
  const [error, setError] = useState(false);
44
44
  const layout = useLayoutType();
45
- const responsiveSize = isDesktop(layout) ? "sm" : "lg";
45
+ const responsiveSize = isDesktop(layout) ? 'sm' : 'lg';
46
46
  const [demands, setDemands] = useState([]);
47
- const [searchString, setSearchString] = useState("");
47
+ const [searchString, setSearchString] = useState('');
48
48
  const [processing, setProcessing] = useState(false);
49
49
  const [pageSize, setPageSize] = useState(5);
50
50
 
@@ -53,21 +53,21 @@ const DemandTab: React.FC = (/* {} */) => {
53
53
 
54
54
  // update env variable
55
55
 
56
- env.API_BASE_URL = conf["API_BASE_URL"];
57
- env.API_SECURE = conf["API_SECURE"];
56
+ env.API_BASE_URL = conf['API_BASE_URL'];
57
+ env.API_SECURE = conf['API_SECURE'];
58
58
  const doctorService = useMemo(() => DoctorService.getInstance(), []);
59
59
 
60
60
  //const [reload, setReload] = useState("");
61
61
  // colonnes du tableau
62
62
  const headers: Array<typeof DataTableHeader> = useMemo(
63
63
  () => [
64
- { key: "numero", header: "" },
65
- { key: "patient", header: "Patient" },
66
- { key: "service", header: "Service" },
67
- { key: "date", header: "Date" },
68
- { key: "action", header: "Action" },
64
+ { key: 'numero', header: '' },
65
+ { key: 'patient', header: 'Patient' },
66
+ { key: 'service', header: 'Service' },
67
+ { key: 'date', header: 'Date' },
68
+ { key: 'action', header: 'Action' },
69
69
  ],
70
- []
70
+ [],
71
71
  );
72
72
 
73
73
  // chargement des démandes
@@ -110,13 +110,13 @@ const DemandTab: React.FC = (/* {} */) => {
110
110
  return {
111
111
  ...demand,
112
112
  date: formatDatetime(parseDate(demand.date), {
113
- mode: "wide",
113
+ mode: 'wide',
114
114
  }),
115
115
  numero: i + 1,
116
116
  };
117
117
  })
118
118
  .filter((demand) => {
119
- if (searchString === "") {
119
+ if (searchString === '') {
120
120
  return true;
121
121
  }
122
122
  if (demand.date && `${demand.date}`.includes(searchString)) {
@@ -127,7 +127,7 @@ const DemandTab: React.FC = (/* {} */) => {
127
127
  }
128
128
  return false;
129
129
  }),
130
- [demands, searchString]
130
+ [demands, searchString],
131
131
  );
132
132
 
133
133
  // pagination des demandes
@@ -139,14 +139,14 @@ const DemandTab: React.FC = (/* {} */) => {
139
139
  if (!processing) {
140
140
  setProcessing(true);
141
141
  const res = await doctorService.rejectDemand(demand.id);
142
- let message = "";
143
- let type: ToastType = "error";
142
+ let message = '';
143
+ let type: ToastType = 'error';
144
144
  if (res) {
145
145
  message = `the demand initiated by ${demand.patient} have been rejected`;
146
146
  await doctorService.getDemands().then((demands) => {
147
147
  if (demands) {
148
148
  setDemands(demands);
149
- type = "success";
149
+ type = 'success';
150
150
  } else {
151
151
  setError(true);
152
152
  }
@@ -158,7 +158,7 @@ const DemandTab: React.FC = (/* {} */) => {
158
158
  showToast({ description: message, kind: type });
159
159
  }
160
160
  },
161
- [doctorService, processing]
161
+ [doctorService, processing],
162
162
  );
163
163
 
164
164
  // fonction de validation
@@ -167,7 +167,7 @@ const DemandTab: React.FC = (/* {} */) => {
167
167
  if (!processing) {
168
168
  setProcessing(true);
169
169
  const dispose = showModal(
170
- "opencare-validate-demand-form",
170
+ 'opentms-validate-demand-form',
171
171
  {
172
172
  demand,
173
173
  onClose: () => {
@@ -183,11 +183,11 @@ const DemandTab: React.FC = (/* {} */) => {
183
183
  }
184
184
  });
185
185
  setProcessing(false);
186
- }
186
+ },
187
187
  );
188
188
  }
189
189
  },
190
- [doctorService, processing]
190
+ [doctorService, processing],
191
191
  );
192
192
 
193
193
  // II. returns
@@ -200,57 +200,37 @@ const DemandTab: React.FC = (/* {} */) => {
200
200
  }
201
201
 
202
202
  if (demands.length == 0) {
203
- return <EmptyLayout headerTitle={"Demands"} displayText={"demands"} />;
203
+ return <EmptyLayout headerTitle={'Demands'} displayText={'demands'} />;
204
204
  }
205
205
 
206
206
  return (
207
207
  <Layer className={styles.container}>
208
208
  <Tile className={styles.headerContainer}>
209
- <div
210
- className={
211
- isDesktop(layout) ? styles.desktopHeading : styles.tabletHeading
212
- }
213
- >
209
+ <div className={isDesktop(layout) ? styles.desktopHeading : styles.tabletHeading}>
214
210
  <h4>Demands</h4>
215
211
  </div>
216
212
  <span className={styles.totalDemand}>
217
- Total :
218
- <span className={styles.totalDemandLength}>{demands.length}</span>
213
+ Total :<span className={styles.totalDemandLength}>{demands.length}</span>
219
214
  </span>
220
215
  </Tile>
221
216
  <div className={styles.toolbar}>
222
217
  <Search
223
218
  className={styles.searchbar}
224
219
  labelText=""
225
- placeholder={t("filterTable", "Filter table")}
220
+ placeholder={t('filterTable', 'Filter table')}
226
221
  onChange={(event) => setSearchString(event.target.value)}
227
222
  size={responsiveSize}
228
223
  />
229
224
  </div>
230
- <DataTable
231
- rows={results}
232
- headers={headers}
233
- isSortable
234
- size={responsiveSize}
235
- useZebraStyles
236
- >
237
- {({
238
- rows,
239
- headers,
240
- getHeaderProps,
241
- getRowProps,
242
- getTableProps,
243
- getTableContainerProps,
244
- }) => (
225
+ <DataTable rows={results} headers={headers} isSortable size={responsiveSize} useZebraStyles>
226
+ {({ rows, headers, getHeaderProps, getRowProps, getTableProps, getTableContainerProps }) => (
245
227
  <>
246
228
  <TableContainer {...getTableContainerProps()}>
247
229
  <Table {...getTableProps()}>
248
230
  <TableHead>
249
231
  <TableRow>
250
232
  {headers.map((header) => (
251
- <TableHeader {...getHeaderProps({ header })}>
252
- {header.header}
253
- </TableHeader>
233
+ <TableHeader {...getHeaderProps({ header })}>{header.header}</TableHeader>
254
234
  ))}
255
235
  </TableRow>
256
236
  </TableHead>
@@ -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
  .content {
6
6
  @include type.type-style('heading-compact-01');
@@ -1,6 +1,6 @@
1
- import React, { useCallback, useEffect, useRef, useState } from "react";
2
- import styles from "./index.scss";
3
- import logo from "../../assets/img/Logo.png";
1
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
2
+ import styles from './index.scss';
3
+ import logo from '../../assets/img/Logo.png';
4
4
 
5
5
  interface MeetIframeProps {
6
6
  username: string;
@@ -8,11 +8,7 @@ interface MeetIframeProps {
8
8
  url: string;
9
9
  }
10
10
 
11
- export const MeetIframe: React.FC<MeetIframeProps> = ({
12
- url,
13
- token,
14
- username,
15
- }) => {
11
+ export const MeetIframe: React.FC<MeetIframeProps> = ({ url, token, username }) => {
16
12
  const iframeRef = useRef<HTMLIFrameElement>(null);
17
13
 
18
14
  const [showPreloader, setShowPreloader] = useState(false);
@@ -30,22 +26,16 @@ export const MeetIframe: React.FC<MeetIframeProps> = ({
30
26
 
31
27
  const iframeDocument = iframeWindow.document;
32
28
 
33
- const isLoggedIn = iframeDocument.querySelector(".user-menu");
29
+ const isLoggedIn = iframeDocument.querySelector('.user-menu');
34
30
  if (isLoggedIn) {
35
31
  //console.log("Utilisateur déjà connecté.");
36
32
  //setShowPreloader(false);
37
33
  return; // Pas besoin de soumettre le formulaire
38
34
  }
39
35
 
40
- const userInput = iframeDocument.querySelector(
41
- 'input[name="user"]'
42
- ) as HTMLInputElement | null;
43
- const passwordInput = iframeDocument.querySelector(
44
- 'input[name="password"]'
45
- ) as HTMLInputElement | null;
46
- const loginForm = iframeDocument.querySelector(
47
- "form"
48
- ) as HTMLFormElement | null;
36
+ const userInput = iframeDocument.querySelector('input[name="user"]') as HTMLInputElement | null;
37
+ const passwordInput = iframeDocument.querySelector('input[name="password"]') as HTMLInputElement | null;
38
+ const loginForm = iframeDocument.querySelector('form') as HTMLFormElement | null;
49
39
 
50
40
  if (userInput && passwordInput && loginForm) {
51
41
  userInput.value = username;
@@ -55,7 +45,7 @@ export const MeetIframe: React.FC<MeetIframeProps> = ({
55
45
  setTimeout(() => {
56
46
  loginForm.submit();
57
47
  // eslint-disable-next-line no-console
58
- console.log("Formulaire de connexion soumis.");
48
+ console.log('Formulaire de connexion soumis.');
59
49
  }, 3000); // Délai de 3 secondes
60
50
  //console.log('username', userInput.value, 'password', passwordInput.value);
61
51
  return;
@@ -65,7 +55,7 @@ export const MeetIframe: React.FC<MeetIframeProps> = ({
65
55
  }
66
56
  //setShowPreloader(false);
67
57
  },
68
- [token, username]
58
+ [token, username],
69
59
  );
70
60
 
71
61
  const handleLoad = useCallback(
@@ -75,7 +65,7 @@ export const MeetIframe: React.FC<MeetIframeProps> = ({
75
65
  }
76
66
  setShowPreloader(false);
77
67
  },
78
- [handleLogin, needContinue]
68
+ [handleLogin, needContinue],
79
69
  );
80
70
 
81
71
  useEffect(() => {
@@ -85,31 +75,22 @@ export const MeetIframe: React.FC<MeetIframeProps> = ({
85
75
  const load = () => handleLoad(iframe);
86
76
 
87
77
  // Associer l'événement de chargement
88
- iframe.addEventListener("load", load);
78
+ iframe.addEventListener('load', load);
89
79
 
90
80
  // Nettoyage de l'événement lors du démontage du composant
91
81
  return () => {
92
- iframe.removeEventListener("load", load);
82
+ iframe.removeEventListener('load', load);
93
83
  };
94
84
  }
95
85
  }, [handleLoad]);
96
86
 
97
87
  return (
98
88
  <div className={styles.contentViewWrapper}>
99
- <div
100
- className={styles.preloader}
101
- style={{ display: showPreloader ? "flex" : "none" }}
102
- >
89
+ <div className={styles.preloader} style={{ display: showPreloader ? 'flex' : 'none' }}>
103
90
  <span className={styles.spinner}></span>
104
- <img src={logo} alt="opencare logo" className="logo" />
91
+ <img src={logo} alt="opentms logo" className="logo" />
105
92
  </div>
106
- <iframe
107
- ref={iframeRef}
108
- className={styles.viewer}
109
- title="Web Meeting"
110
- src={url}
111
- allow="camera;microphone"
112
- />
93
+ <iframe ref={iframeRef} className={styles.viewer} title="Web Meeting" src={url} allow="camera;microphone" />
113
94
  </div>
114
95
  );
115
96
  };
@@ -1,4 +1,4 @@
1
- import { Type, validator } from "@openmrs/esm-framework";
1
+ import { Type, validator } from '@openmrs/esm-framework';
2
2
 
3
3
  /**
4
4
  * This is the config schema. It expects a configuration object which
@@ -23,13 +23,13 @@ import { Type, validator } from "@openmrs/esm-framework";
23
23
  export const configSchema = {
24
24
  API_SECURE: {
25
25
  _type: Type.String,
26
- _default: "------------------",
27
- _description: "API secure key",
26
+ _default: '*******************',
27
+ _description: 'API secure key',
28
28
  },
29
29
  API_BASE_URL: {
30
30
  _type: Type.String,
31
- _default: "http://localhost:8000",
32
- _description: "API base url",
31
+ _default: 'http://localhost:8000',
32
+ _description: 'API base url',
33
33
  },
34
34
  };
35
35
 
@@ -1,11 +1,11 @@
1
1
  export const meetingDashboardMeta = {
2
- name: "meeting",
3
- slot: "opencare-dashboard-slot",
4
- title: "Meeting",
2
+ name: 'meeting',
3
+ slot: 'opentms-dashboard-slot',
4
+ title: 'Meeting',
5
5
  };
6
6
 
7
7
  export const PaymentDashboardMeta = {
8
- name: "payment",
9
- slot: "opencare-dashboard-slot",
10
- title: "Payment",
8
+ name: 'payment',
9
+ slot: 'opentms-dashboard-slot',
10
+ title: 'Payment',
11
11
  };
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import PatientAppointmentsBase from '../components/Appointment';
3
+ import { usePatient } from '@openmrs/esm-framework';
4
+
5
+ /* interface Props {} */
6
+
7
+ const AppointmentTabExt: React.FC /* <Props> */ = () => {
8
+ const { isLoading, patientUuid, error } = usePatient();
9
+
10
+ return (
11
+ <div>
12
+ {isLoading ? <span>...</span> : error ? <span></span> : <PatientAppointmentsBase patientUuid={patientUuid} />}
13
+ </div>
14
+ );
15
+ };
16
+
17
+ export default AppointmentTabExt;
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import DemandTab from "../components/Demand/tab";
1
+ import React from 'react';
2
+ import DemandTab from '../components/Demand/tab';
3
3
 
4
4
  /* interface Props {} */
5
5
 
@@ -1,5 +1,5 @@
1
- import React, { useMemo } from "react";
2
- import { MeetIframe } from "../components/MeetIframe";
1
+ import React, { useMemo } from 'react';
2
+ import { MeetIframe } from '../components/MeetIframe';
3
3
 
4
4
  interface Props {
5
5
  url: string;
@@ -1,14 +1,13 @@
1
- import React from "react";
2
- import { ValidateDemandForm } from "../components/Demand/form";
1
+ import React from 'react';
2
+ import { ValidateDemandForm } from '../components/Demand/form';
3
3
 
4
4
  export interface ValidateDemandFormExtProps {
5
5
  demand: any;
6
6
  onClose?: () => void;
7
7
  }
8
8
 
9
- export const ValidateDemandFormExt: React.FC<ValidateDemandFormExtProps> = ({
10
- demand,
11
- onClose,
12
- }) => {
9
+ export const ValidateDemandFormExt: React.FC<ValidateDemandFormExtProps> = ({ demand, onClose }) => {
13
10
  return <ValidateDemandForm demand={demand} onClose={onClose} />;
14
11
  };
12
+
13
+ export default ValidateDemandFormExt;