Skip to content

Commit

Permalink
fix #82 #75 reject routing to stats and type selector, add routing to…
Browse files Browse the repository at this point in the history
… 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 <cweitat@gmail.com>
Co-authored-by: lizardon <donchia@ymail.com>
  • Loading branch information
3 people authored Aug 5, 2023
1 parent aec8c1c commit 6c970ea
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 5 deletions.
19 changes: 15 additions & 4 deletions src/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
23 changes: 22 additions & 1 deletion src/router/index.js
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -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
}
]
}
]
},
Expand Down
33 changes: 33 additions & 0 deletions src/views/ScannerTemplate.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<script setup>
import { useRouter, useRoute } from 'vue-router'
import { useTypeSelectorStore } from '@/stores/typeSelector'
const router = useRouter()
const route = useRoute()
const typeSelectorStore = useTypeSelectorStore()
// // check validity of eventId and registration type
const eventId = route.params.eventId
const scannerType = route.params.scannerType
// // check if eventId and registrationType are valid
if (!eventId || !scannerType) {
router.replace({ name: 'NotFound' })
}
// // check if registrationType is valid
// // loop through array if registrationType is in object id
const scannerTypes = typeSelectorStore.stationTypes
const scannerTypeIsValid = scannerTypes.some((type) => type.id === scannerType)
// // if invalid redirect back to login
if (!scannerTypeIsValid) {
router.replace({ name: 'NotFound' })
}
</script>

<template>
<div class="m-6">
<RouterView />
</div>
</template>

0 comments on commit 6c970ea

Please sign in to comment.