Skip to content
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

test #6216

Closed
Closed

test #6216

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
5d0bee3
fix: dsfr
maxgfr Aug 22, 2024
26c096b
fix: dsfr
maxgfr Aug 22, 2024
26fda93
fix: dsfr
maxgfr Aug 22, 2024
3de62c3
fix: tests
maxgfr Aug 23, 2024
519c2b8
fix: build
maxgfr Aug 23, 2024
584430c
fix: build
maxgfr Aug 23, 2024
e72900e
fix: build
maxgfr Aug 23, 2024
e7e9d9d
feat(dsfr): ajout du footer (#6079)
maxgfr Aug 27, 2024
9b5940d
fix: tests
maxgfr Aug 28, 2024
6b8bbc3
fix: tests
maxgfr Aug 29, 2024
39725b4
fix: tests
maxgfr Aug 29, 2024
fa27e26
fix: dernier titi
maxgfr Aug 29, 2024
730c547
fix: autoclick
maxgfr Aug 29, 2024
8959e95
fix: bug
maxgfr Aug 29, 2024
5e70276
feat(css): ajout de la lib `panda-css` (zero-runtime) (#6085)
maxgfr Sep 2, 2024
84fd66c
feat(dsfr): ajout de la page stats (#6090)
maxgfr Sep 2, 2024
a1bc36f
fix: tests
maxgfr Sep 2, 2024
205f24d
fix: tests
maxgfr Sep 2, 2024
9fa7db2
Update packages/code-du-travail-frontend/src/modules/mentions-legales…
carolineBda Sep 3, 2024
34ad3a4
fix(recherche): remonter les pré-qualifiés dans la recherche (#6082)
m-maillot Aug 30, 2024
811d51c
chore(release): version 4.151.1
SocialGroovyBot Aug 30, 2024
3a18228
fix(csp): remove reporting on sentry (#6092)
maxgfr Sep 3, 2024
632ad2d
fix: config
maxgfr Sep 3, 2024
dc60c8a
fix: config
maxgfr Sep 3, 2024
3c964c6
fix: config
maxgfr Sep 3, 2024
49e3218
empty
maxgfr Sep 3, 2024
66af4ac
fix: config
maxgfr Sep 3, 2024
b89df9e
empty
maxgfr Sep 3, 2024
7d74e34
Update packages/code-du-travail-frontend/src/modules/mentions-legales…
maxgfr Sep 3, 2024
50029c0
Update packages/code-du-travail-frontend/src/modules/mentions-legales…
maxgfr Sep 3, 2024
4cf46ee
fix: config
maxgfr Sep 3, 2024
4422345
Merge branch 'dev' into maxgfr/dsfr-header
maxgfr Sep 3, 2024
56bde01
chore(dsfr): mise à jour de la version DSFR
m-maillot Sep 5, 2024
0dcdb11
fix(dsfr): ignore les exceptions d'hydratation
m-maillot Sep 10, 2024
eb9af7a
Merge branch 'dev' into maxgfr/dsfr-header
m-maillot Sep 10, 2024
f7ccd02
feat(tests): ajout du module de testing (#6096)
maxgfr Sep 10, 2024
f146a58
fix(dsfr): ignore les exceptions d'hydratation
m-maillot Sep 10, 2024
1ab139e
empty
maxgfr Sep 10, 2024
b9ae448
Merge branch 'dev' into maxgfr/dsfr-header
maxgfr Sep 10, 2024
e43a732
fix: readme
maxgfr Sep 10, 2024
222395d
feat(DSFR): migration de la page article du code du travail (#6099)
carolineBda Sep 16, 2024
e1b2b85
feat: 6093 dsfr page politique de confidentialit (#6094)
Viczei Sep 16, 2024
c4033af
Merge branch 'dev' into maxgfr/dsfr-header
m-maillot Sep 16, 2024
9c7536b
feat(dsfr): ajout des liens d'évitement (#6120)
m-maillot Sep 16, 2024
75b9216
feat(dsfr): migration de la page plan du site (#6097)
m-maillot Sep 16, 2024
13ba1aa
feat(dsfr): mise à jour des snapshots
m-maillot Sep 16, 2024
aee0955
feat(dsfr): mise à jour des snapshots
m-maillot Sep 16, 2024
abecbd2
chore(dsfr): mise à jour de la lib DSFR
m-maillot Sep 17, 2024
a5c5bdc
feat(dsfr): ajout du composant "Avez-vous trouvé une réponse à votre …
maxgfr Sep 18, 2024
6709c1e
fix: tests
maxgfr Sep 18, 2024
919318a
fix: retours
maxgfr Sep 19, 2024
1f81741
fix: tests
maxgfr Sep 19, 2024
75cddcf
feat: nouvelle API pour les articles du code du travail (#6132)
m-maillot Sep 19, 2024
e830c52
fix: merge date
maxgfr Sep 20, 2024
1935bcf
fix(spec) : fix de la spec article-code-du-travail.spec.ts
carolineBda Sep 23, 2024
b250d45
fix(dsfr): ajout de la config pour supprimer le `insafe-inline` des `…
maxgfr Sep 26, 2024
3d0967c
feat(dsfr): ajout de matomo pour tracker les events (#6157)
maxgfr Sep 26, 2024
177b731
Merge branch 'dev' into maxgfr/dsfr-header
m-maillot Sep 26, 2024
f87c8ad
fix(feedback): ajout d'une logique de caractères restants (#6156)
maxgfr Sep 26, 2024
c4c92cb
feat(dsfr): ajout du nouveau logo (#6159)
carolineBda Sep 30, 2024
29ec0d6
feat(dsfr): ajout des pages d'erreurs (404 + 500) (#6146)
maxgfr Oct 3, 2024
70c41a0
feat: séparation des anciennes API et des nouvelles (#6183)
m-maillot Oct 3, 2024
16ed3e8
fix(article code du travail): retrait du tag Code du travail (#6182)
carolineBda Oct 3, 2024
7f329e0
feat(config): correction de `husky`, ajout de `prettier` pour le form…
maxgfr Oct 9, 2024
68ea2cf
Merge branch 'dev' into maxgfr/dsfr-header
maxgfr Oct 9, 2024
0ebc402
fix: branch
maxgfr Oct 9, 2024
6cefcfb
merge dev
carolineBda Oct 10, 2024
36697b3
merge dev
carolineBda Oct 10, 2024
7e4685a
fix: crash lors de la sélection d'une suggestion (#6202)
m-maillot Oct 10, 2024
3f0a3ca
merge dev
carolineBda Oct 10, 2024
11a3292
fix: crash lors de la sélection d'une suggestion (#6209)
carolineBda Oct 14, 2024
000c2cc
Merge branch 'maxgfr/dsfr-header' of https://github.com/SocialGouv/co…
carolineBda Oct 14, 2024
4e128a4
Merge branch 'dev' into maxgfr/dsfr-header
carolineBda Oct 14, 2024
1f64d85
fix(suggestion): style + move feedback into RichComponent (#6210)
carolineBda Oct 14, 2024
bb57eeb
feat(dsfr): migration de la page modèle de document
carolineBda Oct 15, 2024
017a09b
fix api calls
carolineBda Oct 15, 2024
3dbfa25
merge dev
carolineBda Oct 15, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React from "react";
import { DsfrLayout } from "../../../src/modules/layout";
import { generateDefaultMetadata } from "../../../src/modules/common/metas";
import {
fetchModel,
getTitle,
LetterModel,
} from "../../../src/modules/modeles-de-courriers";
import { notFound } from "next/navigation";
import { fetchRelatedItems } from "../../../src/modules/documents";

export async function generateMetadata({ params }) {
const { title, type, metaDescription, meta_title } = await getModel(
params.slug
);
const category = `Modèle ${type !== "fichier" ? `de ${type}` : "à télécharger"}`;

return generateDefaultMetadata({
title: `${category} : ${meta_title ?? title}`,
description: metaDescription,
path: `/modeles-de-courriers/${params.slug}`,
});
}

async function ModeleCourrier({ params }) {
const { title, ...model } = await getModel(params.slug);

const relatedItems = await fetchRelatedItems({ _id: model._id }, params.slug);

return (
<DsfrLayout>
<LetterModel
title={getTitle(params.slug, title)}
{...model}
relatedItems={relatedItems}
/>
</DsfrLayout>
);
}

const getModel = async (slug: string) => {
const model = await fetchModel({ slug });

if (!model) {
return notFound();
}
return model;
};
export default ModeleCourrier;
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {
fetchModel,
getTitle,
} from "../../../../src/modules/modeles-de-courriers";
import { notFound } from "next/navigation";
import { LetterModelContent } from "../../../../src/modules/modeles-de-courriers/components/LetterModelContent";
import { WidgetWithIframeResizer } from "../../../../src/modules/widgets/WidgetWithIframeResizer"; // import { useIframeResizer } from "../../../../src/common/hooks";

async function WidgetModel({ params }) {
const { title, ...model } = await getModel(params.id);

const titleFormatted = getTitle(params.slug, title);
return (
<WidgetWithIframeResizer title={titleFormatted}>
<LetterModelContent title={titleFormatted} {...model} />
</WidgetWithIframeResizer>
);
}

export const getModel = async (id: string) => {
const modele = await fetchModel({ _id: id });

if (!modele) {
return notFound();
}
return modele;
};

export default WidgetModel;
2 changes: 1 addition & 1 deletion packages/code-du-travail-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"format:check": "prettier --check \"**/*.{js,ts,tsx,jsx,json,md}\""
},
"dependencies": {
"@codegouvfr/react-dsfr": "^1.13.4",
"@codegouvfr/react-dsfr": "^1.13.9",
"@elastic/elasticsearch": "^8.13.1",
"@matejmazur/react-katex": "^3.1.3",
"@opentelemetry/instrumentation-generic-pool": "^0.37.0",
Expand Down

This file was deleted.

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions packages/code-du-travail-frontend/src/modeles/index.ts

This file was deleted.

129 changes: 0 additions & 129 deletions packages/code-du-travail-frontend/src/modeles/modeles.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ describe("<LetterModel />", () => {
intro={""}
relatedItems={[]}
metaDescription={""}
filesize={undefined}
filesize={10}
filename={""}
html={undefined}
meta_title={""}
type={undefined}
/>
);

Expand All @@ -50,11 +48,9 @@ describe("<LetterModel />", () => {
intro={""}
relatedItems={[]}
metaDescription={""}
filesize={undefined}
filesize={10}
filename={""}
html={undefined}
meta_title={""}
type={undefined}
/>
);
fireEvent.keyDown(container, { key: "c" });
Expand Down
Loading
Loading