Skip to content
This repository was archived by the owner on May 20, 2024. It is now read-only.

Commit 8ff0607

Browse files
nicksellentiltec
authored andcommitted
Person to person sharing (#1799)
* Initial work to add person-to-person sharing * A few sharing item UI refinements * Initial new sharing form with multiple upload * Add a grey box... * Remove redundant check * Rename sharing to offers * Add a mock chat to offer detail UI * Create mobile version of offer detail UI * Tidy up multiple image editing * A bit more polish on the offer UI Some translations, icon, breadcrumb, etc... * Snapshot update * Add create offer breadcrumb title * Rename a few offer related things for consistency * Offer image carousel, multi upload, various bits * Refine image upload/remove/re-position * Add websocket listeners for offer changes * Wireup offer conversation * Basic features to allow to accept/archive offers * Remove uneeded demo data * Move selected offer data/logic to own store module * Preserve offer filter in more places The create/save filter preservation does not work actually as we clear the store contents on route change. * Remove status from offer form Status change is now done via explicit actions/buttons * Use address autocomplete (#1878) * Use address autocomplete As it used to be. Also defaults place edit map to be group centre if available. * Remove uneeded extra wrapped div * Update setup for storyshots testing "sync: false" seems to be the new way it goes and will be the default in the future, see vuejs/vue-test-utils#1137 The transition group stubs seem to be there by default now too, I think.. Anyway it works where it did no tbefore :) Also see vuejs/vue-test-utils#1163 * Add @types/jest - for editor support See https://blog.jetbrains.com/webstorm/2018/10/testing-with-jest-in-webstorm/ * Increase test wait Not really sure why this changed, but don't want to think about it for now... * Add text to translation file * Use the spelling of the enemy * Simplify template logic * Ffix multicroppa * Further refine offer editing, esp MultiCroppa * Use gift as offers menu item * Remove offer upload progress logging * Nicer create offer button * Clear offerDetail on route leave * Add offer list loading indicator * Add offer body loading indicator * Add loading spinner when fetching offer for edit * Correctly wire up offer form reset events * Only show offer accept/archive buttons if active * Handle updating offers after save/websocket better * Cleaner mobile form view * Only show carousel if >1 image * Fix offer header when name is very long * Fix offer detail image display when only 1 * Fix overflowing text on group offers page * White background offer description * Snapshot update * Don't try and be fancy with updating users * Fix style style * Hide offers if group does not have the feature * Check route features in after route hook * Actually filter offers by current group * Add offers covert function to convert createdAt * Display offer information in latest messages I did it a slightly different way, by adding related offers into the latestMessages state... * Keep related offers up to date via websocket It's a bit overkeen actually as most users won't be in the conversations for the offers, so we don't need to update the related item... should really check we need it first * Import default offer status from store * Use current route query instead of getter * Use + for new offer button * Allow setting new_offer notification types * Show offer status if not active Although it's a bit ugly * Change notification type spinner * Add group.features to test mocks * Wrap settings forms in FormContainer * Rename to KFormContainer and move to base * Add confirm step to accept/archive offer buttons * Use photo icon for offer image placeholder * Add offer as a "fake" empty result * Filter offers by status and sort by createdAt desc ... entries can get added via websockets that might not fit the filter, and might need reordering * Refine group offer cards - use QImg instead of lots of CSS - use QItem inside for nicer layout * Correct RouterLink casing * Update test snapshots * Please the pedantic linter * Remove offer description helper * Extract mapErrors to statusMixin * Add accept/archive text into i18n * Remove unneeded code * Add offer filter status text to i18n * Correct size for new offer button * Remove one layer of div soup * Put the group offer cards in proper links * Remove commented out code * Convert offer in websocket update * Prefix functional getter with get For getNotificationTypeStatus * Preserve route query when clicking on offer conv * Use icon service for latest messages offer item * Move withoutKeys to utils * Use invisible class instead of custom css * Don't put const value in data * Save disk space by compacting template * Remove unneeded v-model Was only used when I tried out quasar :rules * Document MultiCroppa value prop a bit more * Document the data that latestMesages/related has
1 parent a8451be commit 8ff0607

39 files changed

+1550
-48
lines changed

src/__snapshots__/storyshots.spec.js.snap

+39-15
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ exports[`Storyshots ChangePhoto with photo 1`] = `
338338
`;
339339

340340
exports[`Storyshots ChatConversation closed 1`] = `
341-
<div>
341+
<div class="bg-white">
342342
<div class="full-width text-center generic-padding" style="display:none;"><svg fill="currentColor" width="40" height="40" viewBox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" class="q-spinner">
343343
<circle cx="15" cy="15" r="15">
344344
<animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate>
@@ -511,7 +511,7 @@ exports[`Storyshots ChatConversation closed 1`] = `
511511
`;
512512

513513
exports[`Storyshots ChatConversation default 1`] = `
514-
<div>
514+
<div class="bg-white">
515515
<div class="full-width text-center generic-padding" style="display:none;"><svg fill="currentColor" width="40" height="40" viewBox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" class="q-spinner">
516516
<circle cx="15" cy="15" r="15">
517517
<animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate>
@@ -673,7 +673,7 @@ exports[`Storyshots ChatConversation default 1`] = `
673673
`;
674674

675675
exports[`Storyshots ChatConversation fetching past 1`] = `
676-
<div>
676+
<div class="bg-white">
677677
<div class="full-width text-center generic-padding"><svg fill="currentColor" width="40" height="40" viewBox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" class="q-spinner">
678678
<circle cx="15" cy="15" r="15">
679679
<animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate>
@@ -835,7 +835,7 @@ exports[`Storyshots ChatConversation fetching past 1`] = `
835835
`;
836836

837837
exports[`Storyshots ChatConversation message groups 1`] = `
838-
<div>
838+
<div class="bg-white">
839839
<div class="full-width text-center generic-padding" style="display:none;"><svg fill="currentColor" width="40" height="40" viewBox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" class="q-spinner">
840840
<circle cx="15" cy="15" r="15">
841841
<animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate>
@@ -1159,7 +1159,7 @@ exports[`Storyshots ChatConversation message groups 1`] = `
11591159
`;
11601160

11611161
exports[`Storyshots ChatConversation not participant 1`] = `
1162-
<div>
1162+
<div class="bg-white">
11631163
<div class="full-width text-center generic-padding" style="display:none;"><svg fill="currentColor" width="40" height="40" viewBox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" class="q-spinner">
11641164
<circle cx="15" cy="15" r="15">
11651165
<animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate>
@@ -1321,7 +1321,7 @@ exports[`Storyshots ChatConversation not participant 1`] = `
13211321
`;
13221322

13231323
exports[`Storyshots ChatConversation thread 1`] = `
1324-
<div>
1324+
<div class="bg-white">
13251325
<div class="full-width text-center generic-padding" style="display:none;"><svg fill="currentColor" width="40" height="40" viewBox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" class="q-spinner">
13261326
<circle cx="15" cy="15" r="15">
13271327
<animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate>
@@ -2058,7 +2058,7 @@ exports[`Storyshots Detail application 1`] = `
20582058
<animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite"></animate>
20592059
</circle>
20602060
</svg></div>
2061-
<div>
2061+
<div class="bg-white">
20622062
<div class="q-expansion-item q-item-type bg-grey-2 q-expansion-item--expanded q-expansion-item--standard">
20632063
<div class="q-expansion-item__container relative-position">
20642064
<div tabindex="0" class="q-item q-item-type row no-wrap q-item--clickable q-link cursor-pointer q-focusable q-hoverable text-bold">
@@ -2314,7 +2314,7 @@ exports[`Storyshots Detail pickup 1`] = `
23142314
<animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite"></animate>
23152315
</circle>
23162316
</svg></div>
2317-
<div>
2317+
<div class="bg-white">
23182318
<div class="full-width text-center generic-padding" style="display:none;"><svg fill="currentColor" width="40" height="40" viewBox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" class="q-spinner">
23192319
<circle cx="15" cy="15" r="15">
23202320
<animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate>
@@ -2543,7 +2543,7 @@ exports[`Storyshots Detail private 1`] = `
25432543
<animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite"></animate>
25442544
</circle>
25452545
</svg></div>
2546-
<div>
2546+
<div class="bg-white">
25472547
<div class="full-width text-center generic-padding" style="display:none;"><svg fill="currentColor" width="40" height="40" viewBox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" class="q-spinner">
25482548
<circle cx="15" cy="15" r="15">
25492549
<animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate>
@@ -4658,7 +4658,7 @@ exports[`Storyshots GroupPreviewUI without public description 1`] = `
46584658
`;
46594659

46604660
exports[`Storyshots GroupSettings show 1`] = `
4661-
<div id="notifications" class="q-card no-shadow grey-border">
4661+
<div id="notifications" class="q-card bg-white q-mb-lg no-shadow grey-border">
46624662
<div class="q-card__section">
46634663
<div class="text-h6">
46644664
Notifications by group
@@ -4702,6 +4702,9 @@ exports[`Storyshots GroupSettings show 1`] = `
47024702
Keep up to date with what's been happening in the group.
47034703
</div>
47044704
</div>
4705+
<div class="q-item__section column q-item__section--side justify-center"><svg width="18px" height="18px" viewBox="25 25 50 50" class="q-spinner q-spinner-mat invisible">
4706+
<circle cx="50" cy="50" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-miterlimit="10" class="path"></circle>
4707+
</svg></div>
47054708
</label><label tabindex="0" class="q-item q-item-type row no-wrap q-item--clickable q-link cursor-pointer q-focusable q-hoverable">
47064709
<div tabindex="-1" class="q-focus-helper"></div>
47074710
<div class="q-item__section column q-item__section--side justify-center">
@@ -4723,6 +4726,9 @@ exports[`Storyshots GroupSettings show 1`] = `
47234726
Reminds you of your pickups, and tells you about empty or not-full pickups of your favorite places in the next day
47244727
</div>
47254728
</div>
4729+
<div class="q-item__section column q-item__section--side justify-center"><svg width="18px" height="18px" viewBox="25 25 50 50" class="q-spinner q-spinner-mat invisible">
4730+
<circle cx="50" cy="50" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-miterlimit="10" class="path"></circle>
4731+
</svg></div>
47264732
</label><label tabindex="0" class="q-item q-item-type row no-wrap q-item--clickable q-link cursor-pointer q-focusable q-hoverable">
47274733
<div tabindex="-1" class="q-focus-helper"></div>
47284734
<div class="q-item__section column q-item__section--side justify-center">
@@ -4744,6 +4750,9 @@ exports[`Storyshots GroupSettings show 1`] = `
47444750
Tells you when somebody wants to join your group
47454751
</div>
47464752
</div>
4753+
<div class="q-item__section column q-item__section--side justify-center"><svg width="18px" height="18px" viewBox="25 25 50 50" class="q-spinner q-spinner-mat invisible">
4754+
<circle cx="50" cy="50" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-miterlimit="10" class="path"></circle>
4755+
</svg></div>
47474756
</label><label tabindex="0" class="q-item q-item-type row no-wrap q-item--clickable q-link cursor-pointer q-focusable q-hoverable">
47484757
<div tabindex="-1" class="q-focus-helper"></div>
47494758
<div class="q-item__section column q-item__section--side justify-center">
@@ -4765,6 +4774,9 @@ exports[`Storyshots GroupSettings show 1`] = `
47654774
Tells you when a new conflict resolution process has been started in your group
47664775
</div>
47674776
</div>
4777+
<div class="q-item__section column q-item__section--side justify-center"><svg width="18px" height="18px" viewBox="25 25 50 50" class="q-spinner q-spinner-mat invisible">
4778+
<circle cx="50" cy="50" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-miterlimit="10" class="path"></circle>
4779+
</svg></div>
47684780
</label>
47694781
<div class="q-pt-md q-pl-md"><button tabindex="0" type="button" class="q-btn inline q-btn-item non-selectable no-outline q-btn--standard q-btn--rectangle bg-primary text-white q-btn--actionable q-focusable q-hoverable">
47704782
<div tabindex="-1" class="q-focus-helper"></div>
@@ -9948,7 +9960,7 @@ exports[`Storyshots ProfilePicture without user 1`] = `
99489960

99499961
exports[`Storyshots Settings Page Default 1`] = `
99509962
<div>
9951-
<div class="q-card no-shadow grey-border">
9963+
<div class="q-card bg-white q-mb-lg no-shadow grey-border">
99529964
<div class="q-card__section">
99539965
<div class="text-h6">
99549966
Profile
@@ -10076,7 +10088,7 @@ exports[`Storyshots Settings Page Default 1`] = `
1007610088
</div>
1007710089
</div>
1007810090
</div>
10079-
<div class="q-card no-shadow grey-border">
10091+
<div class="q-card bg-white q-mb-lg no-shadow grey-border">
1008010092
<div class="q-card__section">
1008110093
<div class="text-h6">
1008210094
Switch language
@@ -10092,7 +10104,7 @@ exports[`Storyshots Settings Page Default 1`] = `
1009210104
</button></div>
1009310105
</div>
1009410106
</div>
10095-
<div class="q-card no-shadow grey-border">
10107+
<div class="q-card bg-white q-mb-lg no-shadow grey-border">
1009610108
<div class="q-card__section">
1009710109
<div class="text-h6">
1009810110
Account
@@ -10182,7 +10194,7 @@ exports[`Storyshots Settings Page Default 1`] = `
1018210194
</div>
1018310195
</div>
1018410196
</div>
10185-
<div id="notifications" class="q-card no-shadow grey-border">
10197+
<div id="notifications" class="q-card bg-white q-mb-lg no-shadow grey-border">
1018610198
<div class="q-card__section">
1018710199
<div class="text-h6">
1018810200
Notifications by group
@@ -10226,6 +10238,9 @@ exports[`Storyshots Settings Page Default 1`] = `
1022610238
Keep up to date with what's been happening in the group.
1022710239
</div>
1022810240
</div>
10241+
<div class="q-item__section column q-item__section--side justify-center"><svg width="18px" height="18px" viewBox="25 25 50 50" class="q-spinner q-spinner-mat invisible">
10242+
<circle cx="50" cy="50" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-miterlimit="10" class="path"></circle>
10243+
</svg></div>
1022910244
</label><label tabindex="0" class="q-item q-item-type row no-wrap q-item--clickable q-link cursor-pointer q-focusable q-hoverable">
1023010245
<div tabindex="-1" class="q-focus-helper"></div>
1023110246
<div class="q-item__section column q-item__section--side justify-center">
@@ -10247,6 +10262,9 @@ exports[`Storyshots Settings Page Default 1`] = `
1024710262
Reminds you of your pickups, and tells you about empty or not-full pickups of your favorite places in the next day
1024810263
</div>
1024910264
</div>
10265+
<div class="q-item__section column q-item__section--side justify-center"><svg width="18px" height="18px" viewBox="25 25 50 50" class="q-spinner q-spinner-mat invisible">
10266+
<circle cx="50" cy="50" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-miterlimit="10" class="path"></circle>
10267+
</svg></div>
1025010268
</label><label tabindex="0" class="q-item q-item-type row no-wrap q-item--clickable q-link cursor-pointer q-focusable q-hoverable">
1025110269
<div tabindex="-1" class="q-focus-helper"></div>
1025210270
<div class="q-item__section column q-item__section--side justify-center">
@@ -10268,6 +10286,9 @@ exports[`Storyshots Settings Page Default 1`] = `
1026810286
Tells you when somebody wants to join your group
1026910287
</div>
1027010288
</div>
10289+
<div class="q-item__section column q-item__section--side justify-center"><svg width="18px" height="18px" viewBox="25 25 50 50" class="q-spinner q-spinner-mat invisible">
10290+
<circle cx="50" cy="50" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-miterlimit="10" class="path"></circle>
10291+
</svg></div>
1027110292
</label><label tabindex="0" class="q-item q-item-type row no-wrap q-item--clickable q-link cursor-pointer q-focusable q-hoverable">
1027210293
<div tabindex="-1" class="q-focus-helper"></div>
1027310294
<div class="q-item__section column q-item__section--side justify-center">
@@ -10289,6 +10310,9 @@ exports[`Storyshots Settings Page Default 1`] = `
1028910310
Tells you when a new conflict resolution process has been started in your group
1029010311
</div>
1029110312
</div>
10313+
<div class="q-item__section column q-item__section--side justify-center"><svg width="18px" height="18px" viewBox="25 25 50 50" class="q-spinner q-spinner-mat invisible">
10314+
<circle cx="50" cy="50" r="20" fill="none" stroke="currentColor" stroke-width="5" stroke-miterlimit="10" class="path"></circle>
10315+
</svg></div>
1029210316
</label>
1029310317
<div class="q-pt-md q-pl-md"><button tabindex="0" type="button" class="q-btn inline q-btn-item non-selectable no-outline q-btn--standard q-btn--rectangle bg-primary text-white q-btn--actionable q-focusable q-hoverable">
1029410318
<div tabindex="-1" class="q-focus-helper"></div>
@@ -10305,7 +10329,7 @@ exports[`Storyshots Settings Page Default 1`] = `
1030510329
</div>
1030610330
</div>
1030710331
</div>
10308-
<div class="q-card no-shadow grey-border">
10332+
<div class="q-card bg-white q-mb-lg no-shadow grey-border">
1030910333
<div class="q-card__section">
1031010334
<div class="text-h6">
1031110335
Push notifications

src/authuser/pages/Settings.story.js

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const datastore = createDatastore({
3535
currentGroup: {
3636
getters: {
3737
value: () => groupsMock[0],
38+
getNotificationTypeStatus: () => () => ({}),
3839
},
3940
},
4041
groups: {

src/authuser/pages/Settings.vue

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div v-if="user">
3-
<QCard class="no-shadow grey-border">
3+
<KFormContainer>
44
<QCardSection>
55
<div class="text-h6">
66
{{ $t('USERDATA.PROFILE_TITLE') }}
@@ -22,8 +22,8 @@
2222
@save="saveUser"
2323
/>
2424
</QCardSection>
25-
</QCard>
26-
<QCard class="no-shadow grey-border">
25+
</KFormContainer>
26+
<KFormContainer>
2727
<QCardSection>
2828
<div class="text-h6">
2929
{{ $t('LANGUAGECHOOSER.SWITCH') }}
@@ -34,8 +34,8 @@
3434
<LocaleSelect />
3535
</div>
3636
</QCardSection>
37-
</QCard>
38-
<QCard class="no-shadow grey-border">
37+
</KFormContainer>
38+
<KFormContainer>
3939
<QCardSection>
4040
<div class="text-h6">
4141
{{ $t('USERDATA.ACCOUNT') }}
@@ -59,11 +59,10 @@
5959
/>
6060
</QCardActions>
6161
</QCardSection>
62-
</QCard>
62+
</KFormContainer>
6363
<GroupSettings />
64-
<QCard
64+
<KFormContainer
6565
v-if="!$q.platform.is.cordova"
66-
class="no-shadow grey-border"
6766
>
6867
<QCardSection>
6968
<div class="text-h6">
@@ -78,13 +77,12 @@
7877
@disable="disablePush"
7978
/>
8079
</QCardSection>
81-
</QCard>
80+
</KFormContainer>
8281
</div>
8382
</template>
8483

8584
<script>
8685
import {
87-
QCard,
8886
QCardSection,
8987
QSeparator,
9088
QCardActions,
@@ -100,11 +98,11 @@ import RequestDeleteAccount from '@/authuser/components/Settings/RequestDeleteAc
10098
import Push from '@/authuser/components/Settings/Push'
10199
import LocaleSelect from '@/utils/components/LocaleSelect'
102100
import GroupSettings from '@/group/pages/Settings'
101+
import KFormContainer from '@/base/components/KFormContainer'
103102
104103
export default {
105104
name: 'Settings',
106105
components: {
107-
QCard,
108106
QCardSection,
109107
QSeparator,
110108
QCardActions,
@@ -116,6 +114,7 @@ export default {
116114
Push,
117115
LocaleSelect,
118116
GroupSettings,
117+
KFormContainer,
119118
},
120119
computed: {
121120
...mapGetters({
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<script>
2+
import { Platform, QCard } from 'quasar'
3+
const Component = Platform.is.mobile ? 'div' : QCard
4+
export default {
5+
functional: true,
6+
render (h, { data, children }) {
7+
if (data.class) {
8+
throw new Error('KFormContainer component does not support class attribute')
9+
}
10+
return h(Component, { ...data, class: ['bg-white', 'q-mb-lg', 'no-shadow', 'grey-border'] }, children)
11+
},
12+
}
13+
</script>

src/base/datastore.js

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import pickups from '@/pickups/datastore'
2020
import sidenav from '@/sidenav/datastore'
2121
import places from '@/places/datastore'
2222
import subscriptions from '@/subscriptions/datastore'
23+
import offers from '@/offers/datastore'
2324
import topbar from '@/topbar/datastore'
2425
import unsubscribe from '@/unsubscribe/datastore'
2526
import users from '@/users/datastore'
@@ -45,6 +46,7 @@ const appModules = [
4546
sidenav,
4647
places,
4748
subscriptions,
49+
offers,
4850
topbar,
4951
unsubscribe,
5052
users,

src/base/datastore/routerPlugin.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as Sentry from '@sentry/browser'
44
export default datastore => {
55
const isLoggedIn = () => datastore.getters['auth/isLoggedIn']
66
const getUserGroupId = () => isLoggedIn() && datastore.getters['auth/user'].currentGroup
7+
const getFeatures = () => datastore.getters['currentGroup/features']
78

89
router.beforeEach(async (to, from, nextFn) => {
910
datastore.commit('routeMeta/setNext', to)
@@ -25,7 +26,6 @@ export default datastore => {
2526
// redirect homescreen correctly
2627
else if (to.path === '/') {
2728
const groupId = getUserGroupId()
28-
2929
if (groupId) {
3030
next = { name: 'group', params: { groupId } }
3131
}
@@ -73,6 +73,20 @@ export default datastore => {
7373
catch (err) {
7474
Sentry.captureException(err)
7575
}
76+
77+
// Check if our route requires any features we don't have
78+
// It would be nice to do this _before_ we visit the route, but we don't have the features
79+
// available at that point
80+
const features = getFeatures()
81+
if (to.matched.some(m => m.meta.requireFeature && !features.includes(m.meta.requireFeature))) {
82+
const groupId = datastore.getters['currentGroup/id']
83+
if (groupId) {
84+
await router.push({ name: 'group', params: { groupId } })
85+
}
86+
else {
87+
await router.push({ path: '/' })
88+
}
89+
}
7690
})
7791

7892
datastore.watch((state, getters) => [

src/base/icons/icons.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"pickup_fw": "fas fa-fw fa-shopping-basket",
44
"feedback": "fas fa-balance-scale",
55
"place": "fas fa-shopping-cart",
6-
"place_fw": "fas fa-fw fa-shopping-cart"
6+
"place_fw": "fas fa-fw fa-shopping-cart",
7+
"offer": "fas fa-gift",
8+
"offer_fw": "fas fa-fw fa-gift"
79
}

0 commit comments

Comments
 (0)