Change content of Feedback form, delete title icon.

This commit is contained in:
2026-05-13 12:13:07 +07:00
parent 9f4a7ce0e7
commit 9cafa23721
5 changed files with 431 additions and 500 deletions
+19 -33
View File
@@ -37,39 +37,27 @@ type RegistrationBody = {
type FeedbackBody = {
type: "feedback";
eventRating: string;
venueSatisfaction: string;
session: string;
sessionLabel?: string;
speakerRating: string;
improve2027: string;
comments: string;
ipv6Readiness: string;
challenge: string;
challengeLabel?: string;
introductions: string;
collaboration: string[];
collaborationLabels?: string[];
venueRating: string;
[key: string]: any;
};
function buildFeedbackNotes(b: FeedbackBody): string {
const collab =
b.collaborationLabels?.length ? b.collaborationLabels.join(", ") : b.collaboration.join(", ") || "—";
const lines = [
"Source: Event feedback",
b.eventRating && `Overall event rating: ${b.eventRating}/5`,
b.venueSatisfaction && `Venue & logistics satisfaction: ${b.venueSatisfaction}/5`,
(b.sessionLabel || b.session) && `Most valuable session: ${b.sessionLabel || b.session || "—"}`,
b.speakerRating && `Keynote rating: ${b.speakerRating}/5`,
b.ipv6Readiness && `IPv6 readiness: ${b.ipv6Readiness}/5`,
(b.challengeLabel || b.challenge) &&
`Infrastructure challenge: ${b.challengeLabel || b.challenge || "—"}`,
b.introductions && `Speaker / company introductions: ${b.introductions}`,
`Collaboration interests: ${collab}`,
b.venueRating && `Venue rating (HCMC): ${b.venueRating}/5`,
b.improve2027 && `Improve for 2027: ${b.improve2027}`,
b.comments && `Comments: ${b.comments}`,
b.overallExperience && `Overall experience: ${b.overallExperience}/5`,
b.venueFacilities && `Venue & Facilities: ${b.venueFacilities}/5`,
b.organisationProcess && `Organisation & Registration: ${b.organisationProcess}/5`,
b.mostValuableSession && `Most valuable session: ${b.mostValuableSession}`,
b.relevance && `Content relevance: ${b.relevance}`,
b.speakerRating && `Speakers/Panels rating: ${b.speakerRating}`,
b.networkingUtility && `Networking utility: ${b.networkingUtility}`,
b.futureTopics && `Future topics: ${Array.isArray(b.futureTopics) ? b.futureTopics.join(", ") : b.futureTopics}${b.futureTopics_other ? ` (Other: ${b.futureTopics_other})` : ""}`,
b.attendAgain && `Attend again in 2027: ${b.attendAgain}`,
b.recommend && `Recommend to others: ${b.recommend}`,
b.enjoyedMost && `Enjoyed most: ${b.enjoyedMost}`,
b.improvementAreas && `Improvement areas: ${b.improvementAreas}`,
b.additionalComments && `Additional comments: ${b.additionalComments}`,
b.industry && `Industry: ${Array.isArray(b.industry) ? b.industry.join(", ") : b.industry}${b.industry_other ? ` (Other: ${b.industry_other})` : ""}`,
b.role && `Role: ${Array.isArray(b.role) ? b.role.join(", ") : b.role}${b.role_other ? ` (Other: ${b.role_other})` : ""}`,
];
return lines.filter(Boolean).join("\n");
}
@@ -137,11 +125,9 @@ export async function POST(req: Request) {
if (t === "feedback") {
const b = body as FeedbackBody;
const sessionTitle =
typeof b.sessionLabel === "string" && b.sessionLabel
? b.sessionLabel
: typeof b.session === "string" && b.session
? b.session
: "General";
typeof b.mostValuableSession === "string" && b.mostValuableSession
? b.mostValuableSession
: "General";
const row: AdminRequestRow = {
id: newId(),