-
Notifications
You must be signed in to change notification settings - Fork 23
challenge additions to platform ui for ai arena #1552
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
jpeg22
wants to merge
6
commits into
topcoder-platform:ai-arena-manager
Choose a base branch
from
jpeg22:ai_arena_march_2026
base: ai-arena-manager
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 all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
942e766
challenge additions to platform ui for ai arena
f352e78
resolved craco and missing reports and null check
a17d722
corrected lowercase R in Reports
ea90b40
Update craco.config.js
jpeg22 4a345e2
updated craco and routes and verified build
2b6bc83
manual update to craco verified in build
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
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 |
|---|---|---|
|
|
@@ -249,5 +249,6 @@ | |
| "volta": { | ||
| "node": "22.13.0", | ||
| "yarn": "1.22.22" | ||
| } | ||
| }, | ||
| "packageManager": "yarn@1.22.22" | ||
| } | ||
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 @@ | ||
| export * from './src' |
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,32 @@ | ||
| import { FC, useContext, useEffect, useMemo } from 'react' | ||
| import { Outlet, Routes } from 'react-router-dom' | ||
|
|
||
| import { routerContext, RouterContextData } from '~/libs/core' | ||
|
|
||
| import { toolTitle } from './arena-manager.routes' | ||
| import './lib/styles/index.scss' | ||
|
|
||
| /** | ||
| * Root component for the Arena Manager micro-app. | ||
| */ | ||
| const ArenaManagerApp: FC = () => { | ||
| const { getChildRoutes }: RouterContextData = useContext(routerContext) | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| const childRoutes = useMemo(() => getChildRoutes(toolTitle), []) | ||
|
|
||
| useEffect(() => { | ||
| document.body.classList.add('arena-manager-app') | ||
| return () => { | ||
| document.body.classList.remove('arena-manager-app') | ||
| } | ||
| }, []) | ||
|
|
||
| return ( | ||
| <div> | ||
| <Outlet /> | ||
| <Routes>{childRoutes}</Routes> | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| export default ArenaManagerApp |
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,80 @@ | ||
| import { AppSubdomain, ToolTitle } from '~/config' | ||
| import { | ||
| lazyLoad, | ||
| PlatformRoute, | ||
| Rewrite, | ||
| } from '~/libs/core' | ||
|
|
||
| import { | ||
| aiHubTournamentRoute, | ||
| problemLibraryRouteId, | ||
| rootRoute, | ||
| tournamentLaunchRouteId, | ||
| tournamentsRouteId, | ||
| } from './config/routes.config' | ||
| import ActiveTournamentAiHubPage from './tournaments/ActiveTournamentAiHubPage' | ||
|
|
||
| const ArenaManagerApp = lazyLoad( | ||
| () => import('./ArenaManagerApp'), | ||
| ) | ||
|
|
||
| const ProblemLibraryPage = lazyLoad( | ||
| () => import('./problem-library/ProblemLibraryPage'), | ||
| 'ProblemLibraryPage', | ||
| ) | ||
|
|
||
| const TournamentPage = lazyLoad( | ||
| () => import('./tournaments'), | ||
| 'TournamentPage', | ||
| ) | ||
|
|
||
| const TournamentLaunchPage = lazyLoad( | ||
| () => import('./tournaments/TournamentLaunchPage'), | ||
| 'TournamentLaunchPage', | ||
| ) | ||
|
|
||
| export const toolTitle: string = ToolTitle.arenaManager | ||
|
|
||
| export const arenaManagerRoutes: ReadonlyArray<PlatformRoute> = [ | ||
| { | ||
| authRequired: false, | ||
| element: <ActiveTournamentAiHubPage />, | ||
| id: 'ai-hub-tournament', | ||
| route: aiHubTournamentRoute, | ||
| title: 'Active Tournament', | ||
| }, | ||
| { | ||
| authRequired: true, | ||
| // TODO: Restrict viewing of Arena Manager pages by role when role policy is finalized. | ||
| // Example: rolesRequired: ['arena-admin'] | ||
| children: [ | ||
| { | ||
| element: <Rewrite to={problemLibraryRouteId} />, | ||
| route: '', | ||
| }, | ||
| { | ||
| element: <ProblemLibraryPage />, | ||
| id: problemLibraryRouteId, | ||
| route: problemLibraryRouteId, | ||
| title: 'Problem Library', | ||
| }, | ||
| { | ||
| element: <TournamentPage />, | ||
| id: tournamentsRouteId, | ||
| route: tournamentsRouteId, | ||
| title: 'Tournaments', | ||
| }, | ||
| { | ||
| element: <TournamentLaunchPage />, | ||
| id: tournamentLaunchRouteId, | ||
| route: `${tournamentsRouteId}/:tourneyId/launch`, | ||
| title: 'Launch Tournament', | ||
| }, | ||
| ], | ||
| domain: AppSubdomain.arenaManager, | ||
| element: <ArenaManagerApp />, | ||
| id: toolTitle, | ||
| route: rootRoute, | ||
| title: toolTitle, | ||
| }, | ||
| ] |
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,14 @@ | ||
| /** | ||
| * Shared constants for the arena-manager app. | ||
| */ | ||
|
|
||
| export const MSG_NO_PROBLEMS_FOUND = 'No problems registered. Upload one to get started.' | ||
| export const MSG_NO_TOURNAMENTS_FOUND = 'No tournaments found.' | ||
|
|
||
| export const FALLBACK_PROBLEM_IDS = [ | ||
| 'P1-Sorting', | ||
| 'P2-Maze', | ||
| 'P3-Pathing', | ||
| 'P4-Search', | ||
| 'P5-Heuristic', | ||
| ] |
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,2 @@ | ||
| export * from './index.config' | ||
| export * from './routes.config' |
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,22 @@ | ||
| /** | ||
| * Route IDs and root path for the arena-manager app. | ||
| */ | ||
| import { AppSubdomain, EnvironmentConfig } from '~/config' | ||
|
|
||
| export const rootRoute: string | ||
| = EnvironmentConfig.SUBDOMAIN === AppSubdomain.arenaManager | ||
| ? '' | ||
| : `/${AppSubdomain.arenaManager}` | ||
|
|
||
| export const problemLibraryRouteId = 'problem-library' | ||
| export const tournamentsRouteId = 'tournaments' | ||
| export const tournamentLaunchRouteId = 'tournament-launch' | ||
| export const aiHubTournamentRoute = '/ai-hub/tournament' | ||
|
|
||
| export function getTournamentLaunchPath(tourneyId: string): string { | ||
| return `${rootRoute}/${tournamentsRouteId}/${tourneyId}/launch` | ||
| } | ||
|
|
||
| export function getActiveTournamentPath(): string { | ||
| return aiHubTournamentRoute | ||
| } |
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,2 @@ | ||
| export { arenaManagerRoutes } from './arena-manager.routes' | ||
| export { rootRoute as arenaManagerRootRoute } from './config/routes.config' |
67 changes: 67 additions & 0 deletions
67
...na-manager/src/lib/components/DeleteConfirmationModal/DeleteConfirmationModal.module.scss
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,67 @@ | ||
| @import '@libs/ui/styles/includes'; | ||
|
|
||
| .modalOverlay { | ||
| align-items: center; | ||
| background: rgb(15 23 42 / 0.45); | ||
| display: flex; | ||
| inset: 0; | ||
| justify-content: center; | ||
| padding: $sp-4; | ||
| position: fixed; | ||
| z-index: 1200; | ||
| } | ||
|
|
||
| .modal { | ||
| background: $tc-white; | ||
| border-radius: 12px; | ||
| box-shadow: 0 10px 30px rgb(0 0 0 / 0.2); | ||
| max-width: 540px; | ||
| overflow: hidden; | ||
| width: 100%; | ||
| } | ||
|
|
||
| .modalHeader { | ||
| align-items: center; | ||
| border-bottom: 1px solid $black-20; | ||
| display: flex; | ||
| justify-content: space-between; | ||
| padding: $sp-4 $sp-5; | ||
| } | ||
|
|
||
| .modalTitle { | ||
| font-family: $font-barlow; | ||
| font-size: 22px; | ||
| font-weight: $font-weight-bold; | ||
| line-height: 30px; | ||
| margin: 0; | ||
| text-transform: none; | ||
| } | ||
|
|
||
| .modalClose { | ||
| background: transparent; | ||
| border: 0; | ||
| color: $black-60; | ||
| cursor: pointer; | ||
| font-size: 20px; | ||
| line-height: 1; | ||
| padding: 0; | ||
| } | ||
|
|
||
| .confirmBody { | ||
| padding: $sp-5; | ||
| } | ||
|
|
||
| .confirmText { | ||
| color: $black-80; | ||
| font-size: 16px; | ||
| line-height: 24px; | ||
| margin: 0; | ||
| } | ||
|
|
||
| .confirmActions { | ||
| display: flex; | ||
| gap: $sp-3; | ||
| justify-content: flex-end; | ||
| margin-top: $sp-5; | ||
| } | ||
|
|
77 changes: 77 additions & 0 deletions
77
...apps/arena-manager/src/lib/components/DeleteConfirmationModal/DeleteConfirmationModal.tsx
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,77 @@ | ||
| import { FC, ReactNode } from 'react' | ||
|
|
||
| import { Button } from '~/libs/ui' | ||
|
|
||
| import styles from './DeleteConfirmationModal.module.scss' | ||
|
|
||
| interface DeleteConfirmationModalProps { | ||
| open: boolean | ||
| title: string | ||
| content: ReactNode | ||
| confirmLabel: string | ||
| cancelLabel?: string | ||
| confirmButtonClassName?: string | ||
| isProcessing?: boolean | ||
| onCancel: () => void | ||
| onConfirm: () => void | ||
| } | ||
|
|
||
| export const DeleteConfirmationModal: FC<DeleteConfirmationModalProps> = ( | ||
| props: DeleteConfirmationModalProps, | ||
| ) => { | ||
| if (!props.open) { | ||
| return null | ||
| } | ||
|
|
||
| return ( | ||
| <div | ||
| className={styles.modalOverlay} | ||
| onClick={() => !props.isProcessing && props.onCancel()} | ||
| role='dialog' | ||
| aria-modal='true' | ||
| aria-label={props.title} | ||
| > | ||
| <div | ||
| className={styles.modal} | ||
| onClick={event => event.stopPropagation()} | ||
| > | ||
| <div className={styles.modalHeader}> | ||
| <h4 className={styles.modalTitle}>{props.title}</h4> | ||
| <button | ||
| className={styles.modalClose} | ||
| onClick={props.onCancel} | ||
| disabled={props.isProcessing} | ||
| aria-label='Close' | ||
| > | ||
| ✕ | ||
| </button> | ||
| </div> | ||
| <div className={styles.confirmBody}> | ||
| <div className={styles.confirmText}>{props.content}</div> | ||
| <div className={styles.confirmActions}> | ||
| <Button | ||
| size='sm' | ||
| secondary | ||
| noCaps | ||
| onClick={props.onCancel} | ||
| disabled={props.isProcessing} | ||
| > | ||
| {props.cancelLabel || 'Cancel'} | ||
| </Button> | ||
| <Button | ||
| size='sm' | ||
| noCaps | ||
| onClick={props.onConfirm} | ||
| disabled={props.isProcessing} | ||
| className={props.confirmButtonClassName} | ||
| > | ||
| {props.confirmLabel} | ||
| </Button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| export default DeleteConfirmationModal |
1 change: 1 addition & 0 deletions
1
src/apps/arena-manager/src/lib/components/DeleteConfirmationModal/index.ts
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 @@ | ||
| export { default as DeleteConfirmationModal } from './DeleteConfirmationModal' |
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 @@ | ||
| export * from './DeleteConfirmationModal' |
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,3 @@ | ||
| export * from './components' | ||
| export * from './models' | ||
| export * from './services' |
8 changes: 8 additions & 0 deletions
8
src/apps/arena-manager/src/lib/models/ResponseObject.model.ts
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,8 @@ | ||
| /** | ||
| * Generic API response wrapper from the arena-manager api. | ||
| */ | ||
| export interface ResponseObject<T> { | ||
| data: T | ||
| success: boolean | ||
| message: string | ||
| } |
13 changes: 13 additions & 0 deletions
13
src/apps/arena-manager/src/lib/models/SourceProblem.model.ts
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,13 @@ | ||
| /** | ||
| * Represents a programming problem in the problem library. | ||
| */ | ||
| export interface SourceProblem { | ||
| problemId: string | ||
| problemName: string | ||
| /** Whether the problem has successfully passed its Docker test run. */ | ||
| isTested: boolean | ||
| /** Whether the problem is flagged as ready for use in a contest. */ | ||
| isContestReady: boolean | ||
| /** Human-readable test status: 'Pending Test' | 'Passed' | 'Failed' */ | ||
| status?: string | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.