Skip to content

Commit 91359f5

Browse files
author
himaniraghav3
committed
PM-579 Add copilot request UI
1 parent 165f7dc commit 91359f5

File tree

14 files changed

+563
-1
lines changed

14 files changed

+563
-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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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',
8+
}
9+
10+
export const ProjectTypes = [
11+
ProjectType.design,
12+
ProjectType.developement,
13+
ProjectType.marathonCopilot,
14+
ProjectType.marathonTester,
15+
ProjectType.sprintCopilot,
16+
ProjectType.qa,
17+
]
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.connectManager,
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: 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)