diff --git a/src/App.tsx b/src/App.tsx index bc6b399..208e5c0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -43,6 +43,7 @@ import EventStatsPage from 'Pages/Events/EventStats'; import TicketUserList from './Pages/Ticket/TicketUserList'; import TicketDescPage from './Pages/Ticket/TicketDesc'; import EventScheduleCreate from 'Pages/Events/EventScheduleCreate'; +import EventResults from 'Pages/Events/EventResults'; function App() { return ( @@ -168,6 +169,16 @@ function EventsRoutes() { } />, + + + + } + />, {event?.eventStatus} + + Results Published + + + {event?.results && event.results.length > 0 ? 'YES' : 'NO'} + + Number of Rounds diff --git a/src/Components/Events/EventDesc/ToolBar/ToolBar.tsx b/src/Components/Events/EventDesc/ToolBar/ToolBar.tsx index 530bb72..04bdccb 100644 --- a/src/Components/Events/EventDesc/ToolBar/ToolBar.tsx +++ b/src/Components/Events/EventDesc/ToolBar/ToolBar.tsx @@ -38,11 +38,11 @@ export default function ToolBar({ eventId }: { eventId: number }) { + + {canEdit && ( + + )} + + {canEdit && ( + + )} + + + + {crudError && ( + + {crudError} + + )} + + + {event.results && event.results.length > 0 ? ( + event.results.map((res) => ( + + + + + {res.position} + + + + {res.teamName} + + + + {res.teamMembers} + + + + ID: {res.excelId} | Team: {res.teamId} + + + {canEdit && ( + + handleOpenDialog(res)} + size="small" + > + + + { + setResultToDelete(res.id); + setDeleteConfirmationOpen(true); + }} + size="small" + > + + + + )} + + + + )) + ) : ( + + No results declared yet. + + )} + + + + + {editingResult ? 'Edit Result' : 'Add Result'} + + {crudError && ( + + {crudError} + + )} + + + { + if ('user' in option) { + const excelIdVal = + typeof option.excelId === 'object' && + option.excelId !== null && + 'id' in option.excelId + ? (option.excelId as any).id + : option.excelId; + return `${option.user.name} (${excelIdVal})`; + } else { + // ITeam + return `${option.name} (ID: ${option.id})`; + } + }} + onChange={handleRegistrationSelect} + loading={event.isTeam ? teamRegsLoading : individualRegsLoading} + renderInput={(params) => ( + + )} + /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {/* Delete Confirmation Dialog */} + setDeleteConfirmationOpen(false)}> + Delete Result + + Are you sure you want to delete this result? + + + + + + + + {/* Delete All Confirmation Dialog */} + setDeleteAllConfirmationOpen(false)} + > + Delete All Results + + + Are you sure you want to delete ALL results for this event? This action cannot be + undone. + + + Please type delete to confirm. + + setDeleteConfirmationText(e.target.value)} + /> + + + + + + + + + ); +}