@ampath/esm-login-app 8.0.0-next.7 → 8.0.0-next.9
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/dist/3219.js +1 -0
- package/dist/3219.js.map +1 -0
- package/dist/4bc56e5b0b0e91da.png +0 -0
- package/dist/647e55b5cedf5df2.png +0 -0
- package/dist/a6792134b9df70c4.png +0 -0
- package/dist/acd6ab71c5f6bcb6.jpg +0 -0
- package/dist/d48e253df6a333a7.png +0 -0
- package/dist/esm-login-app.js +1 -1
- package/dist/esm-login-app.js.buildmanifest.json +41 -31
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/assets/Taifa-Care.png +0 -0
- package/src/assets/ampath-logo.png +0 -0
- package/src/assets/dha.png +0 -0
- package/src/assets/gok.png +0 -0
- package/src/assets/openmrs.jpg +0 -0
- package/src/login/login.component.tsx +99 -84
- package/src/login/login.scss +67 -2
- package/src/logo.component.tsx +10 -11
- package/src/resources/otp.resource.ts +2 -2
- package/dist/7853.js +0 -1
- package/dist/7853.js.map +0 -1
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":">=2.2.0"},"pages":[{"component":"root","route":"login","online":true,"offline":true},{"component":"root","route":"logout","online":true,"offline":true},{"component":"root","route":"change-password","online":true,"offline":true}],"extensions":[{"name":"location-picker","slot":"location-picker","component":"locationPicker","online":true,"offline":true},{"name":"logout-button","slot":"user-panel-bottom-slot","component":"logoutButton","online":true,"offline":true},{"name":"password-changer","slot":"user-panel-slot","component":"changePasswordLink","online":true,"offline":true},{"name":"location-changer","slot":"top-nav-info-slot","component":"changeLocationLink","online":true,"offline":true,"order":1}],"modals":[{"name":"change-password-modal","component":"changePasswordModal"}],"version":"8.0.0-next.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":">=2.2.0"},"pages":[{"component":"root","route":"login","online":true,"offline":true},{"component":"root","route":"logout","online":true,"offline":true},{"component":"root","route":"change-password","online":true,"offline":true}],"extensions":[{"name":"location-picker","slot":"location-picker","component":"locationPicker","online":true,"offline":true},{"name":"logout-button","slot":"user-panel-bottom-slot","component":"logoutButton","online":true,"offline":true},{"name":"password-changer","slot":"user-panel-slot","component":"changePasswordLink","online":true,"offline":true},{"name":"location-changer","slot":"top-nav-info-slot","component":"changeLocationLink","online":true,"offline":true,"order":1}],"modals":[{"name":"change-password-modal","component":"changePasswordModal"}],"version":"8.0.0-next.9"}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -17,6 +17,9 @@ import styles from './login.scss';
|
|
|
17
17
|
import { getEmail, getOtp } from '../resources/otp.resource';
|
|
18
18
|
import { getOtpEnabledStatus } from '../utils/get-base-url';
|
|
19
19
|
import image from '../assets/medicine.jpg';
|
|
20
|
+
import openmrsLogo from '../assets/openmrs.jpg';
|
|
21
|
+
import dhaLogo from '../assets/dha.png';
|
|
22
|
+
import gokLogo from '../assets/gok.png';
|
|
20
23
|
|
|
21
24
|
export interface LoginReferrer {
|
|
22
25
|
referrer?: string;
|
|
@@ -212,38 +215,89 @@ const Login: React.FC = () => {
|
|
|
212
215
|
return (
|
|
213
216
|
<>
|
|
214
217
|
<div className={styles.wrapperContainer}>
|
|
215
|
-
<div className={styles.
|
|
216
|
-
<
|
|
217
|
-
{
|
|
218
|
-
|
|
219
|
-
<
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
218
|
+
<div className={styles.logoContainer}>
|
|
219
|
+
<div className={styles.container}>
|
|
220
|
+
<Tile className={styles.loginCard}>
|
|
221
|
+
{errorMessage && (
|
|
222
|
+
<div className={styles.errorMessage}>
|
|
223
|
+
<InlineNotification
|
|
224
|
+
kind="error"
|
|
225
|
+
subtitle={errorMessage}
|
|
226
|
+
title={getCoreTranslation('error')}
|
|
227
|
+
onClick={() => setErrorMessage('')}
|
|
228
|
+
/>
|
|
229
|
+
</div>
|
|
230
|
+
)}
|
|
231
|
+
<div className={styles.center}>
|
|
232
|
+
<Logo t={t} />
|
|
225
233
|
</div>
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
234
|
+
<form onSubmit={handleSubmit}>
|
|
235
|
+
<div className={styles.inputGroup}>
|
|
236
|
+
<TextInput
|
|
237
|
+
id="username"
|
|
238
|
+
type="text"
|
|
239
|
+
name="username"
|
|
240
|
+
autoComplete="username"
|
|
241
|
+
labelText={t('username', 'Username')}
|
|
242
|
+
value={username}
|
|
243
|
+
onChange={changeUsername}
|
|
244
|
+
ref={usernameInputRef}
|
|
245
|
+
required
|
|
246
|
+
autoFocus
|
|
247
|
+
/>
|
|
248
|
+
{showPasswordOnSeparateScreen ? (
|
|
249
|
+
<>
|
|
250
|
+
<div className={showPasswordField ? undefined : styles.hiddenPasswordField}>
|
|
251
|
+
<PasswordInput
|
|
252
|
+
id="password"
|
|
253
|
+
labelText={t('password', 'Password')}
|
|
254
|
+
name="password"
|
|
255
|
+
autoComplete="current-password"
|
|
256
|
+
onChange={changePassword}
|
|
257
|
+
ref={passwordInputRef}
|
|
258
|
+
required
|
|
259
|
+
value={password}
|
|
260
|
+
showPasswordLabel={t('showPassword', 'Show password')}
|
|
261
|
+
invalidText={t('validValueRequired', 'A valid value is required')}
|
|
262
|
+
aria-hidden={!showPasswordField}
|
|
263
|
+
tabIndex={showPasswordField ? 0 : -1}
|
|
264
|
+
/>
|
|
265
|
+
</div>
|
|
266
|
+
{showPasswordField ? (
|
|
267
|
+
<Button
|
|
268
|
+
type="submit"
|
|
269
|
+
className={styles.continueButton}
|
|
270
|
+
renderIcon={(props) => <ArrowRightIcon size={24} {...props} />}
|
|
271
|
+
iconDescription={t('loginButtonIconDescription', 'Log in button')}
|
|
272
|
+
disabled={!isLoginEnabled || isLoggingIn}
|
|
273
|
+
>
|
|
274
|
+
{isLoggingIn ? (
|
|
275
|
+
<InlineLoading
|
|
276
|
+
className={styles.loader}
|
|
277
|
+
description={t('loggingIn', 'Logging in') + '...'}
|
|
278
|
+
/>
|
|
279
|
+
) : (
|
|
280
|
+
t('login', 'Log in')
|
|
281
|
+
)}
|
|
282
|
+
</Button>
|
|
283
|
+
) : (
|
|
284
|
+
<Button
|
|
285
|
+
type="submit"
|
|
286
|
+
className={styles.continueButton}
|
|
287
|
+
renderIcon={(props) => <ArrowRightIcon size={24} {...props} />}
|
|
288
|
+
iconDescription="Continue to password"
|
|
289
|
+
onClick={(evt) => {
|
|
290
|
+
evt.preventDefault();
|
|
291
|
+
continueLogin();
|
|
292
|
+
}}
|
|
293
|
+
disabled={!isLoginEnabled}
|
|
294
|
+
>
|
|
295
|
+
{t('continue', 'Continue')}
|
|
296
|
+
</Button>
|
|
297
|
+
)}
|
|
298
|
+
</>
|
|
299
|
+
) : (
|
|
300
|
+
<>
|
|
247
301
|
<PasswordInput
|
|
248
302
|
id="password"
|
|
249
303
|
labelText={t('password', 'Password')}
|
|
@@ -255,16 +309,12 @@ const Login: React.FC = () => {
|
|
|
255
309
|
value={password}
|
|
256
310
|
showPasswordLabel={t('showPassword', 'Show password')}
|
|
257
311
|
invalidText={t('validValueRequired', 'A valid value is required')}
|
|
258
|
-
aria-hidden={!showPasswordField}
|
|
259
|
-
tabIndex={showPasswordField ? 0 : -1}
|
|
260
312
|
/>
|
|
261
|
-
</div>
|
|
262
|
-
{showPasswordField ? (
|
|
263
313
|
<Button
|
|
264
314
|
type="submit"
|
|
265
315
|
className={styles.continueButton}
|
|
266
316
|
renderIcon={(props) => <ArrowRightIcon size={24} {...props} />}
|
|
267
|
-
iconDescription=
|
|
317
|
+
iconDescription="Log in"
|
|
268
318
|
disabled={!isLoginEnabled || isLoggingIn}
|
|
269
319
|
>
|
|
270
320
|
{isLoggingIn ? (
|
|
@@ -276,54 +326,19 @@ const Login: React.FC = () => {
|
|
|
276
326
|
t('login', 'Log in')
|
|
277
327
|
)}
|
|
278
328
|
</Button>
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
</Button>
|
|
293
|
-
)}
|
|
294
|
-
</>
|
|
295
|
-
) : (
|
|
296
|
-
<>
|
|
297
|
-
<PasswordInput
|
|
298
|
-
id="password"
|
|
299
|
-
labelText={t('password', 'Password')}
|
|
300
|
-
name="password"
|
|
301
|
-
autoComplete="current-password"
|
|
302
|
-
onChange={changePassword}
|
|
303
|
-
ref={passwordInputRef}
|
|
304
|
-
required
|
|
305
|
-
value={password}
|
|
306
|
-
showPasswordLabel={t('showPassword', 'Show password')}
|
|
307
|
-
invalidText={t('validValueRequired', 'A valid value is required')}
|
|
308
|
-
/>
|
|
309
|
-
<Button
|
|
310
|
-
type="submit"
|
|
311
|
-
className={styles.continueButton}
|
|
312
|
-
renderIcon={(props) => <ArrowRightIcon size={24} {...props} />}
|
|
313
|
-
iconDescription="Log in"
|
|
314
|
-
disabled={!isLoginEnabled || isLoggingIn}
|
|
315
|
-
>
|
|
316
|
-
{isLoggingIn ? (
|
|
317
|
-
<InlineLoading className={styles.loader} description={t('loggingIn', 'Logging in') + '...'} />
|
|
318
|
-
) : (
|
|
319
|
-
t('login', 'Log in')
|
|
320
|
-
)}
|
|
321
|
-
</Button>
|
|
322
|
-
</>
|
|
323
|
-
)}
|
|
324
|
-
</div>
|
|
325
|
-
</form>
|
|
326
|
-
</Tile>
|
|
329
|
+
</>
|
|
330
|
+
)}
|
|
331
|
+
</div>
|
|
332
|
+
</form>
|
|
333
|
+
</Tile>
|
|
334
|
+
</div>
|
|
335
|
+
<div className={styles.logoSection}>
|
|
336
|
+
<div className={styles.leftLogos}>
|
|
337
|
+
<img src={gokLogo} alt="GOK logo" className={styles.supportingLogos} />
|
|
338
|
+
<img src={dhaLogo} alt="DHA logo" className={styles.dhaLogo} />
|
|
339
|
+
</div>
|
|
340
|
+
<img src={openmrsLogo} alt="OpenMRS logo" className={styles.openmsrsLogo} />
|
|
341
|
+
</div>
|
|
327
342
|
</div>
|
|
328
343
|
<img className={styles.image} src={image} alt="TAIFA CARE" />
|
|
329
344
|
</div>
|
package/src/login/login.scss
CHANGED
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
.logo {
|
|
49
|
-
margin-bottom: layout.$spacing-08;
|
|
49
|
+
// margin-bottom: layout.$spacing-08;
|
|
50
50
|
height: layout.$spacing-11;
|
|
51
51
|
width: 16rem;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.logoImg {
|
|
55
|
-
margin-bottom: layout.$spacing-
|
|
55
|
+
// margin-bottom: layout.$spacing-03;
|
|
56
56
|
max-width: 100%;
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -179,3 +179,68 @@
|
|
|
179
179
|
max-height: 60rem;
|
|
180
180
|
object-fit: cover;
|
|
181
181
|
}
|
|
182
|
+
|
|
183
|
+
.poweredBy {
|
|
184
|
+
display: flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
justify-self: flex-end;
|
|
187
|
+
font-size: 0.75rem;
|
|
188
|
+
color: blue;
|
|
189
|
+
opacity: 0.85;
|
|
190
|
+
white-space: nowrap;
|
|
191
|
+
font-weight: bold;
|
|
192
|
+
margin-bottom: layout.$spacing-08;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.poweredByLogo {
|
|
196
|
+
margin-left: 0.5rem;
|
|
197
|
+
width: 2rem;
|
|
198
|
+
height: auto;
|
|
199
|
+
object-fit: contain;
|
|
200
|
+
border-radius: 0.5rem;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.logoContainer {
|
|
204
|
+
display: flex;
|
|
205
|
+
flex-direction: column;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.logoSection {
|
|
209
|
+
position: absolute;
|
|
210
|
+
bottom: layout.$spacing-06;
|
|
211
|
+
display: flex;
|
|
212
|
+
justify-content: space-between;
|
|
213
|
+
align-items: center;
|
|
214
|
+
padding: 0 layout.$spacing-06;
|
|
215
|
+
gap: 20rem;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.leftLogos {
|
|
219
|
+
display: flex;
|
|
220
|
+
flex-direction: row;
|
|
221
|
+
gap: 1rem;
|
|
222
|
+
border: 2px solid lightgray;
|
|
223
|
+
border-radius: 0.5rem;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.supportingLogos {
|
|
227
|
+
margin-left: 0.5rem;
|
|
228
|
+
width: 3rem;
|
|
229
|
+
height: auto;
|
|
230
|
+
object-fit: contain;
|
|
231
|
+
border-radius: 0.5rem;
|
|
232
|
+
}
|
|
233
|
+
.dhaLogo {
|
|
234
|
+
margin-left: 0.5rem;
|
|
235
|
+
width: 4rem;
|
|
236
|
+
height: auto;
|
|
237
|
+
object-fit: contain;
|
|
238
|
+
border-radius: 0.5rem;
|
|
239
|
+
}
|
|
240
|
+
.openmsrsLogo {
|
|
241
|
+
margin-left: 0.5rem;
|
|
242
|
+
width: 6rem;
|
|
243
|
+
height: auto;
|
|
244
|
+
object-fit: contain;
|
|
245
|
+
border-radius: 0.5rem;
|
|
246
|
+
}
|
package/src/logo.component.tsx
CHANGED
|
@@ -3,20 +3,19 @@ import { interpolateUrl, useConfig } from '@openmrs/esm-framework';
|
|
|
3
3
|
import { type TFunction } from 'i18next';
|
|
4
4
|
import { type ConfigSchema } from './config-schema';
|
|
5
5
|
import styles from './login/login.scss';
|
|
6
|
+
import taifaCare from './assets/Taifa-Care.png';
|
|
7
|
+
import amrsLogo from './assets/ampath-logo.png';
|
|
6
8
|
|
|
7
9
|
const Logo: React.FC<{ t: TFunction }> = ({ t }) => {
|
|
8
10
|
const { logo } = useConfig<ConfigSchema>();
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
alt={logo.alt ? t(logo.alt) : t('openmrsLogo', 'OpenMRS logo')}
|
|
12
|
-
className={styles.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<title>{t('openmrsLogo', 'OpenMRS logo')}</title>
|
|
18
|
-
<use href="#omrs-logo-full-color"></use>
|
|
19
|
-
</svg>
|
|
11
|
+
return (
|
|
12
|
+
<>
|
|
13
|
+
<img alt={logo.alt ? t(logo.alt) : t('openmrsLogo', 'OpenMRS logo')} className={styles.logoImg} src={taifaCare} />
|
|
14
|
+
<span className={styles.poweredBy}>
|
|
15
|
+
{t('poweredBy', 'Powered by AMRS')}{' '}
|
|
16
|
+
<img src={amrsLogo} alt={t('taifaCare', 'TAIFA CARE logo')} className={styles.poweredByLogo} />
|
|
17
|
+
</span>
|
|
18
|
+
</>
|
|
20
19
|
);
|
|
21
20
|
};
|
|
22
21
|
|
|
@@ -47,7 +47,7 @@ export async function getOtp(username: string, password: string, email: string)
|
|
|
47
47
|
const credentials = window.btoa(`${username}:${password}`);
|
|
48
48
|
|
|
49
49
|
try {
|
|
50
|
-
const url = `${etlBaseUrl}otp?${params.toString()}`;
|
|
50
|
+
const url = `${etlBaseUrl}/otp?${params.toString()}`;
|
|
51
51
|
|
|
52
52
|
const res = await fetch(url, {
|
|
53
53
|
method: 'GET',
|
|
@@ -70,7 +70,7 @@ export async function getOtp(username: string, password: string, email: string)
|
|
|
70
70
|
|
|
71
71
|
export async function verifyOtp(username: string, password: string, otp: string) {
|
|
72
72
|
const etlBaseUrl = await getEtlBaseUrl();
|
|
73
|
-
const url = etlBaseUrl + 'verify-otp';
|
|
73
|
+
const url = etlBaseUrl + '/verify-otp';
|
|
74
74
|
const credentials = window.btoa(`${username}:${password}`);
|
|
75
75
|
|
|
76
76
|
const body = { username, otp };
|