@live-change/user-frontend 0.0.3

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.
Files changed (82) hide show
  1. package/LICENSE +21 -0
  2. package/e2e/codecept.conf.js +60 -0
  3. package/e2e/connectEmailCode.test.js +61 -0
  4. package/e2e/connectEmailLink.test.js +60 -0
  5. package/e2e/delete.test.js +44 -0
  6. package/e2e/disconnectEmail.test.js +42 -0
  7. package/e2e/resetPasswordWithEmailCode.test.js +62 -0
  8. package/e2e/resetPasswordWithEmailLink.test.js +62 -0
  9. package/e2e/setPassword.test.js +70 -0
  10. package/e2e/signInEmailCode.test.js +52 -0
  11. package/e2e/signInEmailLink.test.js +52 -0
  12. package/e2e/signInEmailPassword.test.js +47 -0
  13. package/e2e/signOut.test.js +41 -0
  14. package/e2e/signUpEmailCode.test.js +41 -0
  15. package/e2e/signUpEmailLink.test.js +41 -0
  16. package/e2e/steps.d.ts +12 -0
  17. package/e2e/steps_file.js +89 -0
  18. package/front/index.html +11 -0
  19. package/front/public/favicon.ico +0 -0
  20. package/front/public/images/empty-photo.svg +38 -0
  21. package/front/public/images/empty-user-photo.svg +33 -0
  22. package/front/public/images/logo.svg +34 -0
  23. package/front/public/images/logo128.png +0 -0
  24. package/front/src/App.vue +31 -0
  25. package/front/src/Index.vue +14 -0
  26. package/front/src/NavBar.vue +103 -0
  27. package/front/src/SettingsTabs.vue +48 -0
  28. package/front/src/connected/Connect.vue +58 -0
  29. package/front/src/connected/ConnectFinished.vue +16 -0
  30. package/front/src/connected/Connected.vue +84 -0
  31. package/front/src/connected/routes.js +16 -0
  32. package/front/src/delete/Delete.vue +53 -0
  33. package/front/src/delete/DeleteFeedbackSent.vue +16 -0
  34. package/front/src/delete/DeleteFinished.vue +32 -0
  35. package/front/src/delete/routes.js +16 -0
  36. package/front/src/entry-client.js +6 -0
  37. package/front/src/entry-server.js +6 -0
  38. package/front/src/identification/IdentificationSettings.vue +116 -0
  39. package/front/src/identification/ObjectIdentification.vue +36 -0
  40. package/front/src/identification/UserIdentification.vue +101 -0
  41. package/front/src/identification/routes.js +12 -0
  42. package/front/src/message-auth/ConnectEmail.vue +105 -0
  43. package/front/src/message-auth/MessageLink.vue +95 -0
  44. package/front/src/message-auth/MessageSent.vue +103 -0
  45. package/front/src/message-auth/ResetPasswordEmail.vue +105 -0
  46. package/front/src/message-auth/SignInEmail.vue +105 -0
  47. package/front/src/message-auth/SignUpEmail.vue +105 -0
  48. package/front/src/message-auth/routes.js +25 -0
  49. package/front/src/notifications/NotificationButtons.vue +70 -0
  50. package/front/src/notifications/NotificationListPage.vue +22 -0
  51. package/front/src/notifications/NotificationsIcon.vue +75 -0
  52. package/front/src/notifications/NotificationsList.vue +144 -0
  53. package/front/src/notifications/NotificationsSettings.vue +117 -0
  54. package/front/src/notifications/SimpleNotification.vue +34 -0
  55. package/front/src/notifications/TestNotification.vue +25 -0
  56. package/front/src/notifications/UnknownNotification.vue +25 -0
  57. package/front/src/notifications/notificationTypes.js +11 -0
  58. package/front/src/notifications/routes.js +37 -0
  59. package/front/src/password/ChangePassword.vue +106 -0
  60. package/front/src/password/ChangePasswordFinished.vue +16 -0
  61. package/front/src/password/ResetPassword.vue +56 -0
  62. package/front/src/password/ResetPasswordFinished.vue +16 -0
  63. package/front/src/password/ResetPasswordForm.vue +118 -0
  64. package/front/src/password/routes.js +41 -0
  65. package/front/src/router.js +90 -0
  66. package/front/src/settings/Settings.vue +33 -0
  67. package/front/src/settings/SettingsIndex.vue +22 -0
  68. package/front/src/settings/SettingsMenu.vue +81 -0
  69. package/front/src/settings/SettingsMenuItem.vue +35 -0
  70. package/front/src/sign/SignIn.vue +93 -0
  71. package/front/src/sign/SignInFinished.vue +27 -0
  72. package/front/src/sign/SignOut.vue +37 -0
  73. package/front/src/sign/SignOutFinished.vue +16 -0
  74. package/front/src/sign/SignUp.vue +51 -0
  75. package/front/src/sign/SignUpFinished.vue +16 -0
  76. package/front/src/sign/routes.js +24 -0
  77. package/front/vite.config.js +11 -0
  78. package/index.js +11 -0
  79. package/package.json +87 -0
  80. package/server/init.js +53 -0
  81. package/server/security.config.js +53 -0
  82. package/server/services.config.js +74 -0
