-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
84 changed files
with
1,716 additions
and
289 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Scan Frontend with Trivy | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- ready_for_review | ||
branches: | ||
- main | ||
- develop | ||
|
||
env: | ||
IMAGE_NAME: frontend | ||
VERSION: v1 | ||
|
||
jobs: | ||
build_docker_image: | ||
name: Build docker image | ||
timeout-minutes: 15 | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: frontend | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build docker image | ||
run: docker build . --file Dockerfile --tag $IMAGE_NAME | ||
|
||
- name: Log in to gHRC | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
||
- name: Push image | ||
run: | | ||
docker tag $IMAGE_NAME ghcr.io/tivix/cpf/$IMAGE_NAME:$VERSION | ||
docker push ghcr.io/tivix/cpf/$IMAGE_NAME:$VERSION | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@0.23.0 | ||
with: | ||
image-ref: "ghcr.io/tivix/cpf/${{ env.IMAGE_NAME }}:${{ env.VERSION }}" | ||
scanners: "vuln,secret,config" | ||
format: "sarif" | ||
output: "trivy-fe-results.sarif" | ||
severity: "CRITICAL,HIGH" | ||
|
||
- name: Upload scan result to Github Security | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: trivy-fe-results.sarif | ||
category: "image" |
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,4 +1,5 @@ | ||
# hooks start from the project root directory | ||
cd frontend | ||
|
||
yarn lint:fix | ||
yarn lint:fix && yarn format | ||
yarn compile |
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,16 @@ | ||
import { mapKeysToCamelCase } from '@app/utils'; | ||
import { API_URLS } from '.'; | ||
import { Bucket } from '@app/types/library'; | ||
|
||
async function getBucketDetails(slug: string) { | ||
const response = await fetch(`${API_URLS.library.buckets}/${slug}`); | ||
|
||
if (!response.ok) { | ||
throw new Error('Failed to fetch bucket details'); | ||
} | ||
const data = await response.json(); | ||
|
||
return mapKeysToCamelCase<Bucket>(data); | ||
} | ||
|
||
export { getBucketDetails }; |
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,45 @@ | ||
import { mapKeysToCamelCase } from '@app/utils'; | ||
import { API_URLS } from '.'; | ||
import { LadderCardInterface } from '@app/components/common/LadderCard'; | ||
import { LadderBand } from '@app/types/library'; | ||
|
||
async function getLadders() { | ||
const response = await fetch(API_URLS.library.ladders); | ||
|
||
if (!response.ok) { | ||
throw new Error('Failed to fetch ladders'); | ||
} | ||
const data = await response.json(); | ||
|
||
return mapKeysToCamelCase<LadderCardInterface[]>(data); | ||
} | ||
|
||
async function getLadderDetails(slug: string) { | ||
const response = await fetch(`${API_URLS.library.ladders}/${slug}`); | ||
|
||
if (!response.ok) { | ||
throw new Error('Failed to fetch ladder details'); | ||
} | ||
const data = await response.json(); | ||
|
||
return mapKeysToCamelCase<{ | ||
ladderName: string; | ||
bands: Record<string, LadderBand>; | ||
}>(data); | ||
} | ||
|
||
async function getLadderName(slug: string) { | ||
const response = await fetch(`${API_URLS.library.ladders}/${slug}`); | ||
|
||
if (!response.ok) { | ||
throw new Error('Failed to fetch ladder details'); | ||
} | ||
const data = await response.json(); | ||
|
||
return mapKeysToCamelCase<{ | ||
ladderName: string; | ||
bands: Record<string, LadderBand>; | ||
}>(data).ladderName; | ||
} | ||
|
||
export { getLadders, getLadderDetails, getLadderName }; |
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,11 @@ | ||
import { Typography } from '@app/components/common/Typography'; | ||
|
||
export default function Documentation() { | ||
return ( | ||
<div> | ||
<Typography className="mb-10" variant="body-l/semibold" as="h1"> | ||
Documentation | ||
</Typography> | ||
</div> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,30 +1,25 @@ | ||
import { mapKeysToCamelCase } from '@app/utils'; | ||
import { LadderCard, LadderCardInterface } from '@app/components/common/LadderCard'; | ||
import { API_URLS } from '@app/api'; | ||
|
||
async function getLadders() { | ||
const response = await fetch(API_URLS.library.ladders); | ||
|
||
if (!response.ok) { | ||
throw new Error('Failed to fetch ladders'); | ||
} | ||
const data = await response.json(); | ||
|
||
return mapKeysToCamelCase(data); | ||
} | ||
import { LadderCard } from '@app/components/common/LadderCard'; | ||
import { getLadders } from '@app/api/ladder'; | ||
import { Typography } from '@app/components/common/Typography'; | ||
|
||
export default async function LibraryPage() { | ||
const data = await getLadders(); | ||
|
||
return ( | ||
<div> | ||
<h1 className="text-lg mb-10 font-semibold leading-6 text-navy-900">CPF Library</h1> | ||
<p className="mb-6 tracking-wide text-navy-600">Select a career path to view the details.</p> | ||
<Typography className="mb-10" variant="body-l/semibold" as="h1"> | ||
CPF Library | ||
</Typography> | ||
<Typography className="mb-6 text-navy-600" variant="body-m/regular"> | ||
Select a career path to view the details. | ||
</Typography> | ||
<div className="grid grid-cols-3 gap-6"> | ||
{data.map((ladder: LadderCardInterface) => ( | ||
{data.map((ladder) => ( | ||
<LadderCard key={ladder.ladderSlug} {...ladder} /> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export const dynamic = 'force-dynamic'; |
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,11 @@ | ||
import { Typography } from '@app/components/common/Typography'; | ||
|
||
export default function MySpace() { | ||
return ( | ||
<div> | ||
<Typography className="mb-10" variant="body-l/semibold" as="h1"> | ||
My Space | ||
</Typography> | ||
</div> | ||
); | ||
} |
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,5 +1,6 @@ | ||
import { redirect } from 'next/navigation'; | ||
import { routes } from '@app/constants'; | ||
|
||
export default function Home() { | ||
return ( | ||
<div className="z-10 w-full max-w-5xl items-center justify-between font-mono text-sm lg:flex">We shall see</div> | ||
); | ||
redirect(routes.mySpace.index); | ||
} |
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,35 @@ | ||
import { Breadcrumbs } from '@app/components/modules/Breadcrumbs'; | ||
import { ProfileSettings } from '@app/components/modules/ProfileSetting'; | ||
import { routes } from '@app/constants'; | ||
|
||
// TODO: get data from api | ||
const data = { | ||
firstName: 'Jane', | ||
lastName: 'Edge', | ||
email: 'example@gmail.com', | ||
ladders: [ | ||
{ | ||
ladderName: 'Front end', | ||
technology: 'React', | ||
band: 2, | ||
}, | ||
], | ||
notifications: { | ||
slack: false, | ||
email: false, | ||
}, | ||
}; | ||
|
||
export default async function LibraryPage() { | ||
return ( | ||
<div> | ||
<Breadcrumbs | ||
breadcrumbs={[ | ||
{ label: 'People', href: routes.people.index, current: false }, | ||
{ label: 'Profile setting', href: routes.people.myProfile, current: true }, | ||
]} | ||
/> | ||
<ProfileSettings data={data} /> | ||
</div> | ||
); | ||
} |
1 change: 1 addition & 0 deletions
1
frontend/src/components/common/AccordionCard/AccordionCard.interface.ts
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,4 +1,5 @@ | ||
export interface AccordionCardProps extends React.HTMLAttributes<HTMLDivElement> { | ||
title: string; | ||
expandedByDefault?: boolean; | ||
small?: boolean; | ||
} |
Oops, something went wrong.