-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding matching component (incl detailed docu) (#71)
* full-detailed readme * adding matching compoenent * readme update * adding matching to core * adding deployment for matching phase * mini fixes * adjusting to the new deployment and env settings
- Loading branch information
1 parent
5dd9102
commit 6092fd6
Showing
33 changed files
with
662 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
30 changes: 30 additions & 0 deletions
30
clients/core/src/PhaseMapping/ExternalRoutes/MatchingRoutes.tsx
This file contains 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,30 @@ | ||
import { Alert, AlertTitle, AlertDescription } from '@/components/ui/alert' | ||
import { AlertCircle } from 'lucide-react' | ||
import React from 'react' | ||
import { ExtendedRouteObject } from '@/interfaces/extended_route_object' | ||
import { ExternalRoutes } from './ExternalRoutes' | ||
|
||
export const MatchingRoutes = React.lazy(() => | ||
import('matching_component/routes') | ||
.then((module): { default: React.FC } => ({ | ||
default: () => { | ||
const routes: ExtendedRouteObject[] = module.default || [] | ||
return <ExternalRoutes routes={routes} /> | ||
}, | ||
})) | ||
.catch((): { default: React.FC } => ({ | ||
default: () => { | ||
console.warn('Failed to load matching routes') | ||
return ( | ||
<Alert variant='destructive'> | ||
<AlertCircle className='h-4 w-4' /> | ||
<AlertTitle>Error</AlertTitle> | ||
<AlertDescription> | ||
We're sorry, but we couldn't load the matching routes. Please try refreshing | ||
or contact support if the problem persists. | ||
</AlertDescription> | ||
</Alert> | ||
) | ||
}, | ||
})), | ||
) |
31 changes: 31 additions & 0 deletions
31
clients/core/src/PhaseMapping/ExternalSidebars/MatchingSidebar.tsx
This file contains 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,31 @@ | ||
import React from 'react' | ||
import { DisabledSidebarMenuItem } from '../../Sidebar/InsideSidebar/components/DisabledSidebarMenuItem' | ||
import { SidebarMenuItemProps } from '@/interfaces/sidebar' | ||
import { ExternalSidebarComponent } from './ExternalSidebar' | ||
|
||
interface MatchingSidebarProps { | ||
rootPath: string | ||
title?: string | ||
} | ||
|
||
export const MatchingSidebar = React.lazy(() => | ||
import('matching_component/sidebar') | ||
.then((module): { default: React.FC<MatchingSidebarProps> } => ({ | ||
default: ({ title, rootPath }) => { | ||
const sidebarElement: SidebarMenuItemProps = module.default || {} | ||
return ( | ||
<ExternalSidebarComponent | ||
title={title} | ||
rootPath={rootPath} | ||
sidebarElement={sidebarElement} | ||
/> | ||
) | ||
}, | ||
})) | ||
.catch((): { default: React.FC } => ({ | ||
default: () => { | ||
console.warn('Failed to load matching sidebar') | ||
return <DisabledSidebarMenuItem title={'Matching Not Available'} /> | ||
}, | ||
})), | ||
) |
This file contains 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 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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { TemplateSidebar } from './ExternalSidebars/TemplateSidebar' | ||
import { InterviewSidebar } from './ExternalSidebars/InterviewSidebar' | ||
import { ApplicationSidebar } from './ExternalSidebars/ApplicationSidebar' | ||
import { MatchingSidebar } from './ExternalSidebars/MatchingSidebar' | ||
|
||
export const PhaseSidebarMapping: { [key: string]: React.FC<{ rootPath: string; title: string }> } = | ||
{ | ||
template_component: TemplateSidebar, | ||
Application: ApplicationSidebar, | ||
Interview: InterviewSidebar, | ||
Matching: MatchingSidebar, | ||
} |
This file contains 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 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 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 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 @@ | ||
nodeLinker: node-modules |
This file contains 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,16 @@ | ||
ARG IMAGE_TAG | ||
FROM ghcr.io/ls1intum/prompt2/prompt-clients-base:${IMAGE_TAG} AS core-base | ||
Check warning on line 2 in clients/matching_component/Dockerfile GitHub Actions / build-and-push-clients / build-and-push-clients-matching / Build Docker Image for ghcr.io/ls1intum/prompt2/prompt-clients-matching-componentDefault value for global ARG results in an empty or invalid base image name
|
||
|
||
WORKDIR /app/matching_component | ||
COPY . ./ | ||
RUN yarn install | ||
|
||
RUN yarn build | ||
|
||
# Build the final image | ||
FROM nginx:stable-alpine | ||
|
||
COPY --from=core-base /app/matching_component/build /usr/share/nginx/html | ||
COPY --from=core-base /app/nginx/nginx.conf /etc/nginx/conf.d/default.conf | ||
EXPOSE 80 | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains 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,10 @@ | ||
import rootConfig from '../eslint.config.mjs' | ||
|
||
export default [ | ||
...rootConfig, | ||
{ | ||
// Optionally add any subfolder-specific rules or settings | ||
files: ['**/*.ts', '**/*.tsx'], | ||
rules: {}, | ||
}, | ||
] |
This file contains 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 { Badge } from '@/components/ui/badge' | ||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' | ||
import { Construction } from 'lucide-react' | ||
import { useLocation } from 'react-router-dom' | ||
|
||
export const OverviewPage = (): JSX.Element => { | ||
const path = useLocation().pathname | ||
|
||
return ( | ||
<Card className='w-full max-w-2xl mx-auto'> | ||
<CardHeader> | ||
<div className='flex items-center justify-between'> | ||
<div className='flex items-center space-x-2'> | ||
<Construction className='h-6 w-6 text-yellow-500' /> | ||
<CardTitle className='text-2xl'>Matching Component</CardTitle> | ||
</div> | ||
<Badge variant='secondary' className='bg-yellow-200 text-yellow-800'> | ||
In Development | ||
</Badge> | ||
</div> | ||
<CardDescription>This component is currently under development</CardDescription> | ||
</CardHeader> | ||
<CardContent> | ||
<div className='p-4 border-2 border-dashed border-gray-300 rounded-lg'> | ||
You are currently at {path} | ||
</div> | ||
</CardContent> | ||
</Card> | ||
) | ||
} | ||
|
||
export default OverviewPage |
This file contains 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,18 @@ | ||
{ | ||
"name": "matching_component", | ||
"version": "1.0.0", | ||
"main": "src/index.ts", | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "webpack serve --open --mode development", | ||
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"", | ||
"lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --fix", | ||
"build": "webpack --mode=production --env NODE_ENV=production", | ||
"check-performance": "webpack --mode=production --env NODE_ENV=production --env BUNDLE_SIZE=true" | ||
}, | ||
"devDependencies": { | ||
"webpack": "^5.91.0", | ||
"webpack-cli": "^5.1.4" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/prompt_logo.svg" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>TODO: This is a template - please change here</title> | ||
</head> | ||
<body> | ||
<div id="interview-root"></div> | ||
</body> | ||
<html></html> | ||
</html> |
Oops, something went wrong.