@@ -0,0 +1,41 @@
1
+ const randomProfile = require('random-profile-generator')
2
+
3
+ const user = randomProfile.profile()
4
+ user.email = user.firstName.toLowerCase() + '@test.com' // test domain - emails not sent
5
+
6
+ const happyPath = false
7
+
8
+ Feature('user')
9
+
10
+ Scenario('sign up with email code', async ({ I }) => {
11
+
12
+ I.amOnPage('/sign-up')
13
+ I.fillField('input#email', user.email)
14
+ I.click('button[type=submit]')
15
+
16
+ I.seeInCurrentUrl('/sent/')
17
+ const url = await I.grabCurrentUrl()
18
+ const authentication = url.split('/').pop()
19
+
20
+ const authenticationData = await I.grabObject('messageAuthentication', 'Authentication', authentication)
21
+ console.log("AUTHENTICATION DATA", authenticationData)
22
+ I.assert(!!authenticationData, true, 'authentication created')
23
+
24
+ await I.useSecretCode(authentication, happyPath)
25
+
26
+ I.seeInCurrentUrl('/sign-up-finished')
27
+ const clientSession = await I.executeScript(() => api.client.value.session)
28
+ const AuthenticatedUser = await I.haveModel('user', 'AuthenticatedUser')
29
+ const authenticatedUserData = await AuthenticatedUser.get(clientSession)
30
+ I.assert(!!authenticatedUserData, true, 'user authenticated server-side')
31
+ const clientUser = await I.executeScript(() => api.client.value.user)
32
+ console.log("CLIENT USER", clientUser)
33
+ console.log("SERVER AUTHENTICATION", authenticatedUserData)
34
+ I.assert(clientUser, authenticatedUserData.user, 'user authenticated')
35
+
36
+ if(!happyPath) {
37
+ I.amOnPage(url)
38
+ I.seeInCurrentUrl('/sign-up-finished')
39
+ }
40
+
41
+ })
@@ -0,0 +1,41 @@
1
+ const randomProfile = require('random-profile-generator')
2
+
3
+ const user = randomProfile.profile()
4
+ user.email = user.firstName.toLowerCase() + '@test.com' // test domain - emails not sent
5
+
6
+ const happyPath = false
7
+
8
+ Feature('user')
9
+
10
+ Scenario('sign up with email link', async ({ I }) => {
11
+
12
+ I.amOnPage('/sign-up')
13
+ I.fillField('input#email', user.email)
14
+ I.click('button[type=submit]')
15
+
16
+ I.seeInCurrentUrl('/sent/')
17
+ const url = await I.grabCurrentUrl()
18
+ const authentication = url.split('/').pop()
19
+
20
+ const authenticationData = await I.grabObject('messageAuthentication', 'Authentication', authentication)
21
+ console.log("AUTHENTICATION DATA", authenticationData)
22
+ I.assert(!!authenticationData, true, 'authentication created')
23
+
24
+ const linkData = await I.useSecretLink(authentication, happyPath)
25
+
26
+ I.seeInCurrentUrl('/sign-up-finished')
27
+ const clientSession = await I.executeScript(() => api.client.value.session)
28
+ const AuthenticatedUser = await I.haveModel('user', 'AuthenticatedUser')
29
+ const authenticatedUserData = await AuthenticatedUser.get(clientSession)
30
+ I.assert(!!authenticatedUserData, true, 'user authenticated server-side')
31
+ const clientUser = await I.executeScript(() => api.client.value.user)
32
+ console.log("CLIENT USER", clientUser)
33
+ console.log("SERVER AUTHENTICATION", authenticatedUserData)
34
+ I.assert(clientUser, authenticatedUserData.user, 'user authenticated')
35
+
36
+ if(!happyPath) {
37
+ I.amOnPage('/link/' + linkData.secretCode)
38
+ I.see('Link used')
39
+ }
40
+
41
+ })
package/e2e/steps.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ /// <reference types='codeceptjs' />
2
+ // @ts-ignore
3
+ type steps_file = typeof import('./steps_file.js');
4
+
5
+ declare namespace CodeceptJS {
6
+ interface SupportObject { I: I, current: any }
7
+ interface Methods extends Playwright {}
8
+ interface I extends ReturnType<steps_file> {}
9
+ namespace Translation {
10
+ interface Actions {}
11
+ }
12
+ }
@@ -0,0 +1,89 @@
1
+ // in this file you can append custom step methods to 'I' object
2
+
3
+ const steps = {
4
+
5
+ async useSecretCode(authentication, happyPath) {
6
+ const I = this
7
+ const Code = await I.haveModel('secretCode', 'Code')
8
+ let codeData = await Code.indexObjectGet('byAuthentication', authentication)
9
+ console.log("CODE DATA", codeData)
10
+ I.assert(!!codeData, true, 'code created')
11
+
12
+ if(!happyPath) {
13
+ const wrongCode = codeData.secretCode == '123456' ? '654321' : '123456'
14
+ I.fillField('input#code', wrongCode)
15
+ I.fillField('input#code', wrongCode) /// twice because it can fail once with this type of field
16
+ I.click('button[type=submit]')
17
+ I.seeElement('#code-help.p-error')
18
+ }
19
+
20
+ if(!happyPath) {
21
+ await I.wait(0.2)
22
+ await Code.update(codeData.id, { expire: new Date() }) // expire now
23
+ I.fillField('input#code', codeData.secretCode)
24
+ I.fillField('input#code', codeData.secretCode) /// twice because it can fail once with this type of field
25
+ I.click('button[type=submit]')
26
+ I.seeElement('#code-help.p-error')
27
+
28
+ I.click('Resend')
29
+ I.seeInCurrentUrl('/sent/')
30
+
31
+ await I.wait(0.2)
32
+ const newCodeData = await Code.indexRangeGet('byAuthentication', authentication)
33
+ newCodeData.sort((a,b) => new Date(b.expire).getTime() - new Date(a.expire).getTime())
34
+ const oldCodeData = codeData
35
+ codeData = newCodeData[0]
36
+ I.assert(!!codeData, true, 'code exists')
37
+ I.assert(oldCodeData.id != codeData.id, true, 'code is different from previous code')
38
+ }
39
+
40
+ I.fillField('input#code', codeData.secretCode)
41
+ I.fillField('input#code', codeData.secretCode) /// twice because it can fail once with this type of field
42
+ I.click('button[type=submit]')
43
+ await I.wait(0.1)
44
+ },
45
+
46
+ async useSecretLink(authentication, happyPath) {
47
+ const I = this
48
+ const Link = await I.haveModel('secretLink', 'Link')
49
+ let linkData = await Link.indexObjectGet('byAuthentication', authentication)
50
+ console.log("LINK DATA", linkData)
51
+ I.assert(!!linkData, true, 'link created')
52
+
53
+ if(!happyPath) {
54
+ I.amOnPage('/link/[badSecret]')
55
+ I.see('Unknown link')
56
+ }
57
+
58
+ if(!happyPath) {
59
+ await I.wait(0.2)
60
+ await Link.update(linkData.id, { expire: new Date() }) // expire now
61
+ I.amOnPage('/link/' + linkData.secretCode)
62
+ I.see('Link expired')
63
+
64
+ I.click('Resend')
65
+ I.seeInCurrentUrl('/sent/')
66
+
67
+ await I.wait(0.2)
68
+ const newLinksData = await Link.indexRangeGet('byAuthentication', authentication)
69
+ newLinksData.sort((a,b) => new Date(b.expire).getTime() - new Date(a.expire).getTime())
70
+ const oldLinkData = linkData
71
+ linkData = newLinksData[0]
72
+ I.assert(!!linkData, true, 'link exists')
73
+ I.assert(oldLinkData.id != linkData.id, true, 'link is different from previous link')
74
+ }
75
+
76
+ console.log("LINK RIGHT", '/link/' + linkData.secretCode)
77
+ I.amOnPage('/link/'+linkData.secretCode)
78
+ await I.wait(0.1)
79
+
80
+ return linkData
81
+ }
82
+
83
+ }
84
+
85
+ module.exports = function() {
86
+ return actor(steps)
87
+ }
88
+
89
+ module.exports.steps = steps
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <!--head-->
5
+ </head>
6
+ <body>
7
+ <div id="app"><!--app-html--></div>
8
+ <!--app-data-->
9
+ <script type="module" src="/src/entry-client.js"></script>
10
+ </body>
11
+ </html>
Binary file
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+
4
+ <svg
5
+ version="1.1"
6
+ id="Layer_1"
7
+ x="0px"
8
+ y="0px"
9
+ width="512px"
10
+ height="512px"
11
+ viewBox="0 0 512 512"
12
+ enable-background="new 0 0 512 512"
13
+ xml:space="preserve"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ xmlns:svg="http://www.w3.org/2000/svg"
16
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
17
+ xmlns:cc="http://creativecommons.org/ns#"
18
+ xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata
19
+ id="metadata9"><rdf:RDF><cc:Work
20
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
21
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
22
+ id="defs7" />
23
+ <rect
24
+ style="fill:#dbdbdb;fill-opacity:1;stroke:none;stroke-width:1.88976383;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
25
+ id="rect821"
26
+ width="512.54236"
27
+ height="512.54236"
28
+ x="0.54237288"
29
+ y="0.54237235" />
30
+ <path
31
+ style="fill:#f6f6f6;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
32
+ d="M 0.54237288,470.23729 125.83051,306.44068 l 60.20339,70.50847 130.71186,-174.10169 195.79661,261.42373 0.54235,48.81353 H 0.54237288 Z"
33
+ id="path816" /><circle
34
+ style="fill:#f6f6f6;fill-opacity:1;stroke:none;stroke-width:4.80000019;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
35
+ id="path818"
36
+ cx="118.50848"
37
+ cy="106.57627"
38
+ r="57.762711" /></svg>
@@ -0,0 +1,33 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+
4
+ <svg
5
+ version="1.1"
6
+ id="Layer_1"
7
+ x="0px"
8
+ y="0px"
9
+ width="512px"
10
+ height="512px"
11
+ viewBox="0 0 512 512"
12
+ enable-background="new 0 0 512 512"
13
+ xml:space="preserve"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ xmlns:svg="http://www.w3.org/2000/svg"
16
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
17
+ xmlns:cc="http://creativecommons.org/ns#"
18
+ xmlns:dc="http://purl.org/dc/elements/1.1/"><metadata
19
+ id="metadata9"><rdf:RDF><cc:Work
20
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
21
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
22
+ id="defs7" />
23
+ <rect
24
+ style="fill:#dbdbdb;fill-opacity:1;stroke:none;stroke-width:1.88976383;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
25
+ id="rect821"
26
+ width="512.54236"
27
+ height="512.54236"
28
+ x="0.54237288"
29
+ y="0.54237235" /><path
30
+ d="m 313.14122,310.64877 c 9.02181,-8.85097 12.15686,-31.23733 20.41627,-39.3056 11.69771,-11.43183 24.39381,-25.50218 27.98588,-43.06851 4.82003,-23.34203 -4.96846,-26.30516 -4.96846,-34.3713 0,-16.90002 -0.15376,-44.65739 -5.43081,-62.68607 -0.30326,-23.7809 -4.20499,-34.123578 -12.38858,-43.031138 -7.72017,-8.33522 -26.68637,-6.366203 -36.59125,-11.85361 C 286.83605,67.825407 274.23818,64.594254 258.15823,64.17461 v -0.09503 c -0.47624,0 -0.93539,0.05659 -1.41162,0.05659 -0.78484,0 -1.53123,-0.05659 -2.35343,-0.05659 l 0.0395,0.151627 c -39.17105,1.472492 -80.84608,26.170627 -95.16524,65.895863 -5.31335,14.71958 -3.28881,46.87521 -3.28881,63.77522 0,8.06721 -9.78742,11.02927 -4.96846,34.37131 3.61129,17.56632 16.28817,31.63668 27.98588,43.06851 8.26048,8.06827 11.39446,30.45462 20.39705,39.30559 1.96902,13.0378 2.1986,9.31012 2.12278,21.23954 -0.0203,4.03307 0.11426,10.28502 -6.32669,16.4398 -12.17822,11.6614 -40.14595,36.95324 -63.08756,46.79832 -30.24,12.98014 -79.41203,33.74237 -90.746691,39.59069 -11.334661,5.84833 -41.2532541,21.69763 -41.2532541,31.79045 0,10.11417 0,47.33542 0,47.33542 h 253.3742451 5.79494 253.37318 c 0,0 0,-37.22125 0,-47.33542 0,-10.09282 -29.89723,-25.94212 -41.25645,-31.79045 -11.35389,-5.84938 -60.48321,-26.61055 -90.72641,-39.59069 -22.32976,-9.57707 -49.43685,-33.81712 -62.09344,-45.84158 -4.2808,-4.05228 -7.3016,-8.29784 -7.3411,-18.62023 -0.0737,-12.00417 0.23278,-7.41692 2.14306,-20.01478"
31
+ id="path2"
32
+ style="clip-rule:evenodd;fill-rule:evenodd;stroke-width:1.06779659;fill:#f6f6f6;fill-opacity:1" />
33
+ </svg>
@@ -0,0 +1,34 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg
3
+ width="512"
4
+ height="512"
5
+ viewBox="0 0 135.46667 135.46667"
6
+ version="1.1"
7
+ id="svg977"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ xmlns:svg="http://www.w3.org/2000/svg"
10
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
11
+ xmlns:cc="http://creativecommons.org/ns#"
12
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
13
+ <defs
14
+ id="defs971" />
15
+ <metadata
16
+ id="metadata974">
17
+ <rdf:RDF>
18
+ <cc:Work
19
+ rdf:about="">
20
+ <dc:format>image/svg+xml</dc:format>
21
+ <dc:type
22
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
23
+ </cc:Work>
24
+ </rdf:RDF>
25
+ </metadata>
26
+ <g
27
+ id="layer1"
28
+ style="fill:#666666">
29
+ <path
30
+ style="fill:#666666;fill-opacity:1;stroke:none;stroke-width:2.70907px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
31
+ d="M 54.181439,13.558436 67.726801,0.01304296 135.45359,67.739804 67.726801,135.46667 29.799793,97.539626 V 65.030766 L 13.545362,81.285197 0,67.739804 40.636077,27.103727 81.272154,67.739804 67.726801,81.285197 51.472371,65.030766 V 92.12155 l 16.25443,16.25433 40.636069,-40.636076 z"
32
+ id="path892" />
33
+ </g>
34
+ </svg>
Binary file
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <view-root>
3
+ <template #navbar>
4
+ <NavBar />
5
+ </template>
6
+ </view-root>
7
+ </template>
8
+
9
+ <script setup>
10
+ import 'primevue/resources/themes/lara-light-blue/theme.css'
11
+
12
+ import NavBar from "./NavBar.vue"
13
+ import ViewRoot from "@live-change/frontend-base/ViewRoot.vue"
14
+
15
+ import { useMeta } from 'vue-meta'
16
+ const { meta } = useMeta({
17
+ title: 'Title',
18
+ htmlAttrs: {
19
+ lang: 'en',
20
+ amp: true
21
+ }
22
+ })
23
+
24
+ import { watch } from 'vue'
25
+ import { client as useClient } from '@live-change/vue3-ssr'
26
+ const client = useClient()
27
+ watch(client, (newClient, oldClient) => {
28
+ console.log("WATCH CLIENT", oldClient, '=>', newClient)
29
+ })
30
+
31
+ </script>
@@ -0,0 +1,14 @@
1
+ <template>
2
+ <div class="w-full lg:w-6 md:w-9">
3
+ <div class="surface-card border-round shadow-2 p-4">
4
+ <div class="text-900 font-medium mb-3 text-xl">Test Index</div>
5
+ </div>
6
+ </div>
7
+ </template>
8
+
9
+ <script setup>
10
+ </script>
11
+
12
+ <style scoped>
13
+
14
+ </style>
@@ -0,0 +1,103 @@
1
+ <template>
2
+ <div class="surface-overlay py-3 px-6 shadow-2 flex align-items-center justify-content-between
3
+ relative md:sticky top-0 z-5"
4
+ style="min-height: 80px" key="navbar">
5
+ <img src="/images/logo.svg" alt="Image" height="40" class="mr-0 lg:mr-6">
6
+ <div class="hidden lg:flex">
7
+ <!-- place for desktop menu -->
8
+ </div>
9
+ <div class="flex flex-grow-1"></div>
10
+ <NotificationsIcon />
11
+ <a v-ripple class="cursor-pointer block lg:hidden text-700 p-ripple ml-2 hover:surface-100 p-2"
12
+ v-styleclass="{ selector: '@next', enterClass: 'hidden', leaveToClass: 'hidden', hideOnOutsideClick: true }">
13
+ <i class="pi pi-bars text-4xl"></i>
14
+ </a>
15
+ <div class="align-items-center flex-grow-1 justify-content-between hidden absolute lg:static w-full surface-overlay left-0 top-100 z-1 shadow-2 lg:shadow-none">
16
+ <ul class="list-none p-0 m-0 flex lg:align-items-center select-none flex-column lg:flex-row">
17
+ <li>
18
+ <a v-ripple class="flex px-6 p-3 lg:px-3 lg:py-2 align-items-center text-600 hover:text-900 hover:surface-100 font-medium border-round cursor-pointer transition-colors transition-duration-150 p-ripple">
19
+ <i class="pi pi-home mr-2"></i>
20
+ <span>Home</span>
21
+ </a>
22
+ </li>
23
+ <li class="lg:relative">
24
+ <a v-ripple class="flex px-6 p-3 lg:px-3 lg:py-2 align-items-center text-600 hover:text-900 hover:surface-100 font-medium border-round cursor-pointer transition-colors transition-duration-150 p-ripple"
25
+ v-styleclass="{ selector: '@next', enterClass: 'hidden', enterActiveClass: 'scalein', leaveToClass: 'hidden', leaveActiveClass: 'fadeout', hideOnOutsideClick: true }">
26
+ <i class="pi pi-users mr-2"></i>
27
+ <span>Customers</span>
28
+ <i class="pi pi-angle-down ml-auto lg:ml-3"></i>
29
+ </a>
30
+ <ul class="list-none py-3 px-6 m-0 lg:px-0 lg:py-0 border-round shadow-0 lg:shadow-2 lg:border-1 border-50 lg:absolute surface-overlay hidden origin-top w-full lg:w-15rem cursor-pointer">
31
+ <li>
32
+ <a v-ripple class="flex p-3 align-items-center text-600 hover:text-900 hover:surface-100 transition-colors transition-duration-150 p-ripple">
33
+ <i class="pi pi-user-plus mr-2"></i>
34
+ <span class="font-medium">Add New</span>
35
+ </a>
36
+ </li>
37
+ <li class="relative">
38
+ <a v-ripple class="flex p-3 align-items-center text-600 hover:text-900 hover:surface-100 transition-colors transition-duration-150 p-ripple"
39
+ v-styleclass="{ selector: '@next', enterClass: 'hidden', enterActiveClass: 'scalein', leaveToClass: 'hidden', leaveActiveClass: 'fadeout', hideOnOutsideClick: true }">
40
+ <i class="pi pi-search mr-2"></i>
41
+ <span class="font-medium">Search</span>
42
+ <i class="pi pi-angle-down ml-auto lg:-rotate-90"></i>
43
+ </a>
44
+ <ul class="list-none py-3 pl-3 m-0 lg:px-0 lg:py-0 border-round shadow-0 lg:shadow-2 lg:border-1 border-50 lg:absolute surface-overlay hidden origin-top w-full lg:w-15rem cursor-pointer left-100 top-0">
45
+ <li>
46
+ <a v-ripple class="flex p-3 align-items-center text-600 hover:text-900 hover:surface-100 transition-colors transition-duration-150 p-ripple">
47
+ <i class="pi pi-shopping-cart mr-2"></i>
48
+ <span class="font-medium">Purchases</span>
49
+ </a>
50
+ </li>
51
+ <li class="relative">
52
+ <a v-ripple class="flex p-3 align-items-center text-600 hover:text-900 hover:surface-100 transition-colors transition-duration-150 p-ripple">
53
+ <i class="pi pi-comments mr-2"></i>
54
+ <span class="font-medium">Messages</span>
55
+ </a>
56
+ </li>
57
+ </ul>
58
+ </li>
59
+ </ul>
60
+ </li>
61
+ <li>
62
+ <a v-ripple class="flex px-6 p-3 lg:px-3 lg:py-2 align-items-center text-600 hover:text-900 hover:surface-100 font-medium border-round cursor-pointer transition-colors transition-duration-150 p-ripple">
63
+ <i class="pi pi-calendar mr-2"></i>
64
+ <span>Calendar</span>
65
+ </a>
66
+ </li>
67
+ <li>
68
+ <a v-ripple class="flex px-6 p-3 lg:px-3 lg:py-2 align-items-center text-600 hover:text-900 hover:surface-100 font-medium border-round cursor-pointer transition-colors transition-duration-150 p-ripple">
69
+ <i class="pi pi-chart-line mr-2"></i>
70
+ <span>Stats</span>
71
+ </a>
72
+ </li>
73
+ </ul>
74
+ <ul class="list-none p-0 m-0 flex lg:align-items-center select-none flex-column lg:flex-row border-top-1 surface-border lg:border-top-none">
75
+ <li>
76
+ <a v-ripple class="flex px-6 p-3 lg:px-3 lg:py-2 align-items-center text-600 hover:text-900 hover:surface-100 font-medium border-round cursor-pointer transition-colors transition-duration-150 p-ripple">
77
+ <i class="pi pi-inbox text-base lg:text-2xl mr-2 lg:mr-0"></i>
78
+ <span class="block lg:hidden font-medium">Inbox</span>
79
+ </a>
80
+ </li>
81
+ <li class="border-top-1 surface-border lg:border-top-none">
82
+ <a v-ripple class="flex px-6 p-3 lg:px-3 lg:py-2 align-items-center hover:surface-100 font-medium border-round cursor-pointer transition-colors transition-duration-150 p-ripple">
83
+ <img src="/images/empty-user-photo.svg" class="mr-3 lg:mr-0 border-circle" style="width: 28px; height: 28px"/>
84
+ <div class="block lg:hidden">
85
+ <div class="text-900 font-medium">Josephine Lillard</div>
86
+ <span class="text-600 font-medium text-sm">Marketing Specialist</span>
87
+ </div>
88
+ </a>
89
+ </li>
90
+ </ul>
91
+ </div>
92
+ </div>
93
+ </template>
94
+
95
+ <script setup>
96
+ import Badge from "primevue/badge"
97
+
98
+ import NotificationsIcon from "./notifications/NotificationsIcon.vue"
99
+ </script>
100
+
101
+ <style scoped>
102
+
103
+ </style>
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <ul class="surface-card p-0 m-0 list-none flex overflow-x-auto select-none">
3
+ <li v-for="tab in tabs">
4
+ <router-link v-ripple :to="{ name: tab.route }"
5
+ class="cursor-pointer px-4 py-3 flex align-items-center border-bottom-2 hover:border-500
6
+ transition-colors transition-duration-150 p-ripple"
7
+ :class="isActive(tab) ? 'border-blue-500 text-blue-500 hover:border-blue-500': 'text-700 border-transparent'"
8
+ style="text-decoration: none">
9
+ <i class="pi mr-2" :class="tab.icon"></i>
10
+ <span class="font-medium">{{ tab.title }}</span>
11
+ </router-link>
12
+ </li>
13
+ </ul>
14
+ </template>
15
+
16
+ <script setup>
17
+ import { useRouter, useRoute } from 'vue-router'
18
+ import { live, path } from '@live-change/vue3-ssr'
19
+ import { computed } from 'vue'
20
+
21
+ const route = useRoute()
22
+ const router = useRouter()
23
+
24
+ const passwordExists = await live(path().passwordAuthentication.myUserPasswordAuthenticationExists())
25
+
26
+ const tabs = computed(() => ([{
27
+ title: "Connected accounts",
28
+ route: 'user:connected',
29
+ icon: 'pi-user'
30
+ }, passwordExists.value ? {
31
+ title: "Change password",
32
+ route: 'user:changePassword',
33
+ icon: 'pi-key'
34
+ } : {
35
+ title: "Set password",
36
+ route: 'user:changePassword',
37
+ icon: 'pi-key'
38
+ }]))
39
+
40
+ function isActive(tab) {
41
+ return route.name == tab.route
42
+ }
43
+
44
+ </script>
45
+
46
+ <style>
47
+
48
+ </style>
@@ -0,0 +1,58 @@
1
+ <template>
2
+ <div class="w-full lg:w-6 md:w-9" v-shared-element:form="{ duration: '300ms', includeChildren: true }">
3
+ <div class="surface-card p-4 shadow-2 border-round">
4
+ <div class="text-center mb-5">
5
+ <div class="text-900 text-3xl font-medium mb-3">Connect account</div>
6
+ </div>
7
+
8
+ <command-form service="messageAuthentication" action="connectEmail" v-slot="{ data }"
9
+ @done="handleSent" keepOnDone>
10
+
11
+ <div class="p-field mb-3">
12
+ <label for="email" class="block text-900 font-medium mb-2">
13
+ Email address
14
+ </label>
15
+ <InputText id="email" type="text" class="w-full"
16
+ aria-describedby="email-help" :class="{ 'p-invalid': data.emailError}"
17
+ v-model="data.email" />
18
+ <small v-if="data.emailError" id="email-help" class="p-error">{{ data.emailError }}</small>
19
+ </div>
20
+
21
+ <Button label="Connect" icon="pi pi-user" class="w-full" type="submit"></Button>
22
+
23
+ <Divider align="center" class="my-4">
24
+ <span class="text-600 font-normal text-sm">OR</span>
25
+ </Divider>
26
+
27
+ <Button label="Connect GitHub account" icon="pi pi-github" class="w-full p-button-secondary mb-2"></Button>
28
+ <Button label="Connect Google account" icon="pi pi-google" class="w-full p-button-secondary mb-1"></Button>
29
+
30
+ </command-form>
31
+ </div>
32
+ </div>
33
+ </template>
34
+
35
+ <script setup>
36
+ import InputText from "primevue/inputtext"
37
+ import Checkbox from "primevue/checkbox"
38
+ import Button from "primevue/button"
39
+ import Divider from "primevue/divider"
40
+
41
+ import { useRouter } from 'vue-router'
42
+ const router = useRouter()
43
+
44
+ function handleSent({ parameters, result }) {
45
+ const { authentication } = result
46
+ router.push({
47
+ name: 'user:sent',
48
+ params: {
49
+ authentication
50
+ }
51
+ })
52
+ }
53
+
54
+ </script>
55
+
56
+ <style>
57
+
58
+ </style>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <div class="w-full lg:w-6 md:w-9" v-shared-element:form="{ duration: '300ms', includeChildren: true }">
3
+ <div class="surface-card border-round shadow-2 p-4">
4
+ <div class="text-900 font-medium mb-4 text-xl">Account connected</div>
5
+ <div class="mt-0 p-0 line-height-3">Congratulations! You have successfully connected accounts.</div>
6
+ </div>
7
+ </div>
8
+ </template>
9
+
10
+ <script setup>
11
+
12
+ </script>
13
+
14
+ <style>
15
+
16
+ </style>