@sowell/quasar-app-extension-auth 0.4.9 → 0.4.10

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": "@sowell/quasar-app-extension-auth",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "description": "A Quasar app extension to manage Authentication",
5
5
  "main": "src/index.js",
6
6
  "repository": "https://github.com/sowell-ai/quasar.extension.auth",
@@ -2,6 +2,7 @@
2
2
  <q-card
3
3
  class="row justify-center full-height q-pl-sm q-pr-sm"
4
4
  style="background: #f4f5f6"
5
+ data-testid="ask-password-change-form"
5
6
  >
6
7
  <q-page class="column" style="max-width: 447px">
7
8
  <q-card-section>
@@ -40,6 +41,7 @@
40
41
  </div>
41
42
  </div>
42
43
  <q-input
44
+ data-testid="email-input"
43
45
  v-model="email"
44
46
  dense
45
47
  borderless
@@ -56,6 +58,7 @@
56
58
  <q-space class="mobile" />
57
59
  <q-card-actions class="q-ml-lg q-mr-lg q-mb-lg row justify-center">
58
60
  <q-btn
61
+ data-testid="submit-btn"
59
62
  color="primary"
60
63
  :icon="icons.ionPaperPlaneOutline"
61
64
  style="max-width: 330px"
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <q-card>
2
+ <q-card data-testid="ask-password-change-form">
3
3
  <q-page class="row bg-white">
4
4
  <div class="col-6 q-pa-xl row justify-center center">
5
5
  <div class="left-side full-width full-height">
@@ -22,6 +22,7 @@
22
22
  {{ $t("auth.email") }}
23
23
  </div>
24
24
  <q-input
25
+ data-testid="email-input"
25
26
  v-model="email"
26
27
  dense
27
28
  outlined
@@ -31,6 +32,7 @@
31
32
  />
32
33
  <div class="q-mt-lg row justify-between items-center">
33
34
  <q-btn
35
+ data-testid="submit-btn"
34
36
  color="primary"
35
37
  :icon-right="icons.ionPaperPlaneOutline"
36
38
  style="max-width: 330px"
@@ -46,6 +48,7 @@
46
48
  />
47
49
 
48
50
  <q-btn
51
+ data-testid="back-btn"
49
52
  color="primary"
50
53
  style="max-width: 330px"
51
54
  data-cy="close_send_email"
@@ -124,8 +127,8 @@ export default defineComponent({
124
127
  .bg-image {
125
128
  display: none;
126
129
  }
127
- .center{
130
+ .center {
128
131
  width: 100%;
129
132
  }
130
133
  }
131
- </style>
134
+ </style>
@@ -98,6 +98,7 @@
98
98
  class="q-mb-lg q-mt-xl text-primary"
99
99
  @click="forgottenPassword = true"
100
100
  data-cy="forgot-password"
101
+ data-testid="ask-password-change-btn"
101
102
  style="font-size: 16px; font-weight: 500; cursor: pointer"
102
103
  >
103
104
  {{ $t("auth.forgottenPassword") }}
@@ -143,6 +144,7 @@
143
144
  transition-show="fade"
144
145
  transition-hide="fade"
145
146
  persistent
147
+ data-testid="ask-password-change-modal"
146
148
  >
147
149
  <send-email @resetPassword="resetPassword" />
148
150
  </q-dialog>
@@ -99,6 +99,7 @@
99
99
  <div
100
100
  class="q-mb-xl q-mt-lg text-primary text-center"
101
101
  @click="forgottenPassword = true"
102
+ data-testid="ask-password-change-btn"
102
103
  data-cy="forgot-password"
103
104
  style="font-size: 14px; cursor: pointer; width: 350px"
104
105
  >
@@ -116,6 +117,7 @@
116
117
  transition-show="fade"
117
118
  transition-hide="fade"
118
119
  persistent
120
+ data-testid="ask-password-change-modal"
119
121
  >
120
122
  <send-email @resetPassword="resetPassword" />
121
123
  </q-dialog>
@@ -105,6 +105,7 @@
105
105
  />
106
106
  <div
107
107
  class="cursor-pointer text-primary text-subtitle2"
108
+ data-testid="ask-password-change-btn"
108
109
  data-cy="forgot-password"
109
110
  @click="forgottenPassword = true"
110
111
  >
@@ -140,6 +141,7 @@
140
141
  transition-show="fade"
141
142
  transition-hide="fade"
142
143
  persistent
144
+ data-testid="ask-password-change-modal"
143
145
  >
144
146
  <web-send-email @resetPassword="resetPassword" />
145
147
  </q-dialog>
@@ -151,14 +153,15 @@
151
153
  :isOtp="isOtp"
152
154
  >
153
155
  <q-btn
156
+ :data-testid="infoDialog.canGoNext ? 'next-btn' : 'close-btn'"
154
157
  v-if="isOtp"
155
158
  class="bg-white submitBtn"
156
159
  unelevated
157
160
  outline
158
161
  no-caps
159
- :label="$t('auth.next')"
162
+ :label="infoDialog.canGoNext ? $t('auth.next') : $t('auth.close')"
160
163
  color="primary"
161
- @click="goToOtpValidation"
164
+ @click="handleInfoDialog"
162
165
  v-close-popup
163
166
  />
164
167
  </sw-info-dialog>
@@ -245,6 +248,7 @@ export default defineComponent({
245
248
  await authState.resetPassword(data).then(() => {
246
249
  localStorage.setItem("emailResetPassword", email);
247
250
  infoDialog.value = {
251
+ canGoNext: true,
248
252
  title: t("auth.mailVerificationTitle"),
249
253
  content:
250
254
  IS_OTP.toLowerCase() === "y"
@@ -259,11 +263,12 @@ export default defineComponent({
259
263
  isNotification.value = false;
260
264
 
261
265
  infoDialog.value = {
266
+ canGoNext: false,
262
267
  title: t("auth.userNotFoundTitle"),
263
268
  content: t("auth.userNotFoundSubtitle"),
264
269
  image: "userNotFound",
265
270
  };
266
-
271
+
267
272
  isNotification.value = true;
268
273
  }
269
274
  }
@@ -273,6 +278,12 @@ export default defineComponent({
273
278
  onSubmit("SoWell");
274
279
  };
275
280
 
281
+ const handleInfoDialog = () => {
282
+ if (infoDialog.value.canGoNext) {
283
+ goToOtpValidation()
284
+ }
285
+ }
286
+
276
287
  return {
277
288
  email,
278
289
  infoDialog,
@@ -289,7 +300,7 @@ export default defineComponent({
289
300
  WELCOME_SUBTITLE,
290
301
  WELCOME_TITLE,
291
302
  isSubmitBtnDisabled,
292
- goToOtpValidation,
303
+ handleInfoDialog,
293
304
  retypeEmail,
294
305
  onSubmit,
295
306
  icons,