From 6c970ea85ffff671f2d00a52ccd9669ab4faa814 Mon Sep 17 00:00:00 2001 From: shaunBoahCodes <131640457+shaunBoahCodes@users.noreply.github.com> Date: Sat, 5 Aug 2023 15:16:30 +0800 Subject: [PATCH] fix #82 #75 reject routing to stats and type selector, add routing to respective stats at scanner and registration (#84) * Add Home, Room Check-in * fixed codacy * clear netlify build * Update SearchAttendee.vue * Update ScanSearch * Fixed navabr * Update BaseTemplate.vue * Removed bottom navbar and updated dropdown menu * Minor fixes * Added checklist to printModal and simplified router * Name changes * Fixed passwordModal and removed password requirement for stats * Switched to template refs * minor fixes * Rearranged and renamed * Fix codacy issues * Changed casing * Fix #31 Added dropdown list that allows user to choose which details to show on search * Fixed format * Fix codacy * Minor fixes and renaming * Minor fixes and moved some code to inline * Fix #41 and codacy * fix codacy * Simplified code * fix #48 created standard button component and replaced some buttons * fix format * Converted all buttons to standard component * fixed format * fix codacy * Fix #40 standardised all p-6 except pages with scanners, optimised search function for mobile * changed prop name * removed activated classes * Minor UI fixes * fix #52 clicking print on search attendee now opens the print modal and logs name of card * fix #51 new layout for print modal * changed to margin * removed grow flex * minor fixes * fix #50 created success notification that shows on print * removed redundant code * fix margin of print modal * changed naming * switched to camel case, moved some functions to inline * minor changes * changed some refs to computed * fix #49 #46 ported everything to stores * fix codacy * fix #59 #53 search and logout attached to respective APIs * fix netlify * fix netlify * fix netlify * fix codacy * fix codacy * fix codacy * fix build * fix codacy * fix codacy * fix #61 implemented API for checking in attendees in registration via scan or search * fixed error * added dayjs * remove moment * fix comments * fix comments * fix comment * fix #68 implemented better error handling for logout function * Update auth.js * Update auth.js * fix #73 navbar dropdown fixed for small screen * fix comment * fix #82 #75 new routing to both stats * fix codacy --------- Co-authored-by: cweitat Co-authored-by: lizardon --- src/components/NavBar.vue | 19 +++++++++++++++---- src/router/index.js | 23 ++++++++++++++++++++++- src/views/ScannerTemplate.vue | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 5 deletions(-) create mode 100644 src/views/ScannerTemplate.vue diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index 7d34da2..343fc17 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -74,10 +74,21 @@ const navigation = [ { name: 'Statistics', href: '#', current: false, icon: ChartBarIcon }, { name: 'Close', href: '#', current: false, icon: XMarkIcon } ] -const userNavigation = [ - { name: 'Stats' }, - { name: 'Sign out', action: () => (showPasswordModal.value = true) } -] +const userNavigation = computed(() => { + if (route.params.registrationType) { + return [ + { name: 'Stats', action: () => router.push({ name: 'registerStats' }) }, + { name: 'Sign out', action: () => (showPasswordModal.value = true) } + ] + } else if (route.params.scannerType) { + return [ + { name: 'Stats', action: () => router.push({ name: 'scannerStats' }) }, + { name: 'Sign out', action: () => (showPasswordModal.value = true) } + ] + } else { + return [{ name: 'Sign out', action: () => (showPasswordModal.value = true) }] + } +}) const showNavigation = ref(false) const showPasswordModal = ref(false) const componentKey = ref(0) diff --git a/src/router/index.js b/src/router/index.js index 1547eb9..dd4ad88 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,10 +1,13 @@ import { createRouter, createWebHistory } from 'vue-router' import UserAuth from '@/views/UserAuth.vue' import StationSelector from '@/views/StationSelector.vue' +import ScannerTemplate from '@/views/ScannerTemplate.vue' import QRScannerCamera from '@/components/QRScanner/ScannerCamera.vue' +import ScannedStats from '@/components/QRScanner/ScannedStats.vue' import Registration from '@/views/Registration.vue' import RegistrationKiosk from '@/components/Registration/Kiosk/ScannerCamera.vue' import RegistrationManual from '@/components/Registration/Manual/ScanSearch.vue' +import RegistrationStats from '@/components/Registration/Manual/RegistrationStats.vue' import NotFound from '@/views/NotFound.vue' import AuthTemplate from '@/AuthTemplate.vue' @@ -41,13 +44,31 @@ const router = createRouter({ path: 'manual', name: 'registerHybrid', component: RegistrationManual + }, + { + path: 'stats', + name: 'registerStats', + component: RegistrationStats } ] }, { path: ':eventId/:stationId/scanner/:scannerType', name: 'scanner', - component: QRScannerCamera + redirect: { name: 'scannerCamera' }, + component: ScannerTemplate, + children: [ + { + path: 'camera', + name: 'scannerCamera', + component: QRScannerCamera + }, + { + path: 'stats', + name: 'scannerStats', + component: ScannedStats + } + ] } ] }, diff --git a/src/views/ScannerTemplate.vue b/src/views/ScannerTemplate.vue new file mode 100644 index 0000000..a8f26a3 --- /dev/null +++ b/src/views/ScannerTemplate.vue @@ -0,0 +1,33 @@ + + + \ No newline at end of file