Skip to content

Commit

Permalink
Merge branch 'dev' into 6198-ajout-des-tests-ui-pour-le-simu-primes-p…
Browse files Browse the repository at this point in the history
…recarites
  • Loading branch information
victor committed Oct 15, 2024
2 parents 337acce + d841f65 commit 1ceee30
Show file tree
Hide file tree
Showing 457 changed files with 20,148 additions and 13,700 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
10 changes: 10 additions & 0 deletions .kontinuous/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ app:
imagePackage: app
imageProject: cdtn
probesPath: /api/health
livenessProbe:
failureThreshold: 15
httpGet:
path: /api/health/
port: http
scheme: HTTP
initialDelaySeconds: 30 # Délai avant la première vérification après le démarrage du pod
periodSeconds: 10 # Fréquence des vérifications
successThreshold: 1
timeoutSeconds: 10 # Temps maximum pour que l'endpoint réponde
containerSecurityContext:
readOnlyRootFilesystem: true
envFrom:
Expand Down
9 changes: 0 additions & 9 deletions .prettierignore

This file was deleted.

24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.156.1](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.156.0...v4.156.1) (2024-10-14)

### Bug Fixes

- **indemnité de licenciement:** ajout de l'avenant pour la CC 275 ([#6174](https://github.com/SocialGouv/code-du-travail-numerique/issues/6174)) ([bf843e5](https://github.com/SocialGouv/code-du-travail-numerique/commit/bf843e54f6778bb7be2d937a412b578e02667997))
- preavis demission ref manquante 3239 ([#6168](https://github.com/SocialGouv/code-du-travail-numerique/issues/6168)) ([1a85a22](https://github.com/SocialGouv/code-du-travail-numerique/commit/1a85a2279a74bd8d05d93865433da07d03e8aabc))

# [4.156.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.155.2...v4.156.0) (2024-10-10)

### Bug Fixes

- **bouton questionnaire:** ne pas ouvrir avec l'animation si on est en mobile ([#6200](https://github.com/SocialGouv/code-du-travail-numerique/issues/6200)) ([c284244](https://github.com/SocialGouv/code-du-travail-numerique/commit/c2842445d5ed2804617dd02ec219fceba1b842d3))
- **deps:** update dependency next to v14.2.11 [security] ([9d8bcb7](https://github.com/SocialGouv/code-du-travail-numerique/commit/9d8bcb7d7306afede239256cb56710f8551794b8))
- **error logs:** retrait du log dans sentry des erreurs d'accès au localStorage ([#6181](https://github.com/SocialGouv/code-du-travail-numerique/issues/6181)) ([8e20206](https://github.com/SocialGouv/code-du-travail-numerique/commit/8e20206358baca515c75727f3a4af6ab487d4e52))
- **idcc:** ajout des redirections pour les CC qui ont été supprimé ([#6187](https://github.com/SocialGouv/code-du-travail-numerique/issues/6187)) ([2a1752a](https://github.com/SocialGouv/code-du-travail-numerique/commit/2a1752acc9bd6f5eb0c7c3c4bb859ce7e7589070))
- **idcc:** ne pas afficher le lien vers la CC si pas de slug ([#6193](https://github.com/SocialGouv/code-du-travail-numerique/issues/6193)) ([221338c](https://github.com/SocialGouv/code-du-travail-numerique/commit/221338c9670e69538e93ec2c2f15e16e1a9539bb))
- **indemnité de licenciement:** simplification de la CC 275 ([#6173](https://github.com/SocialGouv/code-du-travail-numerique/issues/6173)) ([10cc1bd](https://github.com/SocialGouv/code-du-travail-numerique/commit/10cc1bd0e156243dd33da88c7915e89a0637c63e))
- liveness probe ([#6184](https://github.com/SocialGouv/code-du-travail-numerique/issues/6184)) ([0237f23](https://github.com/SocialGouv/code-du-travail-numerique/commit/0237f23fbe412288a6c8e07073a6561002b55fdb))
- **trouver sa cc:** update url canonique ([#6175](https://github.com/SocialGouv/code-du-travail-numerique/issues/6175)) ([eb77564](https://github.com/SocialGouv/code-du-travail-numerique/commit/eb77564180242664082a9e3bc6f374e6de53d7f7))

### Features

- **modèles de documents:** track des utilisateurs qui type CTRL + C sur la page ([#6186](https://github.com/SocialGouv/code-du-travail-numerique/issues/6186)) ([da37349](https://github.com/SocialGouv/code-du-travail-numerique/commit/da37349065200e3c5da9c2d0ab03b9ee3e83c4de))

## [4.155.2](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.155.1...v4.155.2) (2024-09-25)

### Bug Fixes
Expand Down
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
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
},
"npmClient": "yarn",
"useWorkspaces": true,
"version": "4.155.2"
"version": "4.156.1"
}
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
};
19 changes: 19 additions & 0 deletions packages/code-du-travail-frontend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.156.1](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.156.0...v4.156.1) (2024-10-14)

**Note:** Version bump only for package @cdt/frontend

# [4.156.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.155.2...v4.156.0) (2024-10-10)

### Bug Fixes

- **bouton questionnaire:** ne pas ouvrir avec l'animation si on est en mobile ([#6200](https://github.com/SocialGouv/code-du-travail-numerique/issues/6200)) ([c284244](https://github.com/SocialGouv/code-du-travail-numerique/commit/c2842445d5ed2804617dd02ec219fceba1b842d3))
- **deps:** update dependency next to v14.2.11 [security] ([9d8bcb7](https://github.com/SocialGouv/code-du-travail-numerique/commit/9d8bcb7d7306afede239256cb56710f8551794b8))
- **error logs:** retrait du log dans sentry des erreurs d'accès au localStorage ([#6181](https://github.com/SocialGouv/code-du-travail-numerique/issues/6181)) ([8e20206](https://github.com/SocialGouv/code-du-travail-numerique/commit/8e20206358baca515c75727f3a4af6ab487d4e52))
- **idcc:** ajout des redirections pour les CC qui ont été supprimé ([#6187](https://github.com/SocialGouv/code-du-travail-numerique/issues/6187)) ([2a1752a](https://github.com/SocialGouv/code-du-travail-numerique/commit/2a1752acc9bd6f5eb0c7c3c4bb859ce7e7589070))
- **idcc:** ne pas afficher le lien vers la CC si pas de slug ([#6193](https://github.com/SocialGouv/code-du-travail-numerique/issues/6193)) ([221338c](https://github.com/SocialGouv/code-du-travail-numerique/commit/221338c9670e69538e93ec2c2f15e16e1a9539bb))
- **trouver sa cc:** update url canonique ([#6175](https://github.com/SocialGouv/code-du-travail-numerique/issues/6175)) ([eb77564](https://github.com/SocialGouv/code-du-travail-numerique/commit/eb77564180242664082a9e3bc6f374e6de53d7f7))

### Features

- **modèles de documents:** track des utilisateurs qui type CTRL + C sur la page ([#6186](https://github.com/SocialGouv/code-du-travail-numerique/issues/6186)) ([da37349](https://github.com/SocialGouv/code-du-travail-numerique/commit/da37349065200e3c5da9c2d0ab03b9ee3e83c4de))

## [4.155.2](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.155.1...v4.155.2) (2024-09-25)

### Bug Fixes
Expand Down
Loading

0 comments on commit 1ceee30

Please sign in to comment.