@ampath/esm-login-app 8.0.0-next.10 → 8.0.0-next.14

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/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.10"}
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.14"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampath/esm-login-app",
3
- "version": "8.0.0-next.10",
3
+ "version": "8.0.0-next.14",
4
4
  "license": "MPL-2.0",
5
5
  "description": "The login microfrontend for the OpenMRS SPA",
6
6
  "browser": "dist/esm-login-app.js",
@@ -64,6 +64,12 @@ const Login: React.FC = () => {
64
64
  }
65
65
  }
66
66
  }, [showPasswordField, showPasswordOnSeparateScreen]);
67
+ useEffect(() => {
68
+ document.body.classList.add('hide-top-nav');
69
+ return () => {
70
+ document.body.classList.remove('hide-top-nav');
71
+ };
72
+ }, []);
67
73
 
68
74
  const continueLogin = useCallback(() => {
69
75
  const currentUsername = usernameInputRef.current?.value?.trim();
@@ -133,8 +139,9 @@ const Login: React.FC = () => {
133
139
  }
134
140
  } else if (!session.sessionLocation) {
135
141
  const uuid = session.user.person.uuid;
142
+ const email = await getEmail(uuid, username, password);
136
143
  try {
137
- await getOtp(username, password, uuid);
144
+ await getOtp(username, password, email);
138
145
  navigate('otp', {
139
146
  state: {
140
147
  username,
@@ -2,6 +2,12 @@
2
2
  @use '@carbon/type';
3
3
  @use '@openmrs/esm-styleguide/src/vars' as *;
4
4
 
5
+ /* Hide OpenMRS top nav on login */
6
+ :global(.hide-top-nav #omrs-top-nav-app-container) {
7
+ display: none;
8
+ height: 0;
9
+ }
10
+
5
11
  .bodyShort01 {
6
12
  @include type.type-style('body-compact-01');
7
13
  }
@@ -39,6 +45,7 @@
39
45
  align-items: center;
40
46
  position: relative;
41
47
  margin-left: 10rem;
48
+ min-height: 100vh;
42
49
  }
43
50
 
44
51
  .center {
@@ -171,15 +178,30 @@
171
178
  display: flex;
172
179
  flex-direction: row;
173
180
  gap: 10rem;
181
+ max-width: 100vw;
182
+ max-height: 100vh;
174
183
  }
175
184
 
176
185
  .image {
177
- width: 50rem;
178
- height: 55rem;
179
- max-height: 60rem;
186
+ width: 100%;
187
+ height: 100%;
188
+ max-width: 100vw;
189
+ max-height: 100vh;
180
190
  object-fit: cover;
181
191
  }
182
192
 
193
+ @media (max-width: 1024px) {
194
+ .image {
195
+ max-width: 40rem;
196
+ }
197
+ }
198
+
199
+ @media (max-width: 768px) {
200
+ .image {
201
+ max-width: 100%;
202
+ }
203
+ }
204
+
183
205
  .poweredBy {
184
206
  display: flex;
185
207
  align-items: center;
@@ -212,7 +234,7 @@
212
234
  justify-content: space-between;
213
235
  align-items: center;
214
236
  padding: 0 layout.$spacing-04;
215
- gap: 24rem;
237
+ gap: clamp(8rem, 27vw, 26rem);
216
238
  }
217
239
 
218
240
  .leftLogos {
@@ -9,8 +9,8 @@
9
9
  margin-left: 5rem;
10
10
  }
11
11
  .leftSide {
12
- margin-top: 10rem;
13
- margin-left: 10rem;
12
+ margin-top: clamp(5rem, 10vw, 20rem);
13
+ margin-left: clamp(2rem, 5vw, 10rem);
14
14
  }
15
15
 
16
16
  .button {
@@ -36,9 +36,21 @@
36
36
  }
37
37
 
38
38
  .image {
39
- width: 54rem;
40
- height: 55rem;
41
- max-height: 60rem;
39
+ width: 100%;
40
+ height: 100%;
41
+ max-width: 100vw;
42
+ max-height: 100vh;
42
43
  object-fit: cover;
43
- flex-shrink: 0;
44
+ }
45
+
46
+ @media (max-width: 1024px) {
47
+ .image {
48
+ max-width: 40rem;
49
+ }
50
+ }
51
+
52
+ @media (max-width: 768px) {
53
+ .image {
54
+ max-width: 100%;
55
+ }
44
56
  }
@@ -8,7 +8,6 @@ export async function getEmail(uuid: string, username: string, password: string)
8
8
  const credentials = window.btoa(`${username}:${password}`);
9
9
  try {
10
10
  if (!uuid) return;
11
-
12
11
  const url = `${subDomain}/amrs/ws/rest/v1/person/${uuid}?v=custom:attributes`;
13
12
 
14
13
  const res = await openmrsFetch(url, {
@@ -31,11 +30,10 @@ export async function getEmail(uuid: string, username: string, password: string)
31
30
 
32
31
  const email = emailAttr?.value;
33
32
 
34
- if (email) {
35
- return email;
36
- } else {
33
+ if (email === undefined || email === null) {
37
34
  throw new Error('Your email has not been configured. Please contact system administrator for assistance.');
38
35
  }
36
+ return email;
39
37
  } catch (error) {
40
38
  throw new Error(error.message ?? 'Failed to fetch email');
41
39
  }
package/yarnrc.yml CHANGED
@@ -4,11 +4,11 @@ enableGlobalCache: false
4
4
 
5
5
  nodeLinker: node-modules
6
6
 
7
- npmPublishRegistry: "https://registry.npmjs.org"
7
+ npmPublishRegistry: 'https://registry.npmjs.org'
8
8
 
9
9
  plugins:
10
10
  - checksum: c13ed363e15a826d9f779e7e7aca9dbee1d6d54813261d6f495da2fa94b01fa7579e516587ae2df5834f5d63d5d90cb392135190e8878b81dbd830c3c9f57809
11
11
  path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
12
- spec: "https://go.mskelton.dev/yarn-outdated/v4"
12
+ spec: 'https://go.mskelton.dev/yarn-outdated/v4'
13
13
 
14
14
  yarnPath: .yarn/releases/yarn-4.10.3.cjs