@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.
Files changed (230) hide show
  1. package/README.md +140 -1
  2. package/dist/assets/BBadge.vue_vue_type_script_setup_true_lang-IIZ8QpjG-Z9WDKHqT.js +1 -0
  3. package/dist/assets/BCardText.vue_vue_type_script_setup_true_lang-Be6CD36N-B5JCTdmm.js +3 -0
  4. package/dist/assets/BFormSelect.vue_vue_type_script_setup_true_lang-BigptVap-B_HbOOZR.js +1 -0
  5. package/dist/assets/BRow.vue_vue_type_script_setup_true_lang-69TY75-8-DJdEdyx7.js +1 -0
  6. package/dist/assets/Communities-Cx4tT-bx.js +1 -0
  7. package/dist/assets/Communities-n33ssuUH.css +1 -0
  8. package/dist/assets/CommunityConversation-bBkYBs2k.css +1 -0
  9. package/dist/assets/CommunityConversation-jHAnv_Ps.js +1 -0
  10. package/dist/assets/CommunityConversations-rEDGS7To.js +1 -0
  11. package/dist/assets/CommunityEvent-CUdT0aT4.js +1 -0
  12. package/dist/assets/CommunityEvents-rsOgcxQr.js +1 -0
  13. package/dist/assets/CommunityHome-ChuTE2Nz.js +1 -0
  14. package/dist/assets/CommunityJoaTu-CpLIY_83.js +1 -0
  15. package/dist/assets/CommunityMembers-C3UtzQGp.css +1 -0
  16. package/dist/assets/CommunityMembers-DKf74ltl.js +1 -0
  17. package/dist/assets/CommunityPage-C5x23iQl.css +1 -0
  18. package/dist/assets/CommunityPage-CRYg9-rW.js +1 -0
  19. package/dist/assets/CommunityPages-IsLTNFC3.js +1 -0
  20. package/dist/assets/CommunityPost-BOnqqxVs.js +1 -0
  21. package/dist/assets/CommunityPost-BRYtkDSY.css +1 -0
  22. package/dist/assets/CommunityPosts-DY1olmcU.js +1 -0
  23. package/dist/assets/Error404-D10VQARe.js +1 -0
  24. package/dist/assets/EventCard-vfutXTdg.js +1 -0
  25. package/dist/assets/EventList-ChtehYcJ.js +1 -0
  26. package/dist/assets/ExtensionSlot-DJKbrq4c.js +1 -0
  27. package/dist/assets/PostList-BuHrBBqX.css +1 -0
  28. package/dist/assets/PostList-DYFgxlE8.js +1 -0
  29. package/dist/assets/SyncBadge-B1JBsdUk.js +1 -0
  30. package/dist/assets/SyncBadge-FNO-QLuu.css +1 -0
  31. package/dist/assets/UserPasswordNew-D_Djldm9.css +1 -0
  32. package/dist/assets/UserPasswordNew-al9bNBTZ.js +1 -0
  33. package/dist/assets/UserPasswordReset-42zs98RW.js +1 -0
  34. package/dist/assets/UserPasswordReset-D_6OQDZY.css +1 -0
  35. package/dist/assets/UserResendConfirmation-CGavYB81.js +1 -0
  36. package/dist/assets/UserResendConfirmation-DNTHcaar.css +1 -0
  37. package/dist/assets/UserSignIn-BIRb0HkV.js +1 -0
  38. package/dist/assets/UserSignIn-C-Pol8OD.css +1 -0
  39. package/dist/assets/UserSignUp-ChkKQAd2.css +1 -0
  40. package/dist/assets/UserSignUp-Df6o3vlO.js +1 -0
  41. package/dist/assets/better-together-logo-61cxo5d5.png +0 -0
  42. package/dist/assets/index-BFt-JKVh.css +5 -0
  43. package/dist/assets/index-COo3Jb7v.js +1088 -0
  44. package/dist/assets/nodefs-Bfyh92qg.js +1 -0
  45. package/dist/assets/opfs-ahp-BLzlXf6u.js +3 -0
  46. package/dist/assets/pglite-BdRI_ZYT.wasm +0 -0
  47. package/dist/assets/pglite-COscPi1Y.data +0 -0
  48. package/dist/assets/usePages-DDjDQRCy.js +1 -0
  49. package/dist/assets/usePosts-Bf2Ccwr4.js +1 -0
  50. package/{public → dist}/index.html +9 -19
  51. package/package.json +57 -45
  52. package/src/BtApp.vue +34 -43
  53. package/src/components/BtBrandingLogo.vue +10 -18
  54. package/src/components/BtHeader.vue +31 -89
  55. package/src/components/BtMainContent.vue +12 -43
  56. package/src/components/BtNavBar.vue +25 -38
  57. package/src/components/BtNavItem.vue +25 -58
  58. package/src/components/BtNavUser.vue +65 -86
  59. package/src/components/BtProfileForm.vue +48 -39
  60. package/src/components/BtUserNewPasswordForm.vue +52 -74
  61. package/src/components/BtUserResendConfirmationForm.vue +45 -83
  62. package/src/components/BtUserResetPasswordForm.vue +45 -77
  63. package/src/components/BtUserSignInForm.vue +59 -75
  64. package/src/components/BtUserSignUpForm.vue +90 -103
  65. package/src/components/CommunityForm.vue +47 -39
  66. package/src/components/community/CommunityCard.vue +113 -0
  67. package/src/components/community/CommunityHeader.vue +91 -0
  68. package/src/components/community/CommunityList.vue +59 -0
  69. package/src/components/community/MemberRoleRow.vue +107 -0
  70. package/src/components/conversation/ConversationCard.vue +49 -0
  71. package/src/components/conversation/ConversationDetail.vue +53 -0
  72. package/src/components/conversation/ConversationList.vue +51 -0
  73. package/src/components/conversation/MessageForm.vue +45 -0
  74. package/src/components/conversation/MessageItem.vue +43 -0
  75. package/src/components/conversation/MessageList.vue +39 -0
  76. package/src/components/event/EventCard.vue +82 -0
  77. package/src/components/event/EventForm.vue +99 -0
  78. package/src/components/event/EventList.vue +47 -0
  79. package/src/components/invitation/InvitationCard.vue +56 -0
  80. package/src/components/invitation/InvitationForm.vue +70 -0
  81. package/src/components/invitation/InvitationList.vue +51 -0
  82. package/src/components/joatu/AgreementCard.vue +57 -0
  83. package/src/components/joatu/AgreementList.vue +51 -0
  84. package/src/components/joatu/OfferCard.vue +65 -0
  85. package/src/components/joatu/OfferForm.vue +82 -0
  86. package/src/components/joatu/OfferList.vue +51 -0
  87. package/src/components/joatu/RequestCard.vue +65 -0
  88. package/src/components/joatu/RequestForm.vue +82 -0
  89. package/src/components/joatu/RequestList.vue +51 -0
  90. package/src/components/page/PageCard.vue +55 -0
  91. package/src/components/page/PageDetail.vue +35 -0
  92. package/src/components/page/PageList.vue +51 -0
  93. package/src/components/person/MemberList.vue +61 -0
  94. package/src/components/person/PersonAvatar.vue +54 -0
  95. package/src/components/person/PersonCard.vue +47 -0
  96. package/src/components/post/PostCard.vue +105 -0
  97. package/src/components/post/PostDetail.vue +98 -0
  98. package/src/components/post/PostForm.vue +84 -0
  99. package/src/components/post/PostList.vue +53 -0
  100. package/src/components/role/BlockButton.vue +44 -0
  101. package/src/components/role/RoleBadge.vue +19 -0
  102. package/src/components/role/RoleGate.vue +62 -0
  103. package/src/components/role/RoleSelector.vue +29 -0
  104. package/src/components/shared/ExtensionSlot.vue +27 -0
  105. package/src/components/sync/OfflineBanner.vue +49 -0
  106. package/src/components/sync/SyncBadge.vue +108 -0
  107. package/src/components/sync/SyncStatusBar.vue +121 -0
  108. package/src/composables/useCommunities.js +19 -0
  109. package/src/composables/useConversations.js +5 -0
  110. package/src/composables/useEvents.js +28 -0
  111. package/src/composables/useInvitations.js +10 -0
  112. package/src/composables/useJoaTuAgreements.js +11 -0
  113. package/src/composables/useJoaTuOffers.js +10 -0
  114. package/src/composables/useJoaTuRequests.js +10 -0
  115. package/src/composables/useMembers.js +30 -0
  116. package/src/composables/useMessages.js +5 -0
  117. package/src/composables/useNotifications.js +5 -0
  118. package/src/composables/usePages.js +6 -0
  119. package/src/composables/usePersonBlocks.js +65 -0
  120. package/src/composables/usePosts.js +27 -0
  121. package/src/composables/useResource.js +137 -0
  122. package/src/composables/useRoles.js +94 -0
  123. package/src/composables/useSyncStatus.js +22 -0
  124. package/src/composables/useToaster.js +20 -0
  125. package/src/context.js +18 -0
  126. package/src/db/client.js +343 -0
  127. package/src/db/migrations/001_initial.sql +131 -0
  128. package/src/db/migrations/003_conversations_invitations_pages_joatu.sql +76 -0
  129. package/src/db/sync.js +276 -0
  130. package/src/endpoints/BtApiAuth.js +1 -1
  131. package/src/endpoints/BtApiV1.js +1 -1
  132. package/src/extension.js +45 -0
  133. package/src/i18n/index.js +103 -0
  134. package/src/i18n/locales/en.json +275 -0
  135. package/src/i18n/locales/es.json +275 -0
  136. package/src/i18n/locales/fr.json +223 -0
  137. package/src/i18n/locales/uk.json +275 -0
  138. package/src/index.js +168 -22
  139. package/src/layouts/CommunityLayout.vue +89 -0
  140. package/src/main.js +16 -12
  141. package/src/mixins/error-handling.js +6 -15
  142. package/src/mixins/toaster.js +15 -10
  143. package/src/pages/Communities.vue +59 -0
  144. package/src/pages/Error404.vue +10 -14
  145. package/src/pages/Home.vue +11 -18
  146. package/src/pages/Me.vue +39 -59
  147. package/src/pages/UserPasswordNew.vue +12 -68
  148. package/src/pages/UserPasswordReset.vue +15 -64
  149. package/src/pages/UserResendConfirmation.vue +39 -113
  150. package/src/pages/UserSignIn.vue +18 -67
  151. package/src/pages/UserSignUp.vue +15 -64
  152. package/src/pages/community/CommunityConversation.vue +31 -0
  153. package/src/pages/community/CommunityConversations.vue +18 -0
  154. package/src/pages/community/CommunityEvent.vue +39 -0
  155. package/src/pages/community/CommunityEvents.vue +58 -0
  156. package/src/pages/community/CommunityHome.vue +49 -0
  157. package/src/pages/community/CommunityJoaTu.vue +115 -0
  158. package/src/pages/community/CommunityMembers.vue +23 -0
  159. package/src/pages/community/CommunityPage.vue +31 -0
  160. package/src/pages/community/CommunityPages.vue +25 -0
  161. package/src/pages/community/CommunityPost.vue +28 -0
  162. package/src/pages/community/CommunityPosts.vue +58 -0
  163. package/src/pages/community/CommunitySettingsPage.vue +117 -0
  164. package/src/pages/community/RoleManagerPage.vue +93 -0
  165. package/src/plugins/bootstrap-vue.js +5 -5
  166. package/src/plugins/font-awesome.js +3 -2
  167. package/src/plugins/index.js +9 -4
  168. package/src/plugins/progress.js +16 -0
  169. package/src/pwa/index.js +156 -0
  170. package/src/pwa/sw-helpers.js +130 -0
  171. package/src/router/communityRoutes.js +78 -0
  172. package/src/router/index.js +30 -144
  173. package/src/slot-registry.js +15 -0
  174. package/src/stores/auth.js +134 -0
  175. package/src/stores/communities.js +59 -0
  176. package/src/stores/index.js +5 -0
  177. package/src/stores/menus.js +14 -0
  178. package/src/stores/people.js +48 -0
  179. package/src/stores/sync.js +93 -0
  180. package/src/stylesheets/sync-indicators.scss +34 -0
  181. package/.env.sample +0 -1
  182. package/.eslintrc.js +0 -51
  183. package/.gitlab-ci.yml +0 -14
  184. package/.travis/.rbenv-gemsets +0 -1
  185. package/.travis/.ruby-version +0 -1
  186. package/.travis.yml +0 -31
  187. package/babel.config.js +0 -5
  188. package/cypress.json +0 -3
  189. package/deploy/build.sh +0 -8
  190. package/eslint.config.js +0 -16
  191. package/postcss.config.js +0 -5
  192. package/src/eslint.config.js +0 -16
  193. package/src/forms/BtProfileFormSchema.js +0 -19
  194. package/src/forms/BtUserConfirmationFormSchema.js +0 -20
  195. package/src/forms/BtUserNewPasswordFormSchema.js +0 -29
  196. package/src/forms/BtUserResetPasswordFormSchema.js +0 -20
  197. package/src/forms/BtUserSignInFormSchema.js +0 -29
  198. package/src/forms/BtUserSignUpFormSchema.js +0 -63
  199. package/src/forms/CommunityFormSchema.js +0 -19
  200. package/src/plugins/vue-form-generator.js +0 -4
  201. package/src/plugins/vue-loading.js +0 -10
  202. package/src/registerServiceWorker.js +0 -32
  203. package/src/store/index.js +0 -32
  204. package/src/store/modules/authentication.js +0 -170
  205. package/src/store/modules/communities.js +0 -98
  206. package/src/store/modules/community-engine.js +0 -14
  207. package/src/store/modules/menus.js +0 -52
  208. package/src/store/modules/people.js +0 -88
  209. package/src/vue.config.js +0 -0
  210. package/tests/e2e/.eslintrc.js +0 -12
  211. package/tests/e2e/plugins/index.js +0 -26
  212. package/tests/e2e/specs/home.js +0 -8
  213. package/tests/e2e/support/commands.js +0 -25
  214. package/tests/e2e/support/index.js +0 -20
  215. package/tests/unit/.eslintrc.js +0 -5
  216. package/tests/unit/example.spec.js +0 -13
  217. package/vue.config.js +0 -11
  218. package/webpack.config.js +0 -28
  219. /package/{public → dist}/_redirects +0 -0
  220. /package/{public → dist}/favicon.ico +0 -0
  221. /package/{public → dist}/img/favicon.ico +0 -0
  222. /package/{public → dist}/img/icons/android-chrome-192x192.png +0 -0
  223. /package/{public → dist}/img/icons/android-chrome-384x384.png +0 -0
  224. /package/{public → dist}/img/icons/apple-touch-icon.png +0 -0
  225. /package/{public → dist}/img/icons/favicon-16x16.png +0 -0
  226. /package/{public → dist}/img/icons/favicon-32x32.png +0 -0
  227. /package/{public → dist}/img/icons/favicon.ico +0 -0
  228. /package/{public → dist}/img/icons/mstile-150x150.png +0 -0
  229. /package/{public → dist}/img/icons/safari-pinned-tab.svg +0 -0
  230. /package/{public → dist}/robots.txt +0 -0
package/.gitlab-ci.yml DELETED
@@ -1,14 +0,0 @@
1
- pages: # the job must be named pages
2
- image: node:latest
3
- stage: deploy
4
- script:
5
- - ./deploy/build.sh
6
- - mv public public-vue # GitLab Pages hooks on the public folder
7
- - mv dist public # rename the dist folder (result of npm run build)
8
- # optionally, you can activate gzip support wih the following line:
9
- - find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -exec gzip -f -k {} \;
10
- artifacts:
11
- paths:
12
- - public # artifact path must be /public for GitLab Pages to pick it up
13
- only:
14
- - master
@@ -1 +0,0 @@
1
- bt-travis
@@ -1 +0,0 @@
1
- 2.6.3
package/.travis.yml DELETED
@@ -1,31 +0,0 @@
1
-
2
- language: node_js
3
- node_js:
4
- - "14.0"
5
-
6
-
7
- # line 9 resolved an issue where the Travis server would
8
- # try to connect to my remote using ssh-dss, which then caused my
9
- # remote server to puke and demand a password, causing the build
10
- # to time out
11
- dist: trusty
12
- sudo: false
13
-
14
- # This keeps the "add <your-host.tld> to known_hosts" prompt from popping up
15
- addons:
16
- ssh_known_hosts:
17
- - <your-host.tld>:<portnumber> # if your server uses a different port for ssh
18
-
19
- before_install:
20
- # - <openssl line generated by travis encrypt>
21
- - eval "$(ssh-agent -s)"
22
- # - cp .travis/id_rsa ~/.ssh/id_rsa
23
- # - chmod 600 ~/.ssh/id_rsa
24
- # - ssh-add ~/.ssh/id_rsa
25
-
26
- deploy:
27
- - provider: script
28
- skip_cleanup: true
29
- script: echo "deploy script!"
30
- on:
31
- branch: production
package/babel.config.js DELETED
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- presets: [
3
- '@vue/cli-plugin-babel/preset',
4
- ],
5
- }
package/cypress.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "pluginsFile": "tests/e2e/plugins/index.js"
3
- }
package/deploy/build.sh DELETED
@@ -1,8 +0,0 @@
1
- #!/bin/bash
2
-
3
- echo "VUE_APP_BETTER_TOGETHER_API_URI=${VUE_APP_BETTER_TOGETHER_API_URI}" >> ./.env
4
-
5
- yarn install --frozen-lockfile
6
- yarn build
7
- # optionally, you can activate gzip support wih the following line:
8
- find dist -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -exec gzip -f -k {} \;
package/eslint.config.js DELETED
@@ -1,16 +0,0 @@
1
- module.exports = {
2
- // ...
3
- module: {
4
- rules: [
5
- {
6
- test: /\.js$/,
7
- exclude: /node_modules/,
8
- loader: 'eslint-loader',
9
- options: {
10
- // eslint options (if necessary)
11
- },
12
- },
13
- ],
14
- },
15
- // ...
16
- }
package/postcss.config.js DELETED
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- plugins: {
3
- autoprefixer: {},
4
- },
5
- }
@@ -1,16 +0,0 @@
1
- module.exports = {
2
- // ...
3
- module: {
4
- rules: [
5
- {
6
- test: /\.js$/,
7
- exclude: /node_modules/,
8
- loader: 'eslint-loader',
9
- options: {
10
- // eslint options (if necessary)
11
- },
12
- },
13
- ],
14
- },
15
- // ...
16
- }
@@ -1,19 +0,0 @@
1
- export default {
2
- fields: [
3
- {
4
- type: 'input',
5
- inputType: 'text',
6
- label: 'Name',
7
- model: 'name',
8
- placeholder: 'Your name..',
9
- validator: ['string', 'required'],
10
- },
11
- {
12
- type: 'textArea',
13
- label: 'Description',
14
- model: 'description',
15
- placeholder: 'Your bio..',
16
- validator: ['string', 'required'],
17
- },
18
- ],
19
- }
@@ -1,20 +0,0 @@
1
- export default {
2
- fields: [
3
- {
4
- type: 'input',
5
- inputType: 'text',
6
- label: 'Email',
7
- model: 'user.email',
8
- placeholder: 'Your email address..',
9
- required: true,
10
- validator: ['string', 'required', 'email'],
11
- },
12
- {
13
- type: 'submit',
14
- label: '',
15
- buttonText: 'Send your confirmation email',
16
- fieldClasses: 'btn btn-primary btn-block',
17
- validateBeforeSubmit: true,
18
- },
19
- ],
20
- }
@@ -1,29 +0,0 @@
1
- export default {
2
- fields: [
3
- {
4
- type: 'input',
5
- inputType: 'hidden',
6
- model: 'user.reset_password_token',
7
- required: true,
8
- validator: ['string', 'required'],
9
- },
10
- {
11
- type: 'input',
12
- inputType: 'password',
13
- label: 'Password *',
14
- model: 'user.password',
15
- min: 12,
16
- placeholder: 'Your password..',
17
- required: true,
18
- validator: ['string', 'required'],
19
- hint: 'Should be a short phase or sentence that is easy to remember. Minimum 12 characters. It helps if it\'s funny or melodic.',
20
- },
21
- {
22
- type: 'submit',
23
- label: '',
24
- buttonText: 'Change Password',
25
- fieldClasses: 'btn btn-primary btn-block',
26
- validateBeforeSubmit: true,
27
- },
28
- ],
29
- }
@@ -1,20 +0,0 @@
1
- export default {
2
- fields: [
3
- {
4
- type: 'input',
5
- inputType: 'text',
6
- label: 'Email',
7
- model: 'email',
8
- placeholder: 'Your email address..',
9
- required: true,
10
- validator: ['string', 'required', 'email'],
11
- },
12
- {
13
- type: 'submit',
14
- label: '',
15
- buttonText: 'Send password reset email',
16
- fieldClasses: 'btn btn-primary btn-block',
17
- validateBeforeSubmit: true,
18
- },
19
- ],
20
- }
@@ -1,29 +0,0 @@
1
- export default {
2
- fields: [
3
- {
4
- type: 'input',
5
- inputType: 'text',
6
- label: 'Email',
7
- model: 'user.email',
8
- placeholder: 'Your email address..',
9
- required: true,
10
- validator: ['string', 'required', 'email'],
11
- },
12
- {
13
- type: 'input',
14
- inputType: 'password',
15
- label: 'Password',
16
- model: 'user.password',
17
- placeholder: 'Your password..',
18
- required: true,
19
- validator: ['string', 'required'],
20
- },
21
- {
22
- type: 'submit',
23
- label: '',
24
- buttonText: 'Sign In',
25
- fieldClasses: 'btn btn-primary btn-block',
26
- validateBeforeSubmit: true,
27
- },
28
- ],
29
- }
@@ -1,63 +0,0 @@
1
- export default {
2
- groups: [
3
- {
4
- legend: 'Login Info',
5
- fields: [
6
- {
7
- type: 'input',
8
- inputType: 'text',
9
- label: 'Email *',
10
- model: 'user.email',
11
- placeholder: 'Your email address..',
12
- required: true,
13
- validator: ['string', 'required', 'email'],
14
- },
15
- {
16
- type: 'input',
17
- inputType: 'password',
18
- label: 'Password *',
19
- model: 'user.password',
20
- min: 12,
21
- placeholder: 'Your password..',
22
- required: true,
23
- validator: ['string', 'required'],
24
- hint: 'Should be a short phase or sentence that is easy to remember. Minimum 12 characters. It helps if it\'s funny or melodic.',
25
- },
26
- ],
27
- },
28
- {
29
- legend: 'Personal Info',
30
- fields: [
31
- {
32
- type: 'input',
33
- inputType: 'text',
34
- label: 'Name *',
35
- model: 'user.person_attributes.name',
36
- placeholder: 'Your name..',
37
- required: true,
38
- validator: ['string', 'required'],
39
- },
40
- {
41
- type: 'textArea',
42
- label: 'Description *',
43
- model: 'user.person_attributes.description',
44
- placeholder: 'Your description..',
45
- validator: ['string', 'required'],
46
- required: true,
47
- },
48
- ],
49
- },
50
- {
51
- legend: '',
52
- fields: [
53
- {
54
- type: 'submit',
55
- label: '',
56
- buttonText: 'Sign Up',
57
- fieldClasses: 'btn btn-primary btn-block',
58
- validateBeforeSubmit: true,
59
- },
60
- ],
61
- },
62
- ],
63
- }
@@ -1,19 +0,0 @@
1
- export default {
2
- fields: [
3
- {
4
- type: 'input',
5
- inputType: 'text',
6
- label: 'Name',
7
- model: 'name',
8
- placeholder: 'Your community name..',
9
- validator: ['string', 'required'],
10
- },
11
- {
12
- type: 'textArea',
13
- label: 'Description',
14
- model: 'description',
15
- placeholder: 'Your community description..',
16
- validator: ['string', 'required'],
17
- },
18
- ],
19
- }
@@ -1,4 +0,0 @@
1
- import Vue from 'vue'
2
- import VueFormGenerator from 'vue-form-generator'
3
-
4
- Vue.use(VueFormGenerator)
@@ -1,10 +0,0 @@
1
- import axios from 'axios'
2
- import Vue from 'vue'
3
- import VueLoading from 'crip-vue-loading'
4
-
5
- Vue.use(VueLoading, {
6
- axios,
7
- applyOnRouter: true,
8
- color: '#42b983',
9
- height: '3px',
10
- })
@@ -1,32 +0,0 @@
1
- /* eslint-disable no-console */
2
-
3
- import { register } from 'register-service-worker'
4
-
5
- if (process.env.NODE_ENV === 'production') {
6
- register(`${process.env.BASE_URL}service-worker.js`, {
7
- ready() {
8
- console.log(
9
- 'App is being served from cache by a service worker.\n'
10
- + 'For more details, visit https://goo.gl/AFskqB',
11
- )
12
- },
13
- registered() {
14
- console.log('Service worker has been registered.')
15
- },
16
- cached() {
17
- console.log('Content has been cached for offline use.')
18
- },
19
- updatefound() {
20
- console.log('New content is downloading.')
21
- },
22
- updated() {
23
- console.log('New content is available; please refresh.')
24
- },
25
- offline() {
26
- console.log('No internet connection found. App is running in offline mode.')
27
- },
28
- error(error) {
29
- console.error('Error during service worker registration:', error)
30
- },
31
- })
32
- }
@@ -1,32 +0,0 @@
1
- import Vue from 'vue'
2
- import Vuex from 'vuex'
3
- import createPersistedState from 'vuex-persistedstate'
4
- import SecureLS from 'secure-ls'
5
- import CommunityEngine from './modules/community-engine'
6
-
7
- const ls = new SecureLS({ isCompression: false })
8
-
9
- Vue.use(Vuex)
10
-
11
- const BtStoreModules = {
12
- CommunityEngine,
13
- }
14
-
15
- const BtStorePlugins = [
16
- createPersistedState({
17
- storage: {
18
- getItem: (key) => ls.get(key),
19
- setItem: (key, value) => ls.set(key, value),
20
- removeItem: (key) => ls.remove(key),
21
- },
22
- }),
23
- ]
24
-
25
- const BtStore = new Vuex.Store({
26
- modules: BtStoreModules,
27
- plugins: BtStorePlugins,
28
- })
29
-
30
- export { BtStoreModules, BtStorePlugins }
31
-
32
- export default BtStore
@@ -1,170 +0,0 @@
1
- /* eslint no-shadow: ["error", { "allow": ["state"] }] */
2
-
3
- import axios from 'axios'
4
- import BtApiAuth from '../../endpoints/BtApiAuth'
5
-
6
- // initial state
7
- const state = {
8
- currentUser: {},
9
- token: '',
10
- status: '',
11
- }
12
-
13
- if (state.token) {
14
- axios.defaults.headers.common.Authorization = state.token
15
- }
16
-
17
- // getters
18
- const getters = {
19
- // isAuthenticated() { return state.token !== '' },
20
- isAuthenticated: (state) => !!state.token,
21
- authStatus: (state) => state.status,
22
- authToken: (state) => state.token,
23
- }
24
-
25
- // actions
26
- const actions = {
27
- signIn({ commit }, params) {
28
- return new Promise((resolve, reject) => {
29
- BtApiAuth.post(
30
- 'sign-in',
31
- params,
32
- )
33
- .then(({ data, headers }) => {
34
- const token = headers.authorization
35
- commit('AUTH_SUCCESS', token)
36
- commit('SET_USER', data)
37
- axios.defaults.headers.common.Authorization = token
38
- resolve(data)
39
- }).catch((response) => {
40
- commit('AUTH_ERROR', response)
41
- delete axios.defaults.headers.common.Authorization
42
- reject(response)
43
- })
44
- })
45
- },
46
- signOut({ commit }) {
47
- return new Promise((resolve, reject) => {
48
- BtApiAuth.delete(
49
- 'sign-out',
50
- )
51
- .then(({ data }) => {
52
- resolve(data)
53
- }).catch((response) => {
54
- commit('AUTH_ERROR', response)
55
- reject(response)
56
- }).then(() => {
57
- commit('AUTH_LOGOUT')
58
- delete axios.defaults.headers.common.Authorization
59
- commit('CommunityEngine/People/CLEAR_CURRENT_PERSON', null, { root: true })
60
- })
61
- resolve()
62
- })
63
- },
64
- signUp(_ctx, params) {
65
- return new Promise((resolve, reject) => {
66
- BtApiAuth.post(
67
- 'sign-up',
68
- {
69
- ...params,
70
- confirmation_url: `${window.location.origin}/users/confirmation`,
71
- },
72
- )
73
- .then(({ data }) => {
74
- resolve(data)
75
- }).catch((response) => {
76
- reject(response)
77
- })
78
- })
79
- },
80
- resendConfirmation(_ctx, params) {
81
- return new Promise((resolve, reject) => {
82
- BtApiAuth.post(
83
- 'confirmation',
84
- {
85
- ...params,
86
- confirmation_url: `${window.location.origin}/users/confirmation`,
87
- },
88
- )
89
- .then(({ data }) => {
90
- resolve(data)
91
- }).catch((response) => {
92
- reject(response)
93
- })
94
- })
95
- },
96
- sendConfirmation(_ctx, params) {
97
- return new Promise((resolve, reject) => {
98
- BtApiAuth.get(
99
- 'confirmation',
100
- { params },
101
- )
102
- .then(({ data }) => {
103
- resolve(data)
104
- }).catch((response) => {
105
- reject(response)
106
- })
107
- })
108
- },
109
- resetPassword(_ctx, params) {
110
- return new Promise((resolve, reject) => {
111
- BtApiAuth.post(
112
- 'password',
113
- {
114
- ...params,
115
- new_password_url: `${window.location.origin}/users/password/new`,
116
- },
117
- )
118
- .then(({ data }) => {
119
- resolve(data)
120
- }).catch((response) => {
121
- reject(response)
122
- })
123
- })
124
- },
125
- newPassword(_ctx, params) {
126
- return new Promise((resolve, reject) => {
127
- BtApiAuth.put(
128
- 'password',
129
- params,
130
- )
131
- .then(({ data }) => {
132
- resolve(data)
133
- }).catch((response) => {
134
- reject(response)
135
- })
136
- })
137
- },
138
- }
139
-
140
- // mutations
141
- const mutations = {
142
- AUTH_LOGOUT(currentState) {
143
- currentState.status = ''
144
- currentState.currentUser = {}
145
- currentState.token = ''
146
- },
147
- AUTH_REQUEST(currentState) {
148
- currentState.status = 'loading'
149
- },
150
- AUTH_SUCCESS(currentState, token) {
151
- currentState.status = 'success'
152
- currentState.token = token
153
- },
154
- AUTH_ERROR(currentState) {
155
- currentState.status = 'error'
156
- currentState.currentUser = {}
157
- currentState.token = ''
158
- },
159
- SET_USER(currentState, user) {
160
- currentState.currentUser = user
161
- },
162
- }
163
-
164
- export default {
165
- namespaced: true,
166
- state,
167
- getters,
168
- actions,
169
- mutations,
170
- }
@@ -1,98 +0,0 @@
1
- /* eslint no-shadow: ["error", { "allow": ["state"] }] */
2
-
3
- // import axios from 'axios'
4
- import BtApiV1 from '../../endpoints/BtApiV1'
5
-
6
- // initial state
7
- const state = {
8
- activeCommunity: {},
9
- communities: [],
10
- platformCommunity: {
11
- id: 0,
12
- name: 'Better Together',
13
- description: 'A community buiding platform',
14
- customization: {
15
- backgroundColor: '#343a40 !important',
16
- coverImageUrl: '',
17
- coverImagePositionY: 'center',
18
- imageUrl: '',
19
- },
20
- },
21
- }
22
-
23
- state.activeCommunity = {
24
- ...state.platformCommunity,
25
- }
26
-
27
- // getters
28
- const getters = {
29
- activeCommunity: (state) => state.activeCommunity,
30
- customization: (state) => state.activeCommunity.customization,
31
- coverImageUrl: (state) => state.activeCommunity.customization.coverImageUrl,
32
- coverImagePositionY: (state) => state.activeCommunity.customization.coverImagePositionY,
33
- }
34
-
35
- // actions
36
- const actions = {
37
- setCoverImageUrl({ commit }, url) {
38
- return new Promise((resolve) => {
39
- commit('SET_COVER_IMAGE_URL', url)
40
- resolve(url)
41
- })
42
- },
43
- setCustomizationOptions({ commit }, options) {
44
- return new Promise((resolve) => {
45
- commit('SET_CUSTOMIZATION_OPTIONS', options)
46
- resolve(options)
47
- })
48
- },
49
- getCommunities({ commit }, params) {
50
- return new Promise((resolve, reject) => {
51
- BtApiV1.findAll('communities', { params }).then(({ data }) => {
52
- commit('SET_COMMUNITIES', data)
53
- resolve(data)
54
- })
55
- .catch(({ response }) => {
56
- reject(response)
57
- })
58
- })
59
- },
60
- postCommunity({ commit }, params) {
61
- return new Promise((resolve, reject) => {
62
- BtApiV1.create('community', params)
63
- .then(({ data }) => {
64
- commit('PREPEND_COMMUNITY', data)
65
- resolve(data)
66
- }).catch((response) => {
67
- reject(response)
68
- })
69
- })
70
- },
71
- }
72
-
73
- // mutations
74
- const mutations = {
75
- SET_COMMUNITIES(currentState, communities) {
76
- currentState.communities = communities
77
- },
78
- SET_COVER_IMAGE_URL(currentState, url) {
79
- currentState.activeCommunity.customization.coverImageUrl = url
80
- },
81
- SET_CUSTOMIZATION_OPTIONS(currentState, options) {
82
- currentState.activeCommunity.customization = {
83
- ...currentState.platformCommunity.customization,
84
- ...options,
85
- }
86
- },
87
- PREPEND_COMMUNITY(currentState, community) {
88
- currentState.communities.unshift(community)
89
- },
90
- }
91
-
92
- export default {
93
- namespaced: true,
94
- state,
95
- getters,
96
- actions,
97
- mutations,
98
- }
@@ -1,14 +0,0 @@
1
- import Authentication from './authentication'
2
- import Communities from './communities'
3
- import Menus from './menus'
4
- import People from './people'
5
-
6
- export default {
7
- namespaced: true,
8
- modules: {
9
- Authentication,
10
- Communities,
11
- Menus,
12
- People,
13
- },
14
- }