@fy-/fws-vue 2.3.94 → 2.3.96
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/components/fws/UserFlow.vue +31 -5
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import type { KlbFlowData, KlbUserFlowField } from '@fy-/fws-types'
|
|
|
3
3
|
import type { APIResult } from '../../composables/rest'
|
|
4
4
|
import { EnvelopeIcon } from '@heroicons/vue/24/solid'
|
|
5
5
|
import { useSessionStorage } from '@vueuse/core'
|
|
6
|
-
import { onMounted, ref } from 'vue'
|
|
6
|
+
import { computed, onMounted, ref } from 'vue'
|
|
7
7
|
import { useRoute, useRouter } from 'vue-router'
|
|
8
8
|
import { useEventBus } from '../../composables/event-bus'
|
|
9
9
|
import { useRest } from '../../composables/rest'
|
|
@@ -28,6 +28,11 @@ const props = withDefaults(
|
|
|
28
28
|
returnDefault: '/',
|
|
29
29
|
},
|
|
30
30
|
)
|
|
31
|
+
function closeWindow() {
|
|
32
|
+
if (typeof window !== 'undefined') {
|
|
33
|
+
window.close()
|
|
34
|
+
}
|
|
35
|
+
}
|
|
31
36
|
function isExternalUrl(url: string) {
|
|
32
37
|
return url.startsWith('http://') || url.startsWith('https://')
|
|
33
38
|
}
|
|
@@ -62,6 +67,12 @@ const formData = ref<Record<string, any>>({
|
|
|
62
67
|
})
|
|
63
68
|
const completed = ref(false)
|
|
64
69
|
|
|
70
|
+
const isMessageOnly = computed(() => {
|
|
71
|
+
return !!responseMessage.value
|
|
72
|
+
&& responseFields.value.length > 0
|
|
73
|
+
&& responseFields.value.every(f => f.cat === 'label')
|
|
74
|
+
})
|
|
75
|
+
|
|
65
76
|
function autocompleteValue(fieldName: string): string | undefined {
|
|
66
77
|
switch (fieldName) {
|
|
67
78
|
case 'username':
|
|
@@ -255,7 +266,7 @@ onMounted(async () => {
|
|
|
255
266
|
id="login-title"
|
|
256
267
|
class="text-lg font-medium text-fv-neutral-700 dark:text-fv-neutral-300"
|
|
257
268
|
>
|
|
258
|
-
{{ responseMessage }}
|
|
269
|
+
{{ $t(responseMessage) }}
|
|
259
270
|
</h2>
|
|
260
271
|
</div>
|
|
261
272
|
|
|
@@ -378,7 +389,7 @@ onMounted(async () => {
|
|
|
378
389
|
"
|
|
379
390
|
:error="fieldsError[field.name]"
|
|
380
391
|
:type="field.type"
|
|
381
|
-
:req="responseReq.includes(field.name)"
|
|
392
|
+
:req="responseReq ? responseReq.includes(field.name) : false"
|
|
382
393
|
:autocomplete="autocompleteValue(field.name)"
|
|
383
394
|
/>
|
|
384
395
|
</template>
|
|
@@ -393,7 +404,7 @@ onMounted(async () => {
|
|
|
393
404
|
:label="field.label"
|
|
394
405
|
:error="fieldsError[field.name]"
|
|
395
406
|
:type="field.type"
|
|
396
|
-
:req="responseReq.includes(field.name)"
|
|
407
|
+
:req="responseReq ? responseReq.includes(field.name) : false"
|
|
397
408
|
:link-icon="field.link"
|
|
398
409
|
/>
|
|
399
410
|
</template>
|
|
@@ -434,7 +445,7 @@ onMounted(async () => {
|
|
|
434
445
|
|
|
435
446
|
<!-- Password recovery link -->
|
|
436
447
|
<div
|
|
437
|
-
v-if="responseReq.includes('password') && response?.data?.user"
|
|
448
|
+
v-if="responseReq ? responseReq.includes('password') && response?.data?.user : false"
|
|
438
449
|
class="text-right my-2"
|
|
439
450
|
>
|
|
440
451
|
<button
|
|
@@ -451,8 +462,23 @@ onMounted(async () => {
|
|
|
451
462
|
</button>
|
|
452
463
|
</div>
|
|
453
464
|
|
|
465
|
+
<!-- Close page button (message-only, e.g. magic link sent) -->
|
|
466
|
+
<button
|
|
467
|
+
v-if="isMessageOnly"
|
|
468
|
+
type="button"
|
|
469
|
+
class="w-full flex justify-center py-2.5 px-4 border border-transparent rounded-lg shadow-sm
|
|
470
|
+
text-white bg-fv-neutral-600 hover:bg-fv-neutral-700 dark:bg-fv-neutral-700 dark:hover:bg-fv-neutral-800
|
|
471
|
+
focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-fv-neutral-500 dark:focus:ring-fv-neutral-600
|
|
472
|
+
dark:focus:ring-offset-fv-neutral-800 font-medium transition-all duration-200"
|
|
473
|
+
aria-label="Close"
|
|
474
|
+
@click="closeWindow()"
|
|
475
|
+
>
|
|
476
|
+
{{ $t("cta_close_page") }}
|
|
477
|
+
</button>
|
|
478
|
+
|
|
454
479
|
<!-- Submit button -->
|
|
455
480
|
<button
|
|
481
|
+
v-else
|
|
456
482
|
type="submit"
|
|
457
483
|
class="w-full flex justify-center py-2.5 px-4 border border-transparent rounded-lg shadow-sm
|
|
458
484
|
text-white bg-fv-primary-600 hover:bg-fv-primary-700 dark:bg-fv-primary-700 dark:hover:bg-fv-primary-800
|