diff --git a/src/components/Inputs/Button.tsx b/src/components/Inputs/Button.tsx index f5ccc38..3033c4b 100644 --- a/src/components/Inputs/Button.tsx +++ b/src/components/Inputs/Button.tsx @@ -52,7 +52,7 @@ export const Button = ({
{ - if (isDefined(href) || isDefined(locale)) { + if (!isDefined(target) && (isDefined(href) || isDefined(locale))) { router.push(href ?? router.asPath, href, { locale: locale, }); diff --git a/src/components/Markdown/Markdawn.tsx b/src/components/Markdown/Markdawn.tsx index 2b16276..ee8f483 100644 --- a/src/components/Markdown/Markdawn.tsx +++ b/src/components/Markdown/Markdawn.tsx @@ -199,8 +199,8 @@ export const Markdawn = ({ Line: { component: (compProps) => ( <> - - {compProps.name} + +

{compProps.children}

@@ -427,11 +427,17 @@ enum HeaderLevels { const preprocessMarkDawn = (text: string, playerName = ""): string => { if (!text) return ""; + const processedPlayerName = playerName + .replaceAll("_", "\\_") + .replaceAll("*", "\\*"); + let preprocessed = text .replaceAll("--", "—") .replaceAll( "@player", - isDefinedAndNotEmpty(playerName) ? playerName : "(player)" + isDefinedAndNotEmpty(processedPlayerName) + ? processedPlayerName + : "(player)" ); console.log(); diff --git a/src/components/PreviewLine.tsx b/src/components/PreviewLine.tsx index 7e39e12..cd8b3fb 100644 --- a/src/components/PreviewLine.tsx +++ b/src/components/PreviewLine.tsx @@ -39,7 +39,7 @@ export const PreviewLine = ({ > {thumbnail ? (
- +
) : (
diff --git a/src/graphql/operations/devGetContents.graphql b/src/graphql/operations/devGetContents.graphql index 030ab45..33070b0 100644 --- a/src/graphql/operations/devGetContents.graphql +++ b/src/graphql/operations/devGetContents.graphql @@ -24,6 +24,9 @@ query devGetContents { language { data { id + attributes { + code + } } } title @@ -32,6 +35,9 @@ query devGetContents { source_language { data { id + attributes { + code + } } } status diff --git a/src/helpers/types/Report.ts b/src/helpers/types/Report.ts new file mode 100644 index 0000000..07a5816 --- /dev/null +++ b/src/helpers/types/Report.ts @@ -0,0 +1,23 @@ +export type Report = { + title: string; + lines: ReportLine[]; +}; + +export type ReportLine = { + subitems: string[]; + name: string; + type: "Error" | "Improvement" | "Missing"; + severity: Severity; + description: string; + recommandation: string; + backendUrl: string; + frontendUrl: string; +}; + +export enum Severity { + VeryLow = 0, + Low = 1, + Medium = 2, + High = 3, + VeryHigh = 4, +} diff --git a/src/pages/contents/index.tsx b/src/pages/contents/index.tsx index a2d616e..1d7d149 100644 --- a/src/pages/contents/index.tsx +++ b/src/pages/contents/index.tsx @@ -271,7 +271,7 @@ const Contents = ({ keepInfoVisible={keepInfoVisible} /> )} - className="grid-cols-2 items-end desktop:grid-cols-[repeat(auto-fill,_minmax(15rem,1fr))]" + className="grid-cols-2 desktop:grid-cols-[repeat(auto-fill,_minmax(15rem,1fr))]" groupingFunction={groupingFunction} filteringFunction={filteringFunction} searchingTerm={searchName} diff --git a/src/pages/dev/checkup/contents.tsx b/src/pages/dev/checkup/contents.tsx index b9a0667..20d953d 100644 --- a/src/pages/dev/checkup/contents.tsx +++ b/src/pages/dev/checkup/contents.tsx @@ -12,6 +12,7 @@ import { DevGetContentsQuery } from "graphql/generated"; import { AppStaticProps, getAppStaticProps } from "graphql/getAppStaticProps"; import { getReadySdk } from "graphql/sdk"; import { filterDefined, filterHasAttributes } from "helpers/others"; +import { Report, Severity } from "helpers/types/Report"; /* * ╭────────╮ @@ -23,7 +24,7 @@ interface Props extends AppStaticProps { } const CheckupContents = ({ contents, ...otherProps }: Props): JSX.Element => { - const testReport = testingContent(contents); + const testReport = useMemo(() => testingContent(contents), [contents]); const contentPanel = useMemo( () => ( @@ -40,44 +41,47 @@ const CheckupContents = ({ contents, ...otherProps }: Props): JSX.Element => {

Description

- {testReport.lines.map((line, index) => ( -
-
- ))} + > +