@live-change/user-frontend 0.9.129 → 0.9.131

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.
@@ -55,7 +55,7 @@ export function getAccountTypes(api = useApi()) {
55
55
  path: accountsPath,
56
56
  accounts: null,
57
57
  async fetchAccounts(context, onUnmountedCb){
58
- const accounts = await live(path[serviceName][viewName]({}), context, onUnmountedCb)
58
+ const accounts = await live(accountsPath, context, onUnmountedCb)
59
59
  this.accounts = accounts
60
60
  return accounts
61
61
  }
@@ -88,7 +88,7 @@ export async function getAccounts(context, onUnmountedCb) {
88
88
  for(const accountType of accountTypes) {
89
89
  await accountType.fetchAccounts(context, onUnmountedCb)
90
90
  }
91
- const accounts = computed(() => accountTypes.map((c,i) => c.accounts.value.map(v => ({
91
+ const accounts = computed(() => accountTypes.map((c,i) => (c.accounts.value ?? []).map(v => ({
92
92
  accountType: c.contactType,
93
93
  serviceName: c.serviceName,
94
94
  ...(v)
@@ -6,9 +6,9 @@
6
6
  <p class="mt-0 mb-1 p-0 leading-normal">You authenticated in a different tab.</p>
7
7
  </div>
8
8
  <div class="bg-surface-0 dark:bg-surface-900 rounded-border shadow p-6" v-else>
9
- <div class="text-surface-900 dark:text-surface-0 font-medium mb-4 text-xl">Message sent</div>
10
- <p class="mt-0 mb-1 p-0 leading-normal">We sent special secret message to the contact you already provided.</p>
11
- <p class="mt-0 mb-6 p-0 leading-normal">Click on the link or enter the code you found in that message.</p>
9
+ <div class="text-surface-900 dark:text-surface-0 font-medium mb-4 text-xl">{{ title }}</div>
10
+ <p class="mt-0 mb-1 p-0 leading-normal">{{ description }}</p>
11
+ <p class="mt-0 mb-6 p-0 leading-normal">{{ callToAction }}</p>
12
12
  <Secured :events="['wrong-secret-code']" :actions="['checkSecretCode']">
13
13
  <command-form service="messageAuthentication" action="finishMessageAuthentication"
14
14
  :parameters="{ secretType: 'code', authentication }" :key="authentication"
@@ -64,7 +64,19 @@
64
64
  authentication: {
65
65
  type: String,
66
66
  required: true
67
- }
67
+ },
68
+ title: {
69
+ type: String,
70
+ default: 'Message sent',
71
+ },
72
+ description: {
73
+ type: String,
74
+ default: 'We sent special secret message to the contact you already provided.',
75
+ },
76
+ callToAction: {
77
+ type: String,
78
+ default: 'Click on the link or enter the code you found in that message.',
79
+ },
68
80
  })
69
81
 
70
82
  function handleAuthenticated({ parameters, result }) {
@@ -51,12 +51,12 @@
51
51
 
52
52
  </command-form>
53
53
 
54
- <Divider v-if="accountTypes.length > 0" align="center" class="my-6">
54
+ <Divider v-if="availableAccountTypes.length > 0" align="center" class="my-6">
55
55
  <span class="text-surface-600 dark:text-surface-200 font-normal text-sm">OR</span>
56
56
  </Divider>
57
57
 
58
- <router-link v-for="accountType in accountTypes"
59
- :to="{ name: `user:${accountType.accountType}Auth`, params: { action: 'signInOrSignUp' } }"
58
+ <router-link v-for="accountType in availableAccountTypes"
59
+ :to="accountType.connectRoute"
60
60
  class="no-underline">
61
61
  <Button
62
62
  :label="`Sign In with ${accountType.accountType[0].toUpperCase()}${accountType.accountType.slice(1)}`"
@@ -78,7 +78,7 @@
78
78
  import Password from "../password/Password.vue"
79
79
  import Message from "primevue/message"
80
80
 
81
- import { onMounted, ref } from 'vue'
81
+ import { onMounted, ref, computed } from 'vue'
82
82
  const isMounted = ref(false)
83
83
  onMounted(() => isMounted.value = true)
84
84
 
@@ -92,6 +92,18 @@
92
92
  const contactsTypes = getContactTypes()
93
93
  const accountTypes = getAccountTypes()
94
94
 
95
+ const availableAccountTypes = computed(() => accountTypes.map(accountType => {
96
+ const route = { name: `user:${accountType.accountType}Auth`, params: { action: 'signInOrSignUp' } }
97
+ const routeExists = router.getRoutes().find(r => r.name === route.name)
98
+ if(routeExists) {
99
+ return {
100
+ ...accountType,
101
+ connectRoute: route
102
+ }
103
+ }
104
+ return null
105
+ }).filter(accountType => !!accountType))
106
+
95
107
  function handleDone({ parameters, result }) {
96
108
  console.log("DONE RESULT", result)
97
109
  if(result.type === 'sent') {
@@ -27,12 +27,12 @@
27
27
  <Button label="Sign Up with email" icon="pi pi-user" class="w-full" type="submit" />
28
28
  </command-form>
29
29
 
30
- <Divider v-if="accountTypes.length > 0" align="center" class="my-6">
30
+ <Divider v-if="availableAccountTypes.length > 0" align="center" class="my-6">
31
31
  <b>OR</b>
32
32
  </Divider>
33
33
 
34
- <router-link v-for="accountType in accountTypes"
35
- :to="{ name: `user:${accountType.accountType}Auth`, params: { action: 'signInOrSignUp' } }"
34
+ <router-link v-for="accountType in availableAccountTypes"
35
+ :to="accountType.connectRoute"
36
36
  class="no-underline">
37
37
  <Button
38
38
  :label="`Sign Up with ${accountType.accountType[0].toUpperCase()}${accountType.accountType.slice(1)}`"
@@ -60,13 +60,27 @@
60
60
  import { useRouter } from 'vue-router'
61
61
  const router = useRouter()
62
62
 
63
+ import { computed } from 'vue'
64
+
63
65
  import { useI18n } from 'vue-i18n'
64
66
  const { t } = useI18n()
65
67
 
66
- import { getContactTypes, getAccountTypes} from '../connected/connected.js'
68
+ import { getContactTypes, getAccountTypes } from '../connected/connected.js'
67
69
  const contactsTypes = getContactTypes()
68
70
  const accountTypes = getAccountTypes()
69
71
 
72
+ const availableAccountTypes = computed(() => accountTypes.map(accountType => {
73
+ const route = { name: `user:${accountType.accountType}Auth`, params: { action: 'signInOrSignUp' } }
74
+ const routeExists = router.getRoutes().find(r => r.name === route.name)
75
+ if(routeExists) {
76
+ return {
77
+ ...accountType,
78
+ connectRoute: route
79
+ }
80
+ }
81
+ return null
82
+ }).filter(accountType => !!accountType))
83
+
70
84
  function handleSent({ parameters, result }) {
71
85
  const { authentication } = result
72
86
  router.push({
package/index.js CHANGED
@@ -22,6 +22,9 @@ import PhoneInput from "./front/src/phone/PhoneInput.vue"
22
22
  import CountryInput from './front/src/phone/CountryInput.vue'
23
23
  export { PhoneInput, CountryInput }
24
24
 
25
+ import MessageSent from "./front/src/message-auth/MessageSent.vue"
26
+ export { MessageSent }
27
+
25
28
  export * from './front/src/connected/connected.js'
26
29
 
27
30
  export * from "./front/src/router.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/user-frontend",
3
- "version": "0.9.129",
3
+ "version": "0.9.131",
4
4
  "scripts": {
5
5
  "memDev": "tsx --inspect --expose-gc server/start.js memDev --enableSessions --initScript ./init.js --dbAccess",
6
6
  "localDevInit": "tsx server/start.js localDev --enableSessions --initScript ./init.js --dbAccess",
@@ -36,29 +36,29 @@
36
36
  },
37
37
  "type": "module",
38
38
  "dependencies": {
39
- "@live-change/cli": "^0.9.129",
40
- "@live-change/dao": "^0.9.129",
41
- "@live-change/dao-vue3": "^0.9.129",
42
- "@live-change/dao-websocket": "^0.9.129",
43
- "@live-change/email-service": "^0.9.129",
44
- "@live-change/framework": "^0.9.129",
45
- "@live-change/identicon-service": "^0.9.129",
46
- "@live-change/image-frontend": "^0.9.129",
47
- "@live-change/message-authentication-service": "^0.9.129",
48
- "@live-change/notification-service": "^0.9.129",
49
- "@live-change/password-authentication-service": "^0.9.129",
50
- "@live-change/pattern": "^0.9.129",
51
- "@live-change/secret-code-service": "^0.9.129",
52
- "@live-change/secret-link-service": "^0.9.129",
53
- "@live-change/security-frontend": "^0.9.129",
54
- "@live-change/security-service": "^0.9.129",
55
- "@live-change/session-service": "^0.9.129",
56
- "@live-change/timer-service": "^0.9.129",
57
- "@live-change/upload-service": "^0.9.129",
58
- "@live-change/user-identification-service": "^0.9.129",
59
- "@live-change/user-service": "^0.9.129",
60
- "@live-change/vue3-components": "^0.9.129",
61
- "@live-change/vue3-ssr": "^0.9.129",
39
+ "@live-change/cli": "^0.9.131",
40
+ "@live-change/dao": "^0.9.131",
41
+ "@live-change/dao-vue3": "^0.9.131",
42
+ "@live-change/dao-websocket": "^0.9.131",
43
+ "@live-change/email-service": "^0.9.131",
44
+ "@live-change/framework": "^0.9.131",
45
+ "@live-change/identicon-service": "^0.9.131",
46
+ "@live-change/image-frontend": "^0.9.131",
47
+ "@live-change/message-authentication-service": "^0.9.131",
48
+ "@live-change/notification-service": "^0.9.131",
49
+ "@live-change/password-authentication-service": "^0.9.131",
50
+ "@live-change/pattern": "^0.9.131",
51
+ "@live-change/secret-code-service": "^0.9.131",
52
+ "@live-change/secret-link-service": "^0.9.131",
53
+ "@live-change/security-frontend": "^0.9.131",
54
+ "@live-change/security-service": "^0.9.131",
55
+ "@live-change/session-service": "^0.9.131",
56
+ "@live-change/timer-service": "^0.9.131",
57
+ "@live-change/upload-service": "^0.9.131",
58
+ "@live-change/user-identification-service": "^0.9.131",
59
+ "@live-change/user-service": "^0.9.131",
60
+ "@live-change/vue3-components": "^0.9.131",
61
+ "@live-change/vue3-ssr": "^0.9.131",
62
62
  "@vueuse/core": "^12.3.0",
63
63
  "codeceptjs-assert": "^0.0.5",
64
64
  "codeceptjs-video-helper": "0.1.3",
@@ -79,7 +79,7 @@
79
79
  "wtfnode": "^0.9.1"
80
80
  },
81
81
  "devDependencies": {
82
- "@live-change/codeceptjs-helper": "^0.9.129",
82
+ "@live-change/codeceptjs-helper": "^0.9.131",
83
83
  "codeceptjs": "^3.6.10",
84
84
  "generate-password": "1.7.1",
85
85
  "playwright": "1.49.1",
@@ -90,5 +90,5 @@
90
90
  "author": "Michał Łaszczewski <michal@laszczewski.pl>",
91
91
  "license": "BSD-3-Clause",
92
92
  "description": "",
93
- "gitHead": "243c2cc85e556cd6f4de4cf65ae4bf8cb8d584a6"
93
+ "gitHead": "3431deb86db4b740bcf04375b274697e0669fff4"
94
94
  }