@designcrowd/fe-shared-lib 1.3.4-ML-signin-fixes-7 → 1.3.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcrowd/fe-shared-lib",
3
- "version": "1.3.4-ML-signin-fixes-7",
3
+ "version": "1.3.4",
4
4
  "scripts": {
5
5
  "start": "run-p storybook watch:translation",
6
6
  "build": "npm run build:css --production",
@@ -150,7 +150,7 @@ export default {
150
150
  getRedirectToSignInUrl() {
151
151
  const url = new URL(`https://${window.location.host}${this.signInUrl}`);
152
152
  if (this.aEmail) {
153
- url.searchParams.set('initialUserName', this.aEmail);
153
+ url.searchParams.append('initialUserName', this.aEmail);
154
154
  }
155
155
  return url;
156
156
  },
@@ -1,13 +1,13 @@
1
1
  <template>
2
2
  <div :class="{ 'tw-mx-2 sm:tw-mx-8': !isModal }">
3
- <div v-if="helloBar" class="tw-text-left tw-mt-2 tw-mb-2">
3
+ <div v-if="helloBar" class="tw-text-left tw-mt-8">
4
4
  <HelloBar :label="helloBar.label" :description="helloBar.description" :variant="helloBar.variant">
5
5
  <template #cta>
6
6
  <Button
7
7
  v-if="recommendedActionLink"
8
8
  variant="secondary"
9
9
  size="small"
10
- :label="resetPasswordButtonLabel"
10
+ label="RESET PASSWORD"
11
11
  class="tw-hidden sm:tw-inline"
12
12
  :url="getRedirectToRecommendedActionUrl"
13
13
  />
@@ -15,7 +15,7 @@
15
15
  v-if="recommendedActionLink"
16
16
  variant="secondary"
17
17
  size="medium"
18
- :label="resetPasswordButtonLabel"
18
+ label="RESET PASSWORD"
19
19
  :full-width="true"
20
20
  class="sm:tw-hidden tw-mt-2"
21
21
  :url="getRedirectToRecommendedActionUrl"
@@ -63,7 +63,7 @@
63
63
  <input
64
64
  v-model="aUserName"
65
65
  name="userName"
66
- type="text"
66
+ type="email"
67
67
  data-test-email-input
68
68
  aria-required="true"
69
69
  :aria-invalid="!!userNameError"
@@ -327,7 +327,6 @@ export default {
327
327
  emailPlaceholderLabel: this.signInContent.emailPlaceholderLabel ?? 'Email Address',
328
328
  passwordPlaceholderLabel: this.signInContent.passwordPlaceholderLabel ?? 'Password',
329
329
  forgotPasswordLabel: this.signInContent.forgotPasswordLabel ?? 'Forgot Password?',
330
- resetPasswordButtonLabel: this.signInContent.resetPasswordButtonLabel ?? 'RESET PASSWORD',
331
330
  orLabel: this.signInContent.orLabel ?? 'or',
332
331
  signUpLabel: this.signInContent.signUpLabel ?? 'Sign Up',
333
332
  };
@@ -350,7 +349,7 @@ export default {
350
349
  const url = new URL(`https://${window.location.host}${this.forgotPasswordUrl}`);
351
350
 
352
351
  if (this.aUserName) {
353
- url.searchParams.set('email', this.aUserName);
352
+ url.searchParams.append('email', this.aUserName);
354
353
  }
355
354
  return url;
356
355
  },
@@ -361,7 +360,7 @@ export default {
361
360
 
362
361
  const url = new URL(`https://${window.location.host}${this.recommendedActionLink}`);
363
362
  if (this.aUserName) {
364
- url.searchParams.set('email', this.aUserName);
363
+ url.searchParams.append('email', this.aUserName);
365
364
  }
366
365
  return url?.toString();
367
366
  },
@@ -396,10 +395,8 @@ export default {
396
395
  this.clearErrorMessages();
397
396
  },
398
397
  initialUserName(newValue) {
399
- if (newValue && newValue !== this.aUserName) {
400
- this.aUserName = newValue;
401
- }
402
- }
398
+ this.aUserName = newValue;
399
+ },
403
400
  },
404
401
  methods: {
405
402
  validate(e) {
@@ -7,7 +7,7 @@
7
7
  v-if="recommendedActionLink"
8
8
  variant="secondary"
9
9
  size="small"
10
- :label="resetPasswordButtonLabel"
10
+ label="RESET PASSWORD"
11
11
  class="tw-hidden sm:tw-inline"
12
12
  :url="getRedirectToRecommendedActionUrl"
13
13
  />
@@ -15,7 +15,7 @@
15
15
  v-if="recommendedActionLink"
16
16
  variant="secondary"
17
17
  size="medium"
18
- :label="resetPasswordButtonLabel"
18
+ label="RESET PASSWORD"
19
19
  :full-width="true"
20
20
  class="sm:tw-hidden tw-mt-2"
21
21
  :url="getRedirectToRecommendedActionUrl"
@@ -39,7 +39,7 @@
39
39
  <input
40
40
  v-model="aUserName"
41
41
  name="userName"
42
- type="text"
42
+ type="email"
43
43
  aria-required="true"
44
44
  :aria-invalid="!!userNameError"
45
45
  autocomplete="”email”"
@@ -117,7 +117,6 @@ import SocialSignIn from './SocialSignIn.vue';
117
117
  import SubmissionButton from './SubmissionButton.vue';
118
118
  import AuthLegal from './AuthLegal.vue';
119
119
  import themeMixin from '../../mixins/themeMixin';
120
- import isValidEmail from '../../helpers/email-validator';
121
120
  import { getCurrentLocale } from '../../../useSharedLibTranslate';
122
121
 
123
122
  export default {
@@ -218,7 +217,6 @@ export default {
218
217
  alreadyHaveAnAccountLabel: this.signUpContent.alreadyHaveAnAccountLabel ?? 'Already have an account?',
219
218
  orLabel: this.signUpContent.orLabel ?? 'or',
220
219
  loginLabel: this.signUpContent.loginLabel ?? 'Login',
221
- resetPasswordButtonLabel: this.signUpContent.resetPasswordButtonLabel ?? 'RESET PASSWORD',
222
220
  };
223
221
  },
224
222
  computed: {
@@ -239,24 +237,25 @@ export default {
239
237
  },
240
238
  methods: {
241
239
  validate(e) {
240
+ if (this.aUserName && this.password) {
241
+ this.isLoading = true;
242
+ return true;
243
+ }
244
+
242
245
  this.isLoading = false;
243
246
 
244
247
  this.userNameError = undefined;
245
248
  this.passwordError = undefined;
246
249
 
247
- if (!this.aUserName || !isValidEmail(this.aUserName)) {
250
+ if (!this.aUserName) {
248
251
  this.userNameError = this.invalidUsernameErrorLabel;
249
- e.preventDefault();
250
- return false;
251
252
  }
252
253
  if (!this.password) {
253
254
  this.passwordError = this.missingPasswordErrorLabel;
254
- e.preventDefault();
255
- return false;
256
255
  }
257
256
 
258
- this.isLoading = true;
259
- return true;
257
+ e.preventDefault();
258
+ return false;
260
259
  },
261
260
  },
262
261
  };