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

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.13"}
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.13",
4
4
  "license": "MPL-2.0",
5
5
  "description": "The login microfrontend for the OpenMRS SPA",
6
6
  "browser": "dist/esm-login-app.js",
@@ -133,8 +133,9 @@ const Login: React.FC = () => {
133
133
  }
134
134
  } else if (!session.sessionLocation) {
135
135
  const uuid = session.user.person.uuid;
136
+ const email = await getEmail(uuid, username, password);
136
137
  try {
137
- await getOtp(username, password, uuid);
138
+ await getOtp(username, password, email);
138
139
  navigate('otp', {
139
140
  state: {
140
141
  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(#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 {
@@ -174,12 +181,25 @@
174
181
  }
175
182
 
176
183
  .image {
177
- width: 50rem;
178
- height: 55rem;
179
- max-height: 60rem;
184
+ width: 100%;
185
+ height: 100%;
186
+ max-width: 100vw;
187
+ max-height: 100vh;
180
188
  object-fit: cover;
181
189
  }
182
190
 
191
+ @media (max-width: 1024px) {
192
+ .image {
193
+ max-width: 40rem;
194
+ }
195
+ }
196
+
197
+ @media (max-width: 768px) {
198
+ .image {
199
+ max-width: 100%;
200
+ }
201
+ }
202
+
183
203
  .poweredBy {
184
204
  display: flex;
185
205
  align-items: center;
@@ -212,7 +232,7 @@
212
232
  justify-content: space-between;
213
233
  align-items: center;
214
234
  padding: 0 layout.$spacing-04;
215
- gap: 24rem;
235
+ gap: clamp(8rem, 27vw, 26rem);
216
236
  }
217
237
 
218
238
  .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