Skip to content

PM-579 Add copilot request UI #995

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

Merged
merged 5 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/apps/copilots/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Copilots app
1 change: 1 addition & 0 deletions src/apps/copilots/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src'
22 changes: 22 additions & 0 deletions src/apps/copilots/src/CopilotsApp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { FC, useContext } from 'react'
import { Outlet, Routes } from 'react-router-dom'

import { routerContext, RouterContextData } from '~/libs/core'
import { SharedSwrConfig } from '~/libs/shared'

import { toolTitle } from './copilots.routes'

const CopilotsApp: FC<{}> = () => {
const { getChildRoutes }: RouterContextData = useContext(routerContext)

return (
<SharedSwrConfig>
<Outlet />
<Routes>
{getChildRoutes(toolTitle)}
</Routes>
</SharedSwrConfig>
)
}

export default CopilotsApp
19 changes: 19 additions & 0 deletions src/apps/copilots/src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export enum ProjectType {
design = 'Design',
developement = 'Development',
marathonCopilot = 'Data Science (Marathon Copilot)',
sprintCopilot = 'Data Science (Sprint Copilot)',
marathonTester = 'Data Science (Marathon Tester)',
qa = 'QA (Quality Assurance)',
ai='AI (Artificial Intelligence)',
}

export const ProjectTypes = [
ProjectType.design,
ProjectType.developement,
ProjectType.marathonCopilot,
ProjectType.marathonTester,
ProjectType.sprintCopilot,
ProjectType.qa,
ProjectType.ai,
]
34 changes: 34 additions & 0 deletions src/apps/copilots/src/copilots.routes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { lazyLoad, LazyLoadedComponent, PlatformRoute, UserRole } from '~/libs/core'
import { AppSubdomain, EnvironmentConfig, ToolTitle } from '~/config'

const CopilotsApp: LazyLoadedComponent = lazyLoad(() => import('./CopilotsApp'))
const CopilotsRequestForm: LazyLoadedComponent = lazyLoad(() => import('./pages/copilot-request-form/index'))

export const rootRoute: string = (
EnvironmentConfig.SUBDOMAIN === AppSubdomain.copilots ? '' : `/${AppSubdomain.copilots}`
)

export const toolTitle: string = ToolTitle.copilots
export const absoluteRootRoute: string = `${window.location.origin}${rootRoute}`

export const copilotsRoutes: ReadonlyArray<PlatformRoute> = [
{
authRequired: true,
children: [
{
element: <CopilotsRequestForm />,
id: 'CopilotRequestForm',
route: '/request',
},

],
domain: AppSubdomain.copilots,
element: <CopilotsApp />,
id: toolTitle,
rolesRequired: [
UserRole.administrator,
UserRole.projectManager,
],
route: rootRoute,
},
]
1 change: 1 addition & 0 deletions src/apps/copilots/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { copilotsRoutes } from './copilots.routes'
18 changes: 18 additions & 0 deletions src/apps/copilots/src/models/CopilotRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { UserSkill } from '~/libs/core'

import { ProjectType } from '../constants'

export interface CopilotRequest {
projectId: string,
projectType: ProjectType,
complexity: 'high' | 'medium' | 'low',
copilotUsername: string,
numHoursPerWeek: number,
numWeeks: number,
overview: string,
paymentType: string,
requiresCommunicatn: 'yes' | 'no',
skills: UserSkill[],
startDate: Date,
tzRestrictions: 'yes' | 'no',
}
4 changes: 4 additions & 0 deletions src/apps/copilots/src/models/Project.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface Project{
id: string,
name: string,
}
Loading