From 2636d9fe889bd3ac5a03bd730241d8ce2dc1571e Mon Sep 17 00:00:00 2001 From: Khoa Ng Date: Sat, 2 May 2026 19:07:37 -0700 Subject: [PATCH 1/4] Save attendee dashboard changes before pull --- src/Pages/Events/EventAttendeesDashboard.js | 35 +++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/Pages/Events/EventAttendeesDashboard.js b/src/Pages/Events/EventAttendeesDashboard.js index ff578afe1..b86231b82 100644 --- a/src/Pages/Events/EventAttendeesDashboard.js +++ b/src/Pages/Events/EventAttendeesDashboard.js @@ -1,6 +1,6 @@ import { useEffect, useMemo, useState } from 'react'; import { Link, Redirect, useParams } from 'react-router-dom'; -import { getEventRegistrationByRequestId, getEventRegistrations } from '../../APIFunctions/SCEvents'; +import { getEventByID, getEventRegistrationByRequestId, getEventRegistrations } from '../../APIFunctions/SCEvents'; import { useSCE } from '../../Components/context/SceContext'; function formatDateTime(dateValue) { @@ -41,6 +41,21 @@ export default function EventAttendeesDashboard() { const [detailError, setDetailError] = useState(''); const [isDetailOpen, setIsDetailOpen] = useState(false); + const [event, setEvent] = useState(null); + + useEffect(() => { + if (!authenticated || !user?.token || !id) return; + + async function fetchEventDetails() { + const response = await getEventByID(id, user.token); + if (!response.error) { + setEvent(response.responseData); + } + } + + fetchEventDetails(); + }, [authenticated, id, user?.token]); + useEffect(() => { if (!authenticated || !user?.token || !id) return; @@ -96,8 +111,22 @@ export default function EventAttendeesDashboard() { const selectedAnswers = useMemo(() => { if (!selectedAttendee?.answers || typeof selectedAttendee.answers !== 'object') return []; - return Object.entries(selectedAttendee.answers); - }, [selectedAttendee]); + + // Create a mapping from question ID to question text (label) + const questionMap = {}; + if (event?.registration_form && Array.isArray(event.registration_form)) { + event.registration_form.forEach((question) => { + if (question.id) { + questionMap[question.id] = question.label || question.name || question.id; + } + }); + } + + return Object.entries(selectedAttendee.answers).map(([fieldKey, value]) => { + const questionText = questionMap[fieldKey] || fieldKey; + return [questionText, value]; + }); + }, [selectedAttendee, event]); if (!authenticated) return ; From f2b06b4da189470eabda82cca2aad3a43a1bf4d7 Mon Sep 17 00:00:00 2001 From: Khoa Ng Date: Sat, 2 May 2026 19:16:47 -0700 Subject: [PATCH 2/4] Change UUID to question name --- src/Pages/Events/EventAttendeesDashboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Pages/Events/EventAttendeesDashboard.js b/src/Pages/Events/EventAttendeesDashboard.js index b86231b82..fe64e9abe 100644 --- a/src/Pages/Events/EventAttendeesDashboard.js +++ b/src/Pages/Events/EventAttendeesDashboard.js @@ -117,7 +117,7 @@ export default function EventAttendeesDashboard() { if (event?.registration_form && Array.isArray(event.registration_form)) { event.registration_form.forEach((question) => { if (question.id) { - questionMap[question.id] = question.label || question.name || question.id; + questionMap[question.id] = question.question || question.label || question.name || question.id; } }); } From c830cdc60100b5a4f68e373c03337b97d78a5667 Mon Sep 17 00:00:00 2001 From: Khoa Ng Date: Sat, 2 May 2026 19:22:02 -0700 Subject: [PATCH 3/4] Change UUID to question name --- src/Pages/Events/EventAttendeesDashboard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Pages/Events/EventAttendeesDashboard.js b/src/Pages/Events/EventAttendeesDashboard.js index fe64e9abe..ebd5c27fa 100644 --- a/src/Pages/Events/EventAttendeesDashboard.js +++ b/src/Pages/Events/EventAttendeesDashboard.js @@ -111,7 +111,7 @@ export default function EventAttendeesDashboard() { const selectedAnswers = useMemo(() => { if (!selectedAttendee?.answers || typeof selectedAttendee.answers !== 'object') return []; - + // Create a mapping from question ID to question text (label) const questionMap = {}; if (event?.registration_form && Array.isArray(event.registration_form)) { @@ -196,7 +196,7 @@ export default function EventAttendeesDashboard() {
event.stopPropagation()} + onClick={(e) => e.stopPropagation()} >

Attendee Detail

From 4fdfa30468f1c1c00dac9e40c9530d2d5b807fbb Mon Sep 17 00:00:00 2001 From: Khoa Ng Date: Sat, 2 May 2026 19:48:43 -0700 Subject: [PATCH 4/4] fix cherry pick --- src/Pages/Events/EventAttendeesDashboard.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Pages/Events/EventAttendeesDashboard.js b/src/Pages/Events/EventAttendeesDashboard.js index ebd5c27fa..7fada0f4c 100644 --- a/src/Pages/Events/EventAttendeesDashboard.js +++ b/src/Pages/Events/EventAttendeesDashboard.js @@ -40,7 +40,6 @@ export default function EventAttendeesDashboard() { const [isLoadingDetail, setIsLoadingDetail] = useState(false); const [detailError, setDetailError] = useState(''); const [isDetailOpen, setIsDetailOpen] = useState(false); - const [event, setEvent] = useState(null); useEffect(() => { @@ -196,7 +195,7 @@ export default function EventAttendeesDashboard() {
e.stopPropagation()} + onClick={(event) => event.stopPropagation()} >

Attendee Detail