Skip to content

Commit

Permalink
feat(dsfr): ajout des premières pages et composants en DSFR (#6078)
Browse files Browse the repository at this point in the history
* fix: dsfr

* fix: dsfr

* fix: dsfr

* fix: tests

* fix: build

* fix: build

* fix: build

* feat(dsfr): ajout du footer (#6079)

* feat: add code

* fix: tests

* fix: tests

* fix: tests

* fix: tests

* fix: tests

* fix: dernier titi

* fix: autoclick

* fix: bug

* feat(css): ajout de la lib `panda-css` (zero-runtime) (#6085)

* fix: pandacss

* fix: build

* fix: build

* feat(dsfr): ajout de la page stats (#6090)

* fix: pandacss

* fix: build

* fix: build

* fix(stats): add page

* fix: stats

* fix: tests

* fix: tests

* Update packages/code-du-travail-frontend/src/modules/mentions-legales/index.tsx

Co-authored-by: Martial Maillot <[email protected]>

* fix(recherche): remonter les pré-qualifiés dans la recherche (#6082)

* chore(release): version 4.151.1

* fix(csp): remove reporting on sentry (#6092)

* fix: config

* fix: config

* fix: config

* empty

* fix: config

* empty

* Update packages/code-du-travail-frontend/src/modules/mentions-legales/index.tsx

Co-authored-by: Martial Maillot <[email protected]>

* Update packages/code-du-travail-frontend/src/modules/mentions-legales/index.tsx

Co-authored-by: Martial Maillot <[email protected]>

* fix: config

* chore(dsfr): mise à jour de la version DSFR

* fix(dsfr): ignore les exceptions d'hydratation

* feat(tests): ajout du module de testing (#6096)

* fix: tests

* fix: tests

* fix: command

* fix: merge date

* fix: tests

* fix: tests

* fix: tests

* fix: tests

* fix(dsfr): ignore les exceptions d'hydratation

* fix: readme

* feat(DSFR): migration de la page article du code du travail (#6099)

* feat: 6093 dsfr page politique de confidentialit (#6094)

* feat: implémentation page politique confidentialité dsfr

* chore: clean

* fix: iframe dark mode

* chore: refacto + e2e test

* feat: convert a to Link

* chore: review

* chore: rename test

---------

Co-authored-by: victor <[email protected]>

* feat(dsfr): ajout des liens d'évitement (#6120)

* feat(dsfr): migration de la page plan du site (#6097)

* feat(dsfr): mise à jour des snapshots

* feat(dsfr): mise à jour des snapshots

* chore(dsfr): mise à jour de la lib DSFR

* feat(dsfr): ajout du composant "Avez-vous trouvé une réponse à votre question" (#6121)

* fix: merge date

* fix: satisfaction

* fix: retours preavis

* fix: retours preavis

* fix: tests

* move feedback component to the page articleCodeDuTravail.tsx

* clean-up css

* fix: feedback

* fix: feedback

* fix: tests

* fix: tests

* feat(dsfr): création du composant "Besoin de plus d'information" (#6135)

* fix: ui

* fix: composant

---------

Co-authored-by: carolineBda <[email protected]>
Co-authored-by: Martial Maillot <[email protected]>

* fix: retours

* fix: tests

* feat: nouvelle API pour les articles du code du travail (#6132)

Co-authored-by: carolineBda <[email protected]>

* fix(spec) : fix de la spec article-code-du-travail.spec.ts

* fix(dsfr): ajout de la config pour supprimer le `insafe-inline` des `scripts` dans les `csp` (#6151)

* feat(dsfr): ajout de matomo pour tracker les events (#6157)

* fix: matomo

* fix: matomo

---------

Co-authored-by: Martial Maillot <[email protected]>

* fix(feedback): ajout d'une logique de caractères restants (#6156)

* fix: tests

* feat: limiter à 500 caractères la saisie

* feat: limiter à 500 caractères la saisie

---------

Co-authored-by: Martial Maillot <[email protected]>

* feat(dsfr): ajout du nouveau logo (#6159)

* feat(dsfr): ajout des pages d'erreurs (404 + 500) (#6146)

* fix: pages

* fix: 404

* fix: tests

* fix: tests

* fix: tests

* fix: lint

* test error

* fix errors

* Fix spec

* add button to test error page

* feat: force error 500 for testing purpose

* feat: revert errors

---------

Co-authored-by: carolineBda <[email protected]>
Co-authored-by: Martial Maillot <[email protected]>

* feat: séparation des anciennes API et des nouvelles (#6183)

* fix(article code du travail): retrait du tag Code du travail (#6182)

* feat(config): correction de `husky`, ajout de `prettier` pour le formattage et de `lint-staged` pour runner le formattage au `precommit` (#6192)

* fix: prettier

* fix: prettier

* fix: readme

* fix: readme

* fix: bug

* fix: prettier

* fix: prettier

* fix: tests

* fix: tests

* fix: prettier

* fix: prettier

* fix: branch

* merge dev

* fix: crash lors de la sélection d'une suggestion (#6202)

* fix: crash lors de la sélection d'une suggestion

* Update packages/code-du-travail-frontend/src/modules/utils/events.ts

Co-authored-by: Caroline <[email protected]>

---------

Co-authored-by: Caroline <[email protected]>

* fix: crash lors de la sélection d'une suggestion (#6209)

* fix: crash lors de la sélection d'une suggestion

* Update packages/code-du-travail-frontend/src/modules/utils/events.ts

Co-authored-by: Caroline <[email protected]>

---------

Co-authored-by: Martial Maillot <[email protected]>

* fix(suggestion): style + move feedback into RichComponent (#6210)

* fix: format

---------

Co-authored-by: Caroline <[email protected]>
Co-authored-by: Martial Maillot <[email protected]>
Co-authored-by: Social Groovy Bot <[email protected]>
Co-authored-by: Victor Zeinstra <[email protected]>
Co-authored-by: victor <[email protected]>
Co-authored-by: carolineBda <[email protected]>
  • Loading branch information
7 people authored Oct 15, 2024
1 parent 9a05003 commit d841f65
Show file tree
Hide file tree
Showing 442 changed files with 19,427 additions and 13,591 deletions.
33 changes: 32 additions & 1 deletion .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
- name: Build code
run: |
yarn build
env:
NEXT_PUBLIC_ES_INDEX_PREFIX: ${{ secrets.NEXT_PUBLIC_ES_INDEX_PREFIX }}
ELASTICSEARCH_TOKEN_API: ${{ secrets.ELASTICSEARCH_TOKEN_API }}
ELASTICSEARCH_URL: ${{ secrets.ELASTICSEARCH_URL }}
- name: Cache build
uses: actions/cache@v4
with:
Expand All @@ -43,7 +47,11 @@ jobs:
fail-fast: false
matrix:
repositories:
["@socialgouv/cdtn-ui", "@cdt/frontend", "@socialgouv/modeles-social"]
[
"@cdt/frontend",
"@socialgouv/modeles-social",
"@socialgouv/cdtn-utils",
]
steps:
- uses: actions/cache@v4
name: Restore build
Expand All @@ -54,6 +62,29 @@ jobs:
run: |
yarn workspace ${{ matrix.repositories }} lint --quiet
format:
name: Code formatter checker
runs-on: ubuntu-latest
needs: [build]
strategy:
fail-fast: false
matrix:
repositories:
[
"@cdt/frontend",
"@socialgouv/modeles-social",
"@socialgouv/cdtn-utils",
]
steps:
- uses: actions/cache@v4
name: Restore build
with:
path: ./*
key: ${{ github.sha }}
- name: Code formatter checker for ${{ matrix.repositories }}
run: |
yarn workspace ${{ matrix.repositories }} format:check
build-storybook:
name: Build Storybook
runs-on: ubuntu-latest
Expand Down
10 changes: 1 addition & 9 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lerna run \
--exclude-dependents \
--parallel 1 \
--since HEAD \
--stream \
;
yarn precommit
9 changes: 0 additions & 9 deletions .prettierignore

This file was deleted.

35 changes: 26 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,23 @@ yarn
yarn build
```

### Packages
### Testing

```sh
yarn test:frontend # To run frontend tests
TEST_MODE=heavy-and-light yarn test:e2e # To run e2e test without any UI
TEST_MODE=heavy-and-light yarn test:e2e:ui # To run e2e test with Cypress UI
# TEST_MODE can be : light, heavy, heavy-and-light or html-validation
```

## Packages

| Package | description |
| --------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [code-du-travail-frontend](./packages/code-du-travail-frontend) | Application Next.js |
| [code-du-travail-modeles](./packages/code-du-travail-modeles) | Implémentation [publicodes](https://publi.codes) des conventions collectives |
| [react-ui](./packages/react-ui) | Librairie de composant |

### Frontend
### code-du-travail-frontend

Pour lancer l'application en se basant sur l'API de pre-production :

Expand All @@ -40,13 +48,22 @@ yarn dev:frontend

Notre bibliothèque de composants UI est disponible en démo [ici](https://socialgouv.github.io/code-du-travail-numerique/).

### Testing
### code-du-travail-modeles

```sh
TEST_MODE=heavy-and-light yarn test:e2e # To run e2e test without any UI
TEST_MODE=heavy-and-light yarn test:e2e:ui # To run e2e test with Cypress UI
# TEST_MODE can be light, heavy, heavy-and-light or html-validation
```
Ce package contient les modèles [publicodes](https://publi.codes/) pour les simulateurs du code du travail numérique.

#### Organisation

Le package contient les modèles publicodes dans le dossier 'src/modeles' dans le format YAML.
Le découpage des modèles n'est pas encore finalisé.
A l'heure actuelle, on place les informations du code du travail dans le fichier `contrat-salarie.yaml`
puis les informations de chaque convention collective dans le dossier `src/modeles/conventions`
où chaque convention possède son fichier.

Une classe `MergeModele` dans le dossier `src/utils` permet de fusionner l'ensemble des fichiers YAML présent dans le dossier `modeles` pour alimenter le moteur de publicodes.

Enfin le dossier `src/__test__` contient les tests permettant de valider les règles dans le modèle YAML.
Le but étant de pouvoir fonctionner en mode TDD pour rédiger nos règles.

## License

Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"description": "Code du travail",
"homepage": "https://github.com/SocialGouv/code-du-travail-numerique#readme",
"scripts": {
"prepare": "husky",
"build": "lerna run build --scope=@socialgouv/cdtn-utils --scope=@socialgouv/cdtn-ui --scope=@socialgouv/modeles-social --scope=@cdt/frontend --stream",
"build:npm": "lerna run build --scope=@socialgouv/cdtn-utils --scope=@socialgouv/cdtn-ui --scope=@socialgouv/modeles-social --stream",
"clean": "lerna clean",
Expand Down Expand Up @@ -32,7 +33,9 @@
"test:update": "lerna run test:update --scope=@socialgouv/cdtn-ui --scope=@cdt/frontend --stream",
"test:update:frontend": "lerna run test:update --scope=@cdt/frontend --stream",
"test:update:api": "lerna run test:api:update --scope=@cdt/frontend --stream",
"prepare": "is-ci || husky install"
"format": "lerna run format --stream",
"format:check": "lerna run format:check --stream",
"precommit": "lerna run precommit --stream"
},
"repository": {
"type": "git",
Expand All @@ -42,8 +45,7 @@
"url": "https://github.com/SocialGouv/code-du-travail-numerique/issues"
},
"devDependencies": {
"husky": "^9.0.0",
"is-ci": "^3.0.0",
"husky": "^9.1.6",
"lerna": "^5.0.0"
},
"workspaces": [
Expand Down
4 changes: 4 additions & 0 deletions packages/code-du-travail-frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ cypress/screenshots
cypress/downloads
.env
.env.*

## Panda
styled-system
styled-system-studio
4 changes: 4 additions & 0 deletions packages/code-du-travail-frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
.next/
.swc/
styled-system/
10 changes: 10 additions & 0 deletions packages/code-du-travail-frontend/.prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default {
printWidth: 80, // Maximum line length (80 characters)
tabWidth: 2, // Number of spaces per indentation level
useTabs: false, // Use spaces instead of tabs
semi: true, // End statements with a semicolon
singleQuote: false, // Use double quotes in strings
trailingComma: "es5", // Add trailing commas in objects, arrays, etc., per ES5
bracketSpacing: true, // Add spaces inside object literals: { foo: bar }
arrowParens: "always", // Always include parens for arrow functions: (x) => x
};
Loading

0 comments on commit d841f65

Please sign in to comment.