Skip to content

Commit dd570a9

Browse files
Merge pull request #995 from topcoder-platform/PM-579-copilot-form
PM-579 Add copilot request UI
2 parents b495218 + 45b867e commit dd570a9

File tree

16 files changed

+727
-1
lines changed

16 files changed

+727
-1
lines changed

src/apps/copilots/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Copilots app

src/apps/copilots/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './src'

src/apps/copilots/src/CopilotsApp.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { FC, useContext } from 'react'
2+
import { Outlet, Routes } from 'react-router-dom'
3+
4+
import { routerContext, RouterContextData } from '~/libs/core'
5+
import { SharedSwrConfig } from '~/libs/shared'
6+
7+
import { toolTitle } from './copilots.routes'
8+
9+
const CopilotsApp: FC<{}> = () => {
10+
const { getChildRoutes }: RouterContextData = useContext(routerContext)
11+
12+
return (
13+
<SharedSwrConfig>
14+
<Outlet />
15+
<Routes>
16+
{getChildRoutes(toolTitle)}
17+
</Routes>
18+
</SharedSwrConfig>
19+
)
20+
}
21+
22+
export default CopilotsApp
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export enum ProjectType {
2+
design = 'Design',
3+
developement = 'Development',
4+
marathonCopilot = 'Data Science (Marathon Copilot)',
5+
sprintCopilot = 'Data Science (Sprint Copilot)',
6+
marathonTester = 'Data Science (Marathon Tester)',
7+
qa = 'QA (Quality Assurance)',
8+
ai='AI (Artificial Intelligence)',
9+
}
10+
11+
export const ProjectTypes = [
12+
ProjectType.design,
13+
ProjectType.developement,
14+
ProjectType.marathonCopilot,
15+
ProjectType.marathonTester,
16+
ProjectType.sprintCopilot,
17+
ProjectType.qa,
18+
ProjectType.ai,
19+
]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { lazyLoad, LazyLoadedComponent, PlatformRoute, UserRole } from '~/libs/core'
2+
import { AppSubdomain, EnvironmentConfig, ToolTitle } from '~/config'
3+
4+
const CopilotsApp: LazyLoadedComponent = lazyLoad(() => import('./CopilotsApp'))
5+
const CopilotsRequestForm: LazyLoadedComponent = lazyLoad(() => import('./pages/copilot-request-form/index'))
6+
7+
export const rootRoute: string = (
8+
EnvironmentConfig.SUBDOMAIN === AppSubdomain.copilots ? '' : `/${AppSubdomain.copilots}`
9+
)
10+
11+
export const toolTitle: string = ToolTitle.copilots
12+
export const absoluteRootRoute: string = `${window.location.origin}${rootRoute}`
13+
14+
export const copilotsRoutes: ReadonlyArray<PlatformRoute> = [
15+
{
16+
authRequired: true,
17+
children: [
18+
{
19+
element: <CopilotsRequestForm />,
20+
id: 'CopilotRequestForm',
21+
route: '/request',
22+
},
23+
24+
],
25+
domain: AppSubdomain.copilots,
26+
element: <CopilotsApp />,
27+
id: toolTitle,
28+
rolesRequired: [
29+
UserRole.administrator,
30+
UserRole.projectManager,
31+
],
32+
route: rootRoute,
33+
},
34+
]

src/apps/copilots/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { copilotsRoutes } from './copilots.routes'
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { UserSkill } from '~/libs/core'
2+
3+
import { ProjectType } from '../constants'
4+
5+
export interface CopilotRequest {
6+
projectId: string,
7+
projectType: ProjectType,
8+
complexity: 'high' | 'medium' | 'low',
9+
copilotUsername: string,
10+
numHoursPerWeek: number,
11+
numWeeks: number,
12+
overview: string,
13+
paymentType: string,
14+
requiresCommunicatn: 'yes' | 'no',
15+
skills: UserSkill[],
16+
startDate: Date,
17+
tzRestrictions: 'yes' | 'no',
18+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface Project{
2+
id: string,
3+
name: string,
4+
}

0 commit comments

Comments
 (0)