@bettertogether/community-engine-vue 0.1.7 → 0.2.2
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/README.md +140 -1
- package/dist/assets/BBadge.vue_vue_type_script_setup_true_lang-IIZ8QpjG-Z9WDKHqT.js +1 -0
- package/dist/assets/BCardText.vue_vue_type_script_setup_true_lang-Be6CD36N-B5JCTdmm.js +3 -0
- package/dist/assets/BFormSelect.vue_vue_type_script_setup_true_lang-BigptVap-B_HbOOZR.js +1 -0
- package/dist/assets/BRow.vue_vue_type_script_setup_true_lang-69TY75-8-DJdEdyx7.js +1 -0
- package/dist/assets/Communities-Cx4tT-bx.js +1 -0
- package/dist/assets/Communities-n33ssuUH.css +1 -0
- package/dist/assets/CommunityConversation-bBkYBs2k.css +1 -0
- package/dist/assets/CommunityConversation-jHAnv_Ps.js +1 -0
- package/dist/assets/CommunityConversations-rEDGS7To.js +1 -0
- package/dist/assets/CommunityEvent-CUdT0aT4.js +1 -0
- package/dist/assets/CommunityEvents-rsOgcxQr.js +1 -0
- package/dist/assets/CommunityHome-ChuTE2Nz.js +1 -0
- package/dist/assets/CommunityJoaTu-CpLIY_83.js +1 -0
- package/dist/assets/CommunityMembers-C3UtzQGp.css +1 -0
- package/dist/assets/CommunityMembers-DKf74ltl.js +1 -0
- package/dist/assets/CommunityPage-C5x23iQl.css +1 -0
- package/dist/assets/CommunityPage-CRYg9-rW.js +1 -0
- package/dist/assets/CommunityPages-IsLTNFC3.js +1 -0
- package/dist/assets/CommunityPost-BOnqqxVs.js +1 -0
- package/dist/assets/CommunityPost-BRYtkDSY.css +1 -0
- package/dist/assets/CommunityPosts-DY1olmcU.js +1 -0
- package/dist/assets/Error404-D10VQARe.js +1 -0
- package/dist/assets/EventCard-vfutXTdg.js +1 -0
- package/dist/assets/EventList-ChtehYcJ.js +1 -0
- package/dist/assets/ExtensionSlot-DJKbrq4c.js +1 -0
- package/dist/assets/PostList-BuHrBBqX.css +1 -0
- package/dist/assets/PostList-DYFgxlE8.js +1 -0
- package/dist/assets/SyncBadge-B1JBsdUk.js +1 -0
- package/dist/assets/SyncBadge-FNO-QLuu.css +1 -0
- package/dist/assets/UserPasswordNew-D_Djldm9.css +1 -0
- package/dist/assets/UserPasswordNew-al9bNBTZ.js +1 -0
- package/dist/assets/UserPasswordReset-42zs98RW.js +1 -0
- package/dist/assets/UserPasswordReset-D_6OQDZY.css +1 -0
- package/dist/assets/UserResendConfirmation-CGavYB81.js +1 -0
- package/dist/assets/UserResendConfirmation-DNTHcaar.css +1 -0
- package/dist/assets/UserSignIn-BIRb0HkV.js +1 -0
- package/dist/assets/UserSignIn-C-Pol8OD.css +1 -0
- package/dist/assets/UserSignUp-ChkKQAd2.css +1 -0
- package/dist/assets/UserSignUp-Df6o3vlO.js +1 -0
- package/dist/assets/better-together-logo-61cxo5d5.png +0 -0
- package/dist/assets/index-BFt-JKVh.css +5 -0
- package/dist/assets/index-COo3Jb7v.js +1088 -0
- package/dist/assets/nodefs-Bfyh92qg.js +1 -0
- package/dist/assets/opfs-ahp-BLzlXf6u.js +3 -0
- package/dist/assets/pglite-BdRI_ZYT.wasm +0 -0
- package/dist/assets/pglite-COscPi1Y.data +0 -0
- package/dist/assets/usePages-DDjDQRCy.js +1 -0
- package/dist/assets/usePosts-Bf2Ccwr4.js +1 -0
- package/{public → dist}/index.html +9 -19
- package/package.json +57 -45
- package/src/BtApp.vue +34 -43
- package/src/components/BtBrandingLogo.vue +10 -18
- package/src/components/BtHeader.vue +31 -89
- package/src/components/BtMainContent.vue +12 -43
- package/src/components/BtNavBar.vue +25 -38
- package/src/components/BtNavItem.vue +25 -58
- package/src/components/BtNavUser.vue +65 -86
- package/src/components/BtProfileForm.vue +48 -39
- package/src/components/BtUserNewPasswordForm.vue +52 -74
- package/src/components/BtUserResendConfirmationForm.vue +45 -83
- package/src/components/BtUserResetPasswordForm.vue +45 -77
- package/src/components/BtUserSignInForm.vue +59 -75
- package/src/components/BtUserSignUpForm.vue +90 -103
- package/src/components/CommunityForm.vue +47 -39
- package/src/components/community/CommunityCard.vue +113 -0
- package/src/components/community/CommunityHeader.vue +91 -0
- package/src/components/community/CommunityList.vue +59 -0
- package/src/components/community/MemberRoleRow.vue +107 -0
- package/src/components/conversation/ConversationCard.vue +49 -0
- package/src/components/conversation/ConversationDetail.vue +53 -0
- package/src/components/conversation/ConversationList.vue +51 -0
- package/src/components/conversation/MessageForm.vue +45 -0
- package/src/components/conversation/MessageItem.vue +43 -0
- package/src/components/conversation/MessageList.vue +39 -0
- package/src/components/event/EventCard.vue +82 -0
- package/src/components/event/EventForm.vue +99 -0
- package/src/components/event/EventList.vue +47 -0
- package/src/components/invitation/InvitationCard.vue +56 -0
- package/src/components/invitation/InvitationForm.vue +70 -0
- package/src/components/invitation/InvitationList.vue +51 -0
- package/src/components/joatu/AgreementCard.vue +57 -0
- package/src/components/joatu/AgreementList.vue +51 -0
- package/src/components/joatu/OfferCard.vue +65 -0
- package/src/components/joatu/OfferForm.vue +82 -0
- package/src/components/joatu/OfferList.vue +51 -0
- package/src/components/joatu/RequestCard.vue +65 -0
- package/src/components/joatu/RequestForm.vue +82 -0
- package/src/components/joatu/RequestList.vue +51 -0
- package/src/components/page/PageCard.vue +55 -0
- package/src/components/page/PageDetail.vue +35 -0
- package/src/components/page/PageList.vue +51 -0
- package/src/components/person/MemberList.vue +61 -0
- package/src/components/person/PersonAvatar.vue +54 -0
- package/src/components/person/PersonCard.vue +47 -0
- package/src/components/post/PostCard.vue +105 -0
- package/src/components/post/PostDetail.vue +98 -0
- package/src/components/post/PostForm.vue +84 -0
- package/src/components/post/PostList.vue +53 -0
- package/src/components/role/BlockButton.vue +44 -0
- package/src/components/role/RoleBadge.vue +19 -0
- package/src/components/role/RoleGate.vue +62 -0
- package/src/components/role/RoleSelector.vue +29 -0
- package/src/components/shared/ExtensionSlot.vue +27 -0
- package/src/components/sync/OfflineBanner.vue +49 -0
- package/src/components/sync/SyncBadge.vue +108 -0
- package/src/components/sync/SyncStatusBar.vue +121 -0
- package/src/composables/useCommunities.js +19 -0
- package/src/composables/useConversations.js +5 -0
- package/src/composables/useEvents.js +28 -0
- package/src/composables/useInvitations.js +10 -0
- package/src/composables/useJoaTuAgreements.js +11 -0
- package/src/composables/useJoaTuOffers.js +10 -0
- package/src/composables/useJoaTuRequests.js +10 -0
- package/src/composables/useMembers.js +30 -0
- package/src/composables/useMessages.js +5 -0
- package/src/composables/useNotifications.js +5 -0
- package/src/composables/usePages.js +6 -0
- package/src/composables/usePersonBlocks.js +65 -0
- package/src/composables/usePosts.js +27 -0
- package/src/composables/useResource.js +137 -0
- package/src/composables/useRoles.js +94 -0
- package/src/composables/useSyncStatus.js +22 -0
- package/src/composables/useToaster.js +20 -0
- package/src/context.js +18 -0
- package/src/db/client.js +343 -0
- package/src/db/migrations/001_initial.sql +131 -0
- package/src/db/migrations/003_conversations_invitations_pages_joatu.sql +76 -0
- package/src/db/sync.js +276 -0
- package/src/endpoints/BtApiAuth.js +1 -1
- package/src/endpoints/BtApiV1.js +1 -1
- package/src/extension.js +45 -0
- package/src/i18n/index.js +103 -0
- package/src/i18n/locales/en.json +275 -0
- package/src/i18n/locales/es.json +275 -0
- package/src/i18n/locales/fr.json +223 -0
- package/src/i18n/locales/uk.json +275 -0
- package/src/index.js +168 -22
- package/src/layouts/CommunityLayout.vue +89 -0
- package/src/main.js +16 -12
- package/src/mixins/error-handling.js +6 -15
- package/src/mixins/toaster.js +15 -10
- package/src/pages/Communities.vue +59 -0
- package/src/pages/Error404.vue +10 -14
- package/src/pages/Home.vue +11 -18
- package/src/pages/Me.vue +39 -59
- package/src/pages/UserPasswordNew.vue +12 -68
- package/src/pages/UserPasswordReset.vue +15 -64
- package/src/pages/UserResendConfirmation.vue +39 -113
- package/src/pages/UserSignIn.vue +18 -67
- package/src/pages/UserSignUp.vue +15 -64
- package/src/pages/community/CommunityConversation.vue +31 -0
- package/src/pages/community/CommunityConversations.vue +18 -0
- package/src/pages/community/CommunityEvent.vue +39 -0
- package/src/pages/community/CommunityEvents.vue +58 -0
- package/src/pages/community/CommunityHome.vue +49 -0
- package/src/pages/community/CommunityJoaTu.vue +115 -0
- package/src/pages/community/CommunityMembers.vue +23 -0
- package/src/pages/community/CommunityPage.vue +31 -0
- package/src/pages/community/CommunityPages.vue +25 -0
- package/src/pages/community/CommunityPost.vue +28 -0
- package/src/pages/community/CommunityPosts.vue +58 -0
- package/src/pages/community/CommunitySettingsPage.vue +117 -0
- package/src/pages/community/RoleManagerPage.vue +93 -0
- package/src/plugins/bootstrap-vue.js +5 -5
- package/src/plugins/font-awesome.js +3 -2
- package/src/plugins/index.js +9 -4
- package/src/plugins/progress.js +16 -0
- package/src/pwa/index.js +156 -0
- package/src/pwa/sw-helpers.js +130 -0
- package/src/router/communityRoutes.js +78 -0
- package/src/router/index.js +30 -144
- package/src/slot-registry.js +15 -0
- package/src/stores/auth.js +134 -0
- package/src/stores/communities.js +59 -0
- package/src/stores/index.js +5 -0
- package/src/stores/menus.js +14 -0
- package/src/stores/people.js +48 -0
- package/src/stores/sync.js +93 -0
- package/src/stylesheets/sync-indicators.scss +34 -0
- package/.env.sample +0 -1
- package/.eslintrc.js +0 -51
- package/.gitlab-ci.yml +0 -14
- package/.travis/.rbenv-gemsets +0 -1
- package/.travis/.ruby-version +0 -1
- package/.travis.yml +0 -31
- package/babel.config.js +0 -5
- package/cypress.json +0 -3
- package/deploy/build.sh +0 -8
- package/eslint.config.js +0 -16
- package/postcss.config.js +0 -5
- package/src/eslint.config.js +0 -16
- package/src/forms/BtProfileFormSchema.js +0 -19
- package/src/forms/BtUserConfirmationFormSchema.js +0 -20
- package/src/forms/BtUserNewPasswordFormSchema.js +0 -29
- package/src/forms/BtUserResetPasswordFormSchema.js +0 -20
- package/src/forms/BtUserSignInFormSchema.js +0 -29
- package/src/forms/BtUserSignUpFormSchema.js +0 -63
- package/src/forms/CommunityFormSchema.js +0 -19
- package/src/plugins/vue-form-generator.js +0 -4
- package/src/plugins/vue-loading.js +0 -10
- package/src/registerServiceWorker.js +0 -32
- package/src/store/index.js +0 -32
- package/src/store/modules/authentication.js +0 -170
- package/src/store/modules/communities.js +0 -98
- package/src/store/modules/community-engine.js +0 -14
- package/src/store/modules/menus.js +0 -52
- package/src/store/modules/people.js +0 -88
- package/src/vue.config.js +0 -0
- package/tests/e2e/.eslintrc.js +0 -12
- package/tests/e2e/plugins/index.js +0 -26
- package/tests/e2e/specs/home.js +0 -8
- package/tests/e2e/support/commands.js +0 -25
- package/tests/e2e/support/index.js +0 -20
- package/tests/unit/.eslintrc.js +0 -5
- package/tests/unit/example.spec.js +0 -13
- package/vue.config.js +0 -11
- package/webpack.config.js +0 -28
- /package/{public → dist}/_redirects +0 -0
- /package/{public → dist}/favicon.ico +0 -0
- /package/{public → dist}/img/favicon.ico +0 -0
- /package/{public → dist}/img/icons/android-chrome-192x192.png +0 -0
- /package/{public → dist}/img/icons/android-chrome-384x384.png +0 -0
- /package/{public → dist}/img/icons/apple-touch-icon.png +0 -0
- /package/{public → dist}/img/icons/favicon-16x16.png +0 -0
- /package/{public → dist}/img/icons/favicon-32x32.png +0 -0
- /package/{public → dist}/img/icons/favicon.ico +0 -0
- /package/{public → dist}/img/icons/mstile-150x150.png +0 -0
- /package/{public → dist}/img/icons/safari-pinned-tab.svg +0 -0
- /package/{public → dist}/robots.txt +0 -0
|
@@ -1,54 +1,41 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<BNavbarNav
|
|
3
3
|
:class="navbarClass"
|
|
4
4
|
pills
|
|
5
5
|
align="center"
|
|
6
6
|
>
|
|
7
7
|
<BtNavItem
|
|
8
|
-
v-for="
|
|
9
|
-
:id="
|
|
10
|
-
:key="
|
|
11
|
-
:external="
|
|
12
|
-
:label="
|
|
13
|
-
:target="
|
|
14
|
-
:title="
|
|
15
|
-
:path="
|
|
16
|
-
:url="
|
|
8
|
+
v-for="item in menuStore.headerMenuItems"
|
|
9
|
+
:id="item.id"
|
|
10
|
+
:key="item.id"
|
|
11
|
+
:external="item.external"
|
|
12
|
+
:label="item.label"
|
|
13
|
+
:target="item.target"
|
|
14
|
+
:title="item.title"
|
|
15
|
+
:path="item.path"
|
|
16
|
+
:url="item.url"
|
|
17
17
|
:navitem-class="navitemClass"
|
|
18
18
|
/>
|
|
19
|
-
<BtNavUser v-if="isAuthenticated" />
|
|
20
|
-
</
|
|
19
|
+
<BtNavUser v-if="authStore.isAuthenticated" />
|
|
20
|
+
</BNavbarNav>
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
|
-
<script>
|
|
24
|
-
import {
|
|
25
|
-
|
|
23
|
+
<script setup>
|
|
24
|
+
import { BNavbarNav } from 'bootstrap-vue-next'
|
|
25
|
+
import { useAuthStore } from '../stores/auth'
|
|
26
|
+
import { useMenuStore } from '../stores/menus'
|
|
26
27
|
import BtNavItem from './BtNavItem.vue'
|
|
28
|
+
import BtNavUser from './BtNavUser.vue'
|
|
29
|
+
|
|
30
|
+
defineProps({
|
|
31
|
+
navbarClass: { type: String, default: '' },
|
|
32
|
+
navitemClass: { type: String, default: '' },
|
|
33
|
+
})
|
|
27
34
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
components: {
|
|
31
|
-
BtNavItem,
|
|
32
|
-
},
|
|
33
|
-
props: {
|
|
34
|
-
navbarClass: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: '',
|
|
37
|
-
},
|
|
38
|
-
navitemClass: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: '',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
computed: {
|
|
44
|
-
...mapGetters('CommunityEngine/Authentication', ['isAuthenticated']),
|
|
45
|
-
...mapGetters('CommunityEngine/Menus', ['headerMenuItems']),
|
|
46
|
-
},
|
|
47
|
-
}
|
|
35
|
+
const authStore = useAuthStore()
|
|
36
|
+
const menuStore = useMenuStore()
|
|
48
37
|
</script>
|
|
49
38
|
|
|
50
39
|
<style scoped lang="scss">
|
|
51
|
-
|
|
52
|
-
text-align: center;
|
|
53
|
-
}
|
|
40
|
+
.center { text-align: center; }
|
|
54
41
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<BNavItem
|
|
3
3
|
:class="navitemClass"
|
|
4
4
|
:href="localHref"
|
|
5
5
|
:target="target"
|
|
@@ -8,78 +8,45 @@
|
|
|
8
8
|
>
|
|
9
9
|
<nobr>
|
|
10
10
|
{{ label }}
|
|
11
|
-
<
|
|
11
|
+
<FontAwesomeIcon
|
|
12
12
|
v-if="external"
|
|
13
13
|
icon="external-link-alt"
|
|
14
14
|
size="xs"
|
|
15
15
|
title="External Link"
|
|
16
16
|
/>
|
|
17
17
|
</nobr>
|
|
18
|
-
</
|
|
18
|
+
</BNavItem>
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
|
-
<script>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
path: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: '#',
|
|
44
|
-
},
|
|
45
|
-
sortOrder: {
|
|
46
|
-
type: Number,
|
|
47
|
-
default: 0,
|
|
48
|
-
},
|
|
49
|
-
target: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: '_self',
|
|
52
|
-
},
|
|
53
|
-
title: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: '',
|
|
56
|
-
},
|
|
57
|
-
url: {
|
|
58
|
-
type: String,
|
|
59
|
-
default: '#',
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
computed: {
|
|
63
|
-
localHref() { return this.external ? this.url : undefined },
|
|
64
|
-
localTitle() { return this.title !== '' ? this.title : this.label },
|
|
65
|
-
localTo() { return !this.external ? this.path : undefined },
|
|
66
|
-
},
|
|
67
|
-
}
|
|
21
|
+
<script setup>
|
|
22
|
+
import { computed } from 'vue'
|
|
23
|
+
import { BNavItem } from 'bootstrap-vue-next'
|
|
24
|
+
|
|
25
|
+
const props = defineProps({
|
|
26
|
+
id: { type: Number, default: 0 },
|
|
27
|
+
external: { type: Boolean, default: false },
|
|
28
|
+
label: { type: String, default: 'Label' },
|
|
29
|
+
navitemClass: { type: String, default: '' },
|
|
30
|
+
path: { type: String, default: '#' },
|
|
31
|
+
sortOrder: { type: Number, default: 0 },
|
|
32
|
+
target: { type: String, default: '_self' },
|
|
33
|
+
title: { type: String, default: '' },
|
|
34
|
+
url: { type: String, default: '#' },
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const localHref = computed(() => props.external ? props.url : undefined)
|
|
38
|
+
const localTitle = computed(() => props.title !== '' ? props.title : props.label)
|
|
39
|
+
const localTo = computed(() => !props.external ? props.path : undefined)
|
|
68
40
|
</script>
|
|
69
41
|
|
|
70
42
|
<style scoped lang="scss">
|
|
71
43
|
@import '../stylesheets/theme.scss';
|
|
72
|
-
.nav-item {
|
|
73
|
-
color: red;
|
|
74
44
|
|
|
75
|
-
|
|
45
|
+
.nav-item {
|
|
46
|
+
:deep(> a.nav-link) {
|
|
76
47
|
font-weight: bold;
|
|
77
48
|
color: $default-text-color-bg-dark;
|
|
78
|
-
|
|
79
|
-
&.router-link-exact-active,
|
|
80
|
-
&:hover {
|
|
81
|
-
color: $accent-color;
|
|
82
|
-
}
|
|
49
|
+
&.router-link-exact-active, &:hover { color: $accent-color; }
|
|
83
50
|
}
|
|
84
51
|
}
|
|
85
52
|
</style>
|
|
@@ -1,108 +1,87 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<BNavItemDropdown
|
|
3
3
|
class="user-dropdown"
|
|
4
4
|
:text="dropdownText"
|
|
5
|
-
|
|
5
|
+
end
|
|
6
6
|
>
|
|
7
|
-
<
|
|
8
|
-
v-if="isAuthenticated"
|
|
7
|
+
<BDropdownItem
|
|
8
|
+
v-if="authStore.isAuthenticated"
|
|
9
9
|
to="/me"
|
|
10
10
|
>
|
|
11
|
-
|
|
12
|
-
</
|
|
13
|
-
<
|
|
14
|
-
v-if="isAuthenticated"
|
|
15
|
-
@click="
|
|
11
|
+
{{ t('bt.navigation.me') }}
|
|
12
|
+
</BDropdownItem>
|
|
13
|
+
<BDropdownItem
|
|
14
|
+
v-if="authStore.isAuthenticated"
|
|
15
|
+
@click="handleSignOut"
|
|
16
16
|
>
|
|
17
|
-
|
|
18
|
-
</
|
|
19
|
-
<
|
|
20
|
-
v-if="!isAuthenticated"
|
|
17
|
+
{{ t('bt.auth.sign_out') }}
|
|
18
|
+
</BDropdownItem>
|
|
19
|
+
<BDropdownItem
|
|
20
|
+
v-if="!authStore.isAuthenticated"
|
|
21
21
|
to="/users/sign-in"
|
|
22
22
|
>
|
|
23
|
-
|
|
24
|
-
</
|
|
25
|
-
<
|
|
26
|
-
v-if="!isAuthenticated"
|
|
23
|
+
{{ t('bt.auth.sign_in') }}
|
|
24
|
+
</BDropdownItem>
|
|
25
|
+
<BDropdownItem
|
|
26
|
+
v-if="!authStore.isAuthenticated"
|
|
27
27
|
to="/users/sign-up"
|
|
28
28
|
>
|
|
29
|
-
|
|
30
|
-
</
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
>
|
|
34
|
-
|
|
35
|
-
</b-dropdown-item>
|
|
36
|
-
</b-nav-item-dropdown>
|
|
29
|
+
{{ t('bt.auth.sign_up') }}
|
|
30
|
+
</BDropdownItem>
|
|
31
|
+
<BDropdownItem to="/">
|
|
32
|
+
{{ t('bt.app.name') }}
|
|
33
|
+
</BDropdownItem>
|
|
34
|
+
</BNavItemDropdown>
|
|
37
35
|
</template>
|
|
38
36
|
|
|
39
|
-
<script>
|
|
40
|
-
import {
|
|
41
|
-
import
|
|
37
|
+
<script setup>
|
|
38
|
+
import { computed } from 'vue'
|
|
39
|
+
import { useI18n } from 'vue-i18n'
|
|
40
|
+
import { useRouter } from 'vue-router'
|
|
41
|
+
import { BNavItemDropdown, BDropdownItem } from 'bootstrap-vue-next'
|
|
42
|
+
import { useAuthStore } from '../stores/auth'
|
|
43
|
+
import { usePeopleStore } from '../stores/people'
|
|
44
|
+
import { useToaster } from '../composables/useToaster'
|
|
45
|
+
|
|
46
|
+
const { t } = useI18n()
|
|
47
|
+
const authStore = useAuthStore()
|
|
48
|
+
const peopleStore = usePeopleStore()
|
|
49
|
+
const router = useRouter()
|
|
50
|
+
const { toast } = useToaster()
|
|
42
51
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
...mapGetters('CommunityEngine/People', ['hasCurrentPerson']),
|
|
51
|
-
dropdownText() {
|
|
52
|
-
if (this.isAuthenticated) {
|
|
53
|
-
if (this.hasCurrentPerson) return this.currentPerson.name
|
|
54
|
-
return this.currentUser.email
|
|
55
|
-
}
|
|
52
|
+
const dropdownText = computed(() => {
|
|
53
|
+
if (authStore.isAuthenticated) {
|
|
54
|
+
if (peopleStore.hasCurrentPerson) return peopleStore.currentPerson.name
|
|
55
|
+
return authStore.currentUser.email
|
|
56
|
+
}
|
|
57
|
+
return t('bt.auth.sign_in')
|
|
58
|
+
})
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (this.$route.path !== '/') {
|
|
65
|
-
this.$router.push('/').then(() => {
|
|
66
|
-
this.$toaster('You are now signed out!', 'info')
|
|
67
|
-
})
|
|
68
|
-
} else {
|
|
69
|
-
this.$toaster('You are now signed out!', 'info')
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
},
|
|
73
|
-
},
|
|
60
|
+
async function handleSignOut() {
|
|
61
|
+
await authStore.signOut()
|
|
62
|
+
peopleStore.clearCurrentPerson()
|
|
63
|
+
if (router.currentRoute.value.path !== '/') {
|
|
64
|
+
await router.push('/')
|
|
65
|
+
}
|
|
66
|
+
toast('You are now signed out!', 'info')
|
|
74
67
|
}
|
|
75
68
|
</script>
|
|
76
69
|
|
|
77
70
|
<style scoped lang="scss">
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
.user-dropdown {
|
|
81
|
-
::v-deep a.dropdown-item {
|
|
82
|
-
font-weight: bold;
|
|
83
|
-
color: $default-text-color;
|
|
84
|
-
text-align: right;
|
|
71
|
+
@import '../stylesheets/theme.scss';
|
|
85
72
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
::v-deep a.dropdown-toggle {
|
|
93
|
-
font-weight: bold;
|
|
94
|
-
color: $default-text-color-bg-dark;
|
|
95
|
-
|
|
96
|
-
&.router-link-exact-active,
|
|
97
|
-
&:hover {
|
|
98
|
-
color: $accent-color;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
> span {
|
|
102
|
-
max-width: 75px;
|
|
103
|
-
display: inline-block;
|
|
104
|
-
overflow: clip;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
73
|
+
.user-dropdown {
|
|
74
|
+
:deep(a.dropdown-item) {
|
|
75
|
+
font-weight: bold;
|
|
76
|
+
color: $default-text-color;
|
|
77
|
+
text-align: right;
|
|
78
|
+
&.router-link-exact-active, &:hover { color: $accent-color; }
|
|
107
79
|
}
|
|
80
|
+
:deep(a.dropdown-toggle) {
|
|
81
|
+
font-weight: bold;
|
|
82
|
+
color: $default-text-color-bg-dark;
|
|
83
|
+
&.router-link-exact-active, &:hover { color: $accent-color; }
|
|
84
|
+
> span { max-width: 75px; display: inline-block; overflow: clip; }
|
|
85
|
+
}
|
|
86
|
+
}
|
|
108
87
|
</style>
|
|
@@ -1,45 +1,54 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
<BForm @submit.prevent="handleSubmit">
|
|
3
|
+
<BFormGroup
|
|
4
|
+
:label="t('bt.person.name_label')"
|
|
5
|
+
label-for="profile-name"
|
|
6
|
+
>
|
|
7
|
+
<BFormInput
|
|
8
|
+
id="profile-name"
|
|
9
|
+
v-model="localModel.name"
|
|
10
|
+
type="text"
|
|
11
|
+
:placeholder="t('bt.person.name_label')"
|
|
12
|
+
/>
|
|
13
|
+
</BFormGroup>
|
|
14
|
+
<BFormGroup
|
|
15
|
+
:label="t('bt.person.description_label')"
|
|
16
|
+
label-for="profile-description"
|
|
17
|
+
>
|
|
18
|
+
<BFormTextarea
|
|
19
|
+
id="profile-description"
|
|
20
|
+
v-model="localModel.description"
|
|
21
|
+
rows="3"
|
|
22
|
+
:placeholder="t('bt.person.description_label')"
|
|
23
|
+
/>
|
|
24
|
+
</BFormGroup>
|
|
25
|
+
<BButton
|
|
26
|
+
type="submit"
|
|
27
|
+
variant="primary"
|
|
28
|
+
>
|
|
29
|
+
{{ t('bt.actions.save') }}
|
|
30
|
+
</BButton>
|
|
31
|
+
</BForm>
|
|
10
32
|
</template>
|
|
11
33
|
|
|
12
|
-
<script>
|
|
13
|
-
import
|
|
14
|
-
import
|
|
34
|
+
<script setup>
|
|
35
|
+
import { computed } from 'vue'
|
|
36
|
+
import { useI18n } from 'vue-i18n'
|
|
37
|
+
import { BForm, BFormGroup, BFormInput, BFormTextarea, BButton } from 'bootstrap-vue-next'
|
|
15
38
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
model: {
|
|
23
|
-
type: Object,
|
|
24
|
-
required: true,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
data() {
|
|
28
|
-
return {
|
|
29
|
-
schema: BtProfileFormSchema,
|
|
30
|
-
name: '',
|
|
31
|
-
description: '',
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
computed: {
|
|
35
|
-
localModel: {
|
|
36
|
-
get() { return this.model },
|
|
37
|
-
set(model) { this.$emit('input', model) },
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
}
|
|
41
|
-
</script>
|
|
39
|
+
const { t } = useI18n()
|
|
40
|
+
|
|
41
|
+
const props = defineProps({
|
|
42
|
+
model: { type: Object, required: true },
|
|
43
|
+
})
|
|
44
|
+
const emit = defineEmits(['update:model'])
|
|
42
45
|
|
|
43
|
-
|
|
46
|
+
const localModel = computed({
|
|
47
|
+
get: () => props.model,
|
|
48
|
+
set: (val) => emit('update:model', val),
|
|
49
|
+
})
|
|
44
50
|
|
|
45
|
-
|
|
51
|
+
function handleSubmit() {
|
|
52
|
+
emit('update:model', localModel.value)
|
|
53
|
+
}
|
|
54
|
+
</script>
|
|
@@ -1,83 +1,61 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
<BForm @submit.prevent="handleSubmit">
|
|
3
|
+
<BFormGroup
|
|
4
|
+
:label="t('bt.auth.new_password')"
|
|
5
|
+
label-for="new-password"
|
|
6
|
+
>
|
|
7
|
+
<BFormInput
|
|
8
|
+
id="new-password"
|
|
9
|
+
v-model="password"
|
|
10
|
+
type="password"
|
|
11
|
+
required
|
|
12
|
+
minlength="12"
|
|
13
|
+
:placeholder="t('bt.auth.new_password')"
|
|
14
|
+
/>
|
|
15
|
+
<BFormText>{{ t('bt.auth.password_hint') }}</BFormText>
|
|
16
|
+
</BFormGroup>
|
|
17
|
+
<BButton
|
|
18
|
+
type="submit"
|
|
19
|
+
variant="primary"
|
|
20
|
+
class="w-100"
|
|
21
|
+
:disabled="loading"
|
|
22
|
+
>
|
|
23
|
+
{{ t('bt.auth.change_password') }}
|
|
24
|
+
</BButton>
|
|
25
|
+
</BForm>
|
|
11
26
|
</template>
|
|
12
27
|
|
|
13
|
-
<script>
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
28
|
+
<script setup>
|
|
29
|
+
import { ref } from 'vue'
|
|
30
|
+
import { useI18n } from 'vue-i18n'
|
|
31
|
+
import { useRouter } from 'vue-router'
|
|
32
|
+
import { BForm, BFormGroup, BFormInput, BFormText, BButton } from 'bootstrap-vue-next'
|
|
33
|
+
import { useAuthStore } from '../stores/auth'
|
|
34
|
+
import { useToaster } from '../composables/useToaster'
|
|
18
35
|
|
|
19
|
-
|
|
20
|
-
name: 'BtUserNewPasswordForm',
|
|
21
|
-
components: {
|
|
22
|
-
'vue-form-generator': VueFormGenerator.component,
|
|
23
|
-
},
|
|
24
|
-
mixins: [toaster],
|
|
25
|
-
props: {
|
|
26
|
-
model: {
|
|
27
|
-
type: Object,
|
|
28
|
-
required: true,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
data() {
|
|
32
|
-
return {
|
|
33
|
-
schema: BtUserNewPasswordFormSchema,
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
computed: {
|
|
37
|
-
localModel: {
|
|
38
|
-
get() { return this.model },
|
|
39
|
-
set(model) { this.$emit('input', model) },
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
methods: {
|
|
43
|
-
...mapActions('CommunityEngine/Authentication', ['newPassword']),
|
|
44
|
-
onValidated(isValid) {
|
|
45
|
-
if (isValid) {
|
|
46
|
-
this.newPassword(this.model).then(() => {
|
|
47
|
-
if (this.$route.path !== '/') {
|
|
48
|
-
this.$router.push('/users/sign-in').then(() => {
|
|
49
|
-
this.$toaster(
|
|
50
|
-
'You can now log in with your new password',
|
|
51
|
-
'success',
|
|
52
|
-
{
|
|
53
|
-
title: 'Your password has been changed',
|
|
54
|
-
},
|
|
55
|
-
)
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
}).catch((response) => {
|
|
59
|
-
console.log(response)
|
|
60
|
-
})
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
}
|
|
65
|
-
</script>
|
|
36
|
+
const { t } = useI18n()
|
|
66
37
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
38
|
+
const props = defineProps({
|
|
39
|
+
resetPasswordToken: { type: String, default: '' },
|
|
40
|
+
})
|
|
70
41
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
42
|
+
const authStore = useAuthStore()
|
|
43
|
+
const router = useRouter()
|
|
44
|
+
const { toast } = useToaster()
|
|
45
|
+
const loading = ref(false)
|
|
46
|
+
const password = ref('')
|
|
74
47
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
48
|
+
async function handleSubmit() {
|
|
49
|
+
loading.value = true
|
|
50
|
+
try {
|
|
51
|
+
await authStore.newPassword({ user: { reset_password_token: props.resetPasswordToken, password: password.value } })
|
|
52
|
+
await router.push('/users/sign-in')
|
|
53
|
+
toast('Password changed. You can now sign in.', 'success')
|
|
54
|
+
} catch (err) {
|
|
55
|
+
const msg = err?.response?.data?.error || 'Failed to change password.'
|
|
56
|
+
toast(msg, 'danger')
|
|
57
|
+
} finally {
|
|
58
|
+
loading.value = false
|
|
81
59
|
}
|
|
82
60
|
}
|
|
83
|
-
</
|
|
61
|
+
</script>
|