From 650aab0a997a905318be532cb669316867b1c808 Mon Sep 17 00:00:00 2001 From: Jaimyn Mayer Date: Sat, 22 Jun 2024 11:42:54 +1000 Subject: [PATCH] made member states consistent --- memberportal/api_general/views.py | 2 +- src-frontend/src/boot/routeGuards.ts | 4 ++-- .../src/components/AdminTools/MembersList.vue | 12 ++++++------ src-frontend/src/components/DigitalIdCard.vue | 2 +- src-frontend/src/layouts/MainLayout.vue | 4 ++-- src-frontend/src/pages/CheckAccess.vue | 2 +- src-frontend/src/pages/Dashboard.vue | 6 +++--- src-frontend/src/pages/Profile.vue | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/memberportal/api_general/views.py b/memberportal/api_general/views.py index 39cbccbc..bba878b2 100644 --- a/memberportal/api_general/views.py +++ b/memberportal/api_general/views.py @@ -379,7 +379,7 @@ def get(self, request): "lastName": p.last_name, "screenName": p.screen_name, "phone": p.phone, - "memberStatus": p.get_state_display(), + "memberStatus": p.state, "vehicleRegistrationPlate": p.vehicle_registration_plate, "lastInduction": p.last_induction, "lastSeen": p.last_seen, diff --git a/src-frontend/src/boot/routeGuards.ts b/src-frontend/src/boot/routeGuards.ts index c02667da..cc7d7c25 100644 --- a/src-frontend/src/boot/routeGuards.ts +++ b/src-frontend/src/boot/routeGuards.ts @@ -12,7 +12,7 @@ export default boot(({ router, store }) => { } if ( - store.getters['profile/profile']?.memberStatus === 'Needs Induction' && + store.getters['profile/profile']?.memberStatus === 'noob' && to.name !== 'membershipPlan' && to.name !== 'webcams' && to.name !== 'billing' && @@ -52,7 +52,7 @@ export default boot(({ router, store }) => { if ( to.meta.memberOnly && to.name !== 'webcams' && - store.getters['profile/profile'].memberStatus !== 'Active' + store.getters['profile/profile'].memberStatus !== 'active' ) return next({ name: 'Error403MemberOnly' }); diff --git a/src-frontend/src/components/AdminTools/MembersList.vue b/src-frontend/src/components/AdminTools/MembersList.vue index 166ce942..c0a13e31 100644 --- a/src-frontend/src/components/AdminTools/MembersList.vue +++ b/src-frontend/src/components/AdminTools/MembersList.vue @@ -128,7 +128,7 @@ export default defineComponent({ return { members: [], filter: '', - memberState: 'Active', + memberState: 'active', loading: false, pagination: { sortBy: 'date', @@ -156,11 +156,11 @@ export default defineComponent({ }, filterOptions() { return [ - { label: this.$t('adminTools.all'), value: 'All' }, - { label: this.$t('adminTools.active'), value: 'Active' }, - { label: this.$t('adminTools.inactive'), value: 'Inactive' }, - { label: this.$t('adminTools.new'), value: 'Needs Induction' }, - { label: this.$t('adminTools.accountOnly'), value: 'Account Only' }, + { label: this.$t('adminTools.all'), value: 'all' }, + { label: this.$t('adminTools.active'), value: 'active' }, + { label: this.$t('adminTools.inactive'), value: 'inactive' }, + { label: this.$t('adminTools.new'), value: 'noob' }, + { label: this.$t('adminTools.accountOnly'), value: 'accountonly' }, ]; }, columns() { diff --git a/src-frontend/src/components/DigitalIdCard.vue b/src-frontend/src/components/DigitalIdCard.vue index a2ddcd03..f2fb6989 100644 --- a/src-frontend/src/components/DigitalIdCard.vue +++ b/src-frontend/src/components/DigitalIdCard.vue @@ -8,7 +8,7 @@