-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #66 Adds Annex gallery. Closes #66 - Adds Annex gallery. - Polishes annexes a bit using the gallery - Refactors lists related verticals to avoid duplicate code
- Loading branch information
Showing
2,457 changed files
with
9,521 additions
and
6,925 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
File renamed without changes.
57 changes: 57 additions & 0 deletions
57
apps/next-app/pages/articles/blog/007-annex-search.page.mdx
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,57 @@ | ||
import { Link } from "@mui/joy"; | ||
import { AnnexSearch } from "@chair-flight/react/containers"; | ||
import { BlogPageLayout } from "./_blog-page.layout"; | ||
|
||
export const meta = { | ||
title: "Introducing Annex Search", | ||
linkTitle: "Introducing Annex Search", | ||
file: "007-annex-search", | ||
description: [ | ||
"Annexes are a center piece in all EASA exams. Finding them however, is not ", | ||
"always easy. We are introducing annex search to Chair flight as an alternative ", | ||
"way for you to find questions based on what annexes they included. ", | ||
].join(""), | ||
tags: ["Feature"], | ||
author: "PupoSDC", | ||
isoDate: "2024-01-23T20:00:00.000Z", | ||
}; | ||
|
||
# Introducing Annex Search | ||
|
||
Annexes are a center piece in all EASA exams. Finding them however, is not | ||
always easy. We are introducing annex search to Chair flight as an alternative | ||
way for you to find questions based on what annexes they included. | ||
|
||
<br /> | ||
|
||
<AnnexSearch | ||
noSsr | ||
questionBank="atpl" | ||
forceMode="mobile" | ||
sx={{ height: 500 }} | ||
/> | ||
|
||
<br /> | ||
|
||
Unfortuantely, to make this work we had to change how we managed annexes | ||
internally which will result in all your previously started and finished tests | ||
no longer being available. Chair-flight is still in relatively early development, | ||
and altough we prefer to avoid such breaking changes, they will sometimes are | ||
necessary. | ||
|
||
<br /> | ||
|
||
<Link | ||
href="/modules/atpl/annexes" | ||
display="block" | ||
color="primary" | ||
children="Search ATPL Annexes" | ||
/> | ||
|
||
<br /> | ||
|
||
**See you in the skies!** | ||
|
||
export default ({ children }) => ( | ||
<BlogPageLayout meta={meta}>{children}</BlogPageLayout> | ||
); |
46 changes: 46 additions & 0 deletions
46
apps/next-app/pages/modules/[questionBank]/annexes/index.page.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,46 @@ | ||
import * as fs from "node:fs/promises"; | ||
import { AppHead } from "@chair-flight/react/components"; | ||
import { LayoutModule, AnnexSearch } from "@chair-flight/react/containers"; | ||
import { staticHandler } from "@chair-flight/trpc/server"; | ||
import type { QuestionBankName } from "@chair-flight/base/types"; | ||
import type { Breadcrumbs } from "@chair-flight/react/containers"; | ||
import type { GetStaticPaths, NextPage } from "next"; | ||
|
||
type PageProps = { | ||
questionBank: QuestionBankName; | ||
}; | ||
|
||
type PageParams = { | ||
questionBank: QuestionBankName; | ||
}; | ||
|
||
const Page: NextPage<PageProps> = ({ questionBank }) => { | ||
const crumbs = [ | ||
[questionBank.toUpperCase(), `/modules/${questionBank}`], | ||
"Annexes", | ||
] as Breadcrumbs; | ||
|
||
return ( | ||
<LayoutModule fixedHeight questionBank={questionBank} breadcrumbs={crumbs}> | ||
<AppHead /> | ||
<AnnexSearch questionBank={questionBank} sx={{ height: "100%" }} /> | ||
</LayoutModule> | ||
); | ||
}; | ||
|
||
export const getStaticProps = staticHandler<PageProps, PageParams>( | ||
async ({ params, helper }) => { | ||
await LayoutModule.getData({ helper, params }); | ||
await AnnexSearch.getData({ helper, params }); | ||
return { props: params }; | ||
}, | ||
fs, | ||
); | ||
|
||
export const getStaticPaths: GetStaticPaths<PageParams> = async () => { | ||
const banks: QuestionBankName[] = ["type", "atpl"]; | ||
const paths = banks.map((questionBank) => ({ params: { questionBank } })); | ||
return { fallback: false, paths }; | ||
}; | ||
|
||
export default Page; |
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
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,23 @@ | ||
import type { | ||
LearningObjectiveId, | ||
AnnexId, | ||
QuestionId, | ||
QuestionVariantId, | ||
SubjectId, | ||
} from "./ids"; | ||
|
||
export type QuestionBankAnnexes = { | ||
id: AnnexId; | ||
format: string; | ||
href: string; | ||
description: string; | ||
questions: QuestionId[]; | ||
subjects: SubjectId[]; | ||
variants: QuestionVariantId[]; | ||
learningObjectives: LearningObjectiveId[]; | ||
}; | ||
|
||
export type QuestionBankAnnexesJson = Pick< | ||
QuestionBankAnnexes, | ||
"id" | "description" | "format" | ||
>; |
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
{ | ||
"extends": ["../../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"] | ||
} |
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,22 @@ | ||
{ | ||
"name": "base-utils", | ||
"$schema": "../../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "libs/base/utils/src", | ||
"projectType": "library", | ||
"targets": { | ||
"lint": { | ||
"executor": "@nx/linter:eslint", | ||
"outputs": ["{options.outputFile}"], | ||
"options": { | ||
"lintFilePatterns": ["libs/base/utils/**/*.ts"] | ||
} | ||
}, | ||
"typecheck": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"commands": ["tsc -p libs/base/utils/tsconfig.json"] | ||
} | ||
} | ||
}, | ||
"tags": [] | ||
} |
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,12 @@ | ||
export const makeMap = <T>( | ||
array: T[], | ||
getId: (t: T) => string, | ||
): Record<string, T> => { | ||
return array.reduce( | ||
(sum, v) => { | ||
sum[getId(v)] = v; | ||
return sum; | ||
}, | ||
{} as Record<string, T>, | ||
); | ||
}; |
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,4 @@ | ||
{ | ||
"extends": "../../../tsconfig.base.json", | ||
"include": ["src/**/*.ts"], | ||
} |
Oops, something went wrong.
6c9a332
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
chair-flight – ./
chair-flight-git-main-chair-flight-team.vercel.app
chair-flight.vercel.app
chair-flight-chair-flight-team.vercel.app
www.chair-flight.com
chair-flight.com