@fy-/fws-vue 2.3.95 → 2.3.97
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.
|
@@ -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
|
|
|
@@ -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
|