-
Notifications
You must be signed in to change notification settings - Fork 11
Add functionality to use check-in app for QR code scanning with eventyay #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Sak1012
wants to merge
23
commits into
fossasia:development
Choose a base branch
from
Sak1012:badge-integration
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 18 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
0771e62
Add Device Registration button and route
Sak1012 077215b
Added Select Server option in LoginForm
Sak1012 4c8f4da
Added basic QR handling logic
Sak1012 57f721b
Device auth and event list selection
Sak1012 cbc8b39
Added Field to enter Device Auth Token manually
Sak1012 3405c89
Added Ticket QR scanning Page
Sak1012 4f382e0
Fixes
Sak1012 67ee3dd
Add Eventyay route Selection Page
Sak1012 b505113
Added basic auth logic for leed scanning
Sak1012 67e1679
Add Lead API and Check-in API
Sak1012 e168a42
Fix Syntax
Sak1012 d016d4c
Changed The Workflow
Sak1012 049a99e
Added Popup to show scanned lead info
Sak1012 da28507
Update .env
Sak1012 e188f12
Added additional Lead Fucntionality
Sak1012 426cf90
Changes
Sak1012 fa04c51
Updated Lead Scanning and CSV to now support Booth Info
Sak1012 1e76141
Add logout functionality to maintain session
Sak1012 42f2a92
Add Badge preview and printing option and modify Event Selection Page
Sak1012 91a9325
Env Variable fix
Sak1012 c95c222
Workflow fix
Sak1012 f3e6f71
conf fix
Sak1012 d2ff327
Add Search and Checkin
Sak1012 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
VITE_TEST_API_URL=https://test-api.eventyay.com/v1 | ||
VITE_PROD_API_URL=https://api.eventyay.com/v1 | ||
VITE_TEST_API_URL=https://app-test-eventyay.com/v1 | ||
VITE_PROD_API_URL=https://app.eventyay.com/v1 | ||
VITE_LOCAL_PORT=8000 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<script setup> | ||
import { onMounted } from 'vue' | ||
import { useTagStore } from '@/stores/tags' | ||
import { storeToRefs } from 'pinia' | ||
|
||
const props = defineProps({ | ||
modelValue: { | ||
type: Array, | ||
required: true | ||
} | ||
}) | ||
|
||
const emit = defineEmits(['update:modelValue']) | ||
|
||
const tagStore = useTagStore() | ||
const { availableTags, currentTags, inputValue } = storeToRefs(tagStore) | ||
|
||
onMounted(() => { | ||
tagStore.fetchTags() | ||
}) | ||
console.log(availableTags) | ||
function handleInput(e) { | ||
tagStore.handleCommaInput(e.target.value) | ||
emit('update:modelValue', currentTags.value) | ||
} | ||
|
||
function handleKeydown(e) { | ||
if (e.key === 'Enter') { | ||
e.preventDefault() | ||
if (inputValue.value) { | ||
tagStore.addTag(inputValue.value) | ||
inputValue.value = '' | ||
emit('update:modelValue', currentTags.value) | ||
} | ||
} else if (e.key === 'Backspace' && !inputValue.value && currentTags.value.length > 0) { | ||
tagStore.removeTag(currentTags.value.length - 1) | ||
emit('update:modelValue', currentTags.value) | ||
} | ||
} | ||
|
||
function addExistingTag(tag) { | ||
tagStore.addTag(tag) | ||
emit('update:modelValue', currentTags.value) | ||
} | ||
|
||
function removeTag(index) { | ||
tagStore.removeTag(index) | ||
emit('update:modelValue', currentTags.value) | ||
} | ||
</script> | ||
|
||
<template> | ||
<div class="w-full"> | ||
<div class="mb-2 flex flex-wrap gap-2"> | ||
<!-- Current tags --> | ||
<div | ||
v-for="(tag, index) in currentTags" | ||
:key="index" | ||
class="items-center rounded-full bg-primary px-2 py-1 text-sm text-white hover:bg-danger" | ||
@click="removeTag(index)" | ||
> | ||
{{ tag }} | ||
</div> | ||
</div> | ||
|
||
<!-- Available tags --> | ||
<div class="mb-2 flex flex-wrap gap-2"> | ||
<button | ||
v-for="tag in availableTags.filter((t) => !currentTags.includes(t))" | ||
:key="tag" | ||
@click="addExistingTag(tag)" | ||
class="rounded-full border px-2 py-1 text-sm text-black hover:bg-secondary hover:text-white" | ||
> | ||
+ {{ tag }} | ||
</button> | ||
</div> | ||
|
||
<!-- Tag input --> | ||
<input | ||
v-model="inputValue" | ||
type="text" | ||
class="w-full rounded border p-2" | ||
placeholder="Add tags (comma-separated)" | ||
@input="handleInput" | ||
@keydown="handleKeydown" | ||
@focus="tagStore.fetchTags()" | ||
/> | ||
</div> | ||
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
<script setup> | ||
import StandardButton from '@/components/Common/StandardButton.vue' | ||
import QRCamera from '@/components/Common/QRCamera.vue' | ||
import { useLoadingStore } from '@/stores/loading' | ||
import { useProcessEventyayCheckInStore } from '@/stores/processEventyayCheckIn' | ||
import { useEventyayApi } from '@/stores/eventyayapi' | ||
import { storeToRefs } from 'pinia' | ||
import { watch, ref, onUnmounted } from 'vue' | ||
|
||
const loadingStore = useLoadingStore() | ||
loadingStore.contentLoaded() | ||
|
||
const processEventyayCheckInStore = useProcessEventyayCheckInStore() | ||
const { message, showSuccess, showError, badgeUrl, isGeneratingBadge } = storeToRefs( | ||
processEventyayCheckInStore | ||
) | ||
const processApi = useEventyayApi() | ||
const { apitoken, url, organizer, eventSlug } = processApi | ||
const countdown = ref(5) | ||
const timerInstance = ref(null) | ||
const timeoutInstance = ref(null) | ||
const notes = ref('') | ||
|
||
function startCountdown() { | ||
countdown.value = 5 | ||
timerInstance.value = setInterval(() => { | ||
countdown.value-- | ||
if (countdown.value <= 0) { | ||
clearInterval(timerInstance.value) | ||
processEventyayCheckInStore.$reset() | ||
} | ||
}, 1000) | ||
} | ||
|
||
function stopTimer() { | ||
if (timerInstance.value) { | ||
clearInterval(timerInstance.value) | ||
} | ||
if (timeoutInstance.value) { | ||
clearTimeout(timeoutInstance.value) | ||
} | ||
} | ||
|
||
function handleNotesInput() { | ||
stopTimer() | ||
countdown.value = '...' | ||
} | ||
|
||
function handleSave() { | ||
console.log('Saving notes:', notes.value) | ||
processEventyayCheckInStore.$reset() | ||
stopTimer() | ||
} | ||
|
||
function handleCancel() { | ||
processEventyayCheckInStore.$reset() | ||
stopTimer() | ||
} | ||
|
||
function handlePrintBadge() { | ||
if (badgeUrl.value) { | ||
console.log(`${url}${badgeUrl.value}`) | ||
const printWindow = window.open(`${url}${badgeUrl.value}`) | ||
if (printWindow) { | ||
printWindow.onload = function () { | ||
printWindow.print() | ||
} | ||
} | ||
} | ||
} | ||
|
||
async function handlePrint() { | ||
stopTimer() | ||
console.log('Printing badge...') | ||
console.log('Badge URL:', badgeUrl.value) | ||
if (badgeUrl.value) { | ||
await processEventyayCheckInStore.printBadge(badgeUrl.value) | ||
} | ||
handlePrintBadge() | ||
console.log('Badge printed') | ||
startCountdown() | ||
} | ||
|
||
watch([showSuccess, showError], ([newSuccess, newError], [oldSuccess, oldError]) => { | ||
if ((!oldSuccess && newSuccess) || (!oldError && newError)) { | ||
showPopup() | ||
} | ||
}) | ||
|
||
function showPopup() { | ||
notes.value = '' | ||
startCountdown() | ||
timeoutInstance.value = setTimeout(() => { | ||
processEventyayCheckInStore.$reset() | ||
}, 5000) | ||
} | ||
|
||
// Cleanup timers when component is destroyed | ||
onUnmounted(() => { | ||
stopTimer() | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="flex h-screen w-full flex-col items-center justify-center"> | ||
<QRCamera qr-type="eventyaycheckin" scan-type="Check-In" /> | ||
<!-- Attendee Info Popup Modal --> | ||
<div | ||
v-if="(showSuccess || showError) && message?.attendee" | ||
class="fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50" | ||
> | ||
<div class="relative w-96 rounded bg-white p-5 shadow-lg"> | ||
<!-- Countdown display --> | ||
<div | ||
class="bg-gray-200 text-gray-600 absolute right-2 top-2 flex h-8 w-8 items-center justify-center rounded-full font-medium" | ||
> | ||
{{ countdown }} | ||
</div> | ||
|
||
<h2 :class="showError ? 'text-red-600 mb-2 text-xl' : 'text-green-600 mb-2 text-xl'"> | ||
{{ message.message }} | ||
</h2> | ||
<div> | ||
<p><b>Name:</b> {{ message.attendee }}</p> | ||
<div class="mt-4 flex flex-col space-y-3"> | ||
<StandardButton | ||
v-if="badgeUrl && showSuccess" | ||
type="button" | ||
:text="isGeneratingBadge ? 'Generating Badge...' : 'Print Badge'" | ||
:disabled="isGeneratingBadge" | ||
@click="handlePrint" | ||
class="btn-primary w-full justify-center" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<script setup> | ||
import { useLoadingStore } from '@/stores/loading' | ||
import { useEventyayApi } from '@/stores/eventyayapi' | ||
import { useEventyayEventStore } from '@/stores/eventyayEvent' | ||
|
||
import { ref, onMounted, watchEffect } from 'vue' | ||
import StandardButton from '@/components/Common/StandardButton.vue' | ||
import { useRouter } from 'vue-router' | ||
|
||
const loadingStore = useLoadingStore() | ||
const router = useRouter() | ||
|
||
const selectedEvent = ref(null) | ||
const eventyayEventStore = useEventyayEventStore() | ||
const { events, error } = eventyayEventStore | ||
const processApi = useEventyayApi() | ||
const { apitoken, url, organizer, selectedRole } = processApi | ||
|
||
loadingStore.contentLoaded() | ||
eventyayEventStore.fetchEvents(url, apitoken, organizer) | ||
|
||
const submitForm = () => { | ||
if (selectedEvent.value) { | ||
const selectedEventData = events.find((event) => event.slug === selectedEvent.value) | ||
if (selectedEventData) { | ||
console.log('Selected Event:', selectedEventData) | ||
console.log('Selected Role:', selectedRole) | ||
processApi.setEventSlug(selectedEventData.slug) | ||
if (selectedRole === 'Exhibitor') router.push({ name: 'eventyayleedlogin' }) | ||
if (selectedRole === 'CheckIn' || selectedRole === 'Badge Station') | ||
router.push({ name: 'eventyaycheckin' }) | ||
} | ||
} else { | ||
console.error('Please select an event.') | ||
Sak1012 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
</script> | ||
<template> | ||
<div class="-mt-16 flex h-screen flex-col justify-center"> | ||
<div v-if="error" class="text-danger">{{ error }}</div> | ||
<form v-if="events.length" @submit.prevent="submitForm"> | ||
Sak1012 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<div v-for="event in events" :key="event.slug" class="mb-2"> | ||
<label> | ||
<input type="radio" :value="event.slug" v-model="selectedEvent" /> | ||
{{ event.name.en }} | ||
</label> | ||
</div> | ||
<div> | ||
<StandardButton | ||
type="submit" | ||
text="Select Event" | ||
class="btn-primary mt-6 w-full justify-center" | ||
/> | ||
</div> | ||
</form> | ||
<div v-if="!events.length && !error"> | ||
No events available | ||
<StandardButton | ||
text="Refresh" | ||
class="btn-primary mt-6 w-1/2 justify-center" | ||
@click="fetchEvents(url.value, apiToken.value, organiser.value)" | ||
/> | ||
</div> | ||
</div> | ||
</template> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be removed