Skip to content

Commit

Permalink
Merge branch 'dev' into maxgfr/rupture-co-dsfr
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgfr committed Jan 7, 2025
2 parents 6f7ca63 + 645aa6d commit 0a1c4a3
Show file tree
Hide file tree
Showing 25 changed files with 775 additions and 617 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ concurrency:
cancel-in-progress: true
group: pre-release-${{ github.ref }}

permissions:
id-token: write # Required for OIDC token generation

jobs:
release:
name: Pre-release
runs-on: ubuntu-latest
steps:
- name: Get GitHub App Token
id: token
uses: SocialGouv/token-bureau@main
with:
token-bureau-url: https://token-bureau.fabrique.social.gouv.fr
audience: socialgouv
- name: Checkout repository
uses: actions/checkout@v4
with:
Expand All @@ -26,6 +35,6 @@ jobs:
git rebase dev
git push
env:
GITHUB_TOKEN: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
NAME: ${{ secrets.SOCIALGROOVYBOT_NAME }}
EMAIL: ${{ secrets.SOCIALGROOVYBOT_EMAIL }}
15 changes: 12 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ concurrency:
cancel-in-progress: true
group: release-${{ github.ref }}

permissions:
id-token: write # Required for OIDC token generation

jobs:
release:
if: github.ref == 'refs/heads/master'
name: Release
runs-on: ubuntu-latest
steps:
- name: Get GitHub App Token
id: token
uses: SocialGouv/token-bureau@main
with:
token-bureau-url: https://token-bureau.fabrique.social.gouv.fr
audience: socialgouv
- name: Checkout repository
uses: actions/checkout@v4
with:
Expand All @@ -30,15 +39,15 @@ jobs:
git config --global user.email "${EMAIL}"
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
env:
GITHUB_TOKEN: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
NAME: ${{ secrets.SOCIALGROOVYBOT_NAME }}
EMAIL: ${{ secrets.SOCIALGROOVYBOT_EMAIL }}
- name: Build for npm
run: yarn build:npm
- name: Versionning code
run: GH_TOKEN=${GITHUB_TOKEN} yarn lerna version --force-publish --yes --conventional-commits --create-release github
env:
GITHUB_TOKEN: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
- name: Rebase master to dev
run: |
git config --global user.name "${NAME}"
Expand All @@ -49,7 +58,7 @@ jobs:
git rebase master
git push
env:
GITHUB_TOKEN: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }}
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
NAME: ${{ secrets.SOCIALGROOVYBOT_NAME }}
EMAIL: ${{ secrets.SOCIALGROOVYBOT_EMAIL }}
- name: Setup token
Expand Down
20 changes: 20 additions & 0 deletions packages/code-du-travail-frontend/redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -478,5 +478,25 @@
"source": "/convention-collective/(0135|135(?:-[a-z0-9-]+)?)",
"destination": "/convention-collective/3249-industries-carrieres-et-materiaux-de-construction",
"permanent": true
},
{
"source": "/convention-collective/7008(-[a-z0-9-]+)?",
"destination": "/convention-collective/7027-conseil-et-service-en-elevage",
"permanent": true
},
{
"source": "/convention-collective/7021(-[a-z0-9-]+)?",
"destination": "/convention-collective/7027-conseil-et-service-en-elevage",
"permanent": true
},
{
"source": "/convention-collective/1278(-[a-z0-9-]+)?",
"destination": "/convention-collective/2336-organismes-gestionnaires-de-foyers-et-services-pour-jeunes-travailleurs",
"permanent": true
},
{
"source": "/convention-collective/1921(-[a-z0-9-]+)?",
"destination": "/convention-collective/3250-commissaires-de-justice-et-societes-de-ventes-volontaires",
"permanent": true
}
]
4 changes: 3 additions & 1 deletion packages/code-du-travail-frontend/src/api/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ export const IDCC_MERGE = {
1875: [2564],
3243: [731, 1383],
3251: [1044, 567],
3250: [2785],
3250: [2785, 1921],
7520: [7509],
1000: [1850],
184: [614],
3224: [925, 802],
1558: [1800],
2264: [2104],
3249: [3227, 211, 135, 87],
7027: [7008, 7021],
2336: [1278],
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { fr } from "@codegouvfr/react-dsfr";
import { Container } from "../layout/Container";
import { useEffect, useState } from "react";
import { useNeedMoreInfoEvents } from "../layout/infos/tracking";
import { useNeedMoreInfoEvents } from "../layout/footer/infos/tracking";
import Image from "next/image";
import { Input } from "@codegouvfr/react-dsfr/Input";
import { Button } from "@codegouvfr/react-dsfr/Button";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"use client";

import { fr } from "@codegouvfr/react-dsfr";
import { getRouteBySource, SOURCES } from "@socialgouv/cdtn-utils";
import { useEffect, useRef } from "react";
import { ListWithArrow } from "../../common/ListWithArrow";
import Link from "../../common/Link";
import { ElasticAgreement } from "@socialgouv/cdtn-types";
Expand All @@ -11,11 +14,19 @@ type Props = {
};

export const AgreementsSection = ({ letter, agreements }: Props) => {
const letterRef = useRef<HTMLDivElement>(null);

useEffect(() => {
if (window.location.hash === `#${letter}` && letterRef.current) {
letterRef.current.focus();
}
}, [letter]);

return (
<>
<div id={letter} className={fr.cx("fr-h3")}>
<p id={letter} ref={letterRef} tabIndex={-1} className={fr.cx("fr-h3")}>
{letter}
</div>
</p>
<ListWithArrow
items={agreements.map(({ shortTitle, slug }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { fr } from "@codegouvfr/react-dsfr";
import { Card } from "@codegouvfr/react-dsfr/Card";
import { Tag } from "@codegouvfr/react-dsfr/Tag";

export type HomeCardProps = {
theme: string;
Expand All @@ -16,7 +15,7 @@ export const HomeCard = ({
link,
}: HomeCardProps) => (
<Card
start={<Tag small>{theme}</Tag>}
start={<p className={fr.cx("fr-tag", "fr-tag--sm")}>{theme}</p>}
border
desc={description}
horizontal
Expand All @@ -27,7 +26,7 @@ export const HomeCard = ({
title={title}
titleAs="h3"
enlargeLink
end={<span>Consulter</span>}
end={<p className={fr.cx("fr-m-0", "fr-text--xs")}>Consulter</p>}
classes={{
start: fr.cx("fr-mb-2w"),
end: fr.cx("fr-text--xs"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,20 @@ exports[`<Home /> should match snapshot 1`] = `
<div
class="fr-card__start fr-mb-2w"
>
<span
<p
class="fr-tag fr-tag--sm"
id="fr-tag-:r3:"
>
light
</span>
</p>
</div>
<div
class="fr-card__end fr-text--xs"
>
<span>
<p
class="fr-m-0 fr-text--xs"
>
Consulter
</span>
</p>
</div>
</div>
</div>
Expand Down Expand Up @@ -199,7 +200,7 @@ exports[`<Home /> should match snapshot 1`] = `
>
<div
class="fr-tile fr-enlarge-link fr-tile--vertical"
id="fr-tile-:r4:"
id="fr-tile-:r3:"
>
<div
class="fr-tile__body"
Expand Down Expand Up @@ -247,7 +248,7 @@ exports[`<Home /> should match snapshot 1`] = `
<a
class="fr-btn fr-btn--secondary fr-btn--lg fr-icon-arrow-right-line fr-btn--icon-right"
href="/outils"
id="fr-button-:r5:"
id="fr-button-:r4:"
>
Voir tous les outils
</a>
Expand Down Expand Up @@ -276,7 +277,7 @@ exports[`<Home /> should match snapshot 1`] = `
>
<div
class="fr-card fr-enlarge-link fr-card--horizontal"
id="fr-card-:r6:"
id="fr-card-:r5:"
>
<div
class="fr-card__body"
Expand All @@ -302,19 +303,20 @@ exports[`<Home /> should match snapshot 1`] = `
<div
class="fr-card__start fr-mb-2w"
>
<span
<p
class="fr-tag fr-tag--sm"
id="fr-tag-:r7:"
>
dark
</span>
</p>
</div>
<div
class="fr-card__end fr-text--xs"
>
<span>
<p
class="fr-m-0 fr-text--xs"
>
Consulter
</span>
</p>
</div>
</div>
</div>
Expand All @@ -327,7 +329,7 @@ exports[`<Home /> should match snapshot 1`] = `
<a
class="fr-btn fr-btn--secondary fr-btn--lg fr-icon-arrow-right-line fr-btn--icon-right"
href="/modeles-de-courriers"
id="fr-button-:r8:"
id="fr-button-:r6:"
>
Voir tous les modèles de documents
</a>
Expand Down Expand Up @@ -356,7 +358,7 @@ exports[`<Home /> should match snapshot 1`] = `
>
<div
class="fr-card fr-enlarge-link fr-card--horizontal"
id="fr-card-:r9:"
id="fr-card-:r7:"
>
<div
class="fr-card__body"
Expand All @@ -382,19 +384,20 @@ exports[`<Home /> should match snapshot 1`] = `
<div
class="fr-card__start fr-mb-2w"
>
<span
<p
class="fr-tag fr-tag--sm"
id="fr-tag-:ra:"
>
light
</span>
</p>
</div>
<div
class="fr-card__end fr-text--xs"
>
<span>
<p
class="fr-m-0 fr-text--xs"
>
Consulter
</span>
</p>
</div>
</div>
</div>
Expand All @@ -407,7 +410,7 @@ exports[`<Home /> should match snapshot 1`] = `
<a
class="fr-btn fr-btn--secondary fr-btn--lg fr-icon-arrow-right-line fr-btn--icon-right"
href="/contribution"
id="fr-button-:rb:"
id="fr-button-:r8:"
>
Voir toutes les fiches pratiques
</a>
Expand Down Expand Up @@ -437,7 +440,7 @@ exports[`<Home /> should match snapshot 1`] = `
>
<div
class="fr-card fr-enlarge-link fr-card--horizontal"
id="fr-card-:rc:"
id="fr-card-:r9:"
>
<div
class="fr-card__body"
Expand All @@ -463,19 +466,20 @@ exports[`<Home /> should match snapshot 1`] = `
<div
class="fr-card__start fr-mb-2w"
>
<span
<p
class="fr-tag fr-tag--sm"
id="fr-tag-:rd:"
>
dark
</span>
</p>
</div>
<div
class="fr-card__end fr-text--xs"
>
<span>
<p
class="fr-m-0 fr-text--xs"
>
Consulter
</span>
</p>
</div>
</div>
</div>
Expand All @@ -488,7 +492,7 @@ exports[`<Home /> should match snapshot 1`] = `
<a
class="fr-btn fr-btn--secondary fr-btn--lg fr-icon-arrow-right-line fr-btn--icon-right"
href="/convention-collective"
id="fr-button-:re:"
id="fr-button-:ra:"
>
Voir toutes les conventions collectives
</a>
Expand Down Expand Up @@ -532,7 +536,7 @@ exports[`<Home /> should match snapshot 1`] = `
>
<div
class="fr-tile fr-enlarge-link fr-tile--vertical fr-tile--no-icon fr-tile--sm"
id="fr-tile-:rf:"
id="fr-tile-:rb:"
>
<div
class="fr-tile__body"
Expand Down Expand Up @@ -581,7 +585,7 @@ exports[`<Home /> should match snapshot 1`] = `
<a
class="fr-btn fr-btn--secondary fr-btn--lg fr-icon-arrow-right-line fr-btn--icon-right"
href="/themes"
id="fr-button-:rg:"
id="fr-button-:rc:"
>
Voir tous les thèmes
</a>
Expand Down
Loading

0 comments on commit 0a1c4a3

Please sign in to comment.