Skip to content

Commit

Permalink
merge dev
Browse files Browse the repository at this point in the history
  • Loading branch information
carolineBda committed Feb 4, 2025
2 parents 6c44aa9 + 28f0170 commit c5e2487
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 39 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.172.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.171.1...v4.172.0) (2025-02-03)


### Bug Fixes

* **autocomplete:** réutilisation du composant autocomplete sur la home, accentuation du contraste quand on parcours les suggestions au clavier ([#6429](https://github.com/SocialGouv/code-du-travail-numerique/issues/6429)) ([e968432](https://github.com/SocialGouv/code-du-travail-numerique/commit/e968432b0c3987f24bc7edabdf61e952be085180))
* **autocomplete:** réutilisation du composant autocomplete sur la home, accentuation du contraste quand on parcours les suggestions au clavier ([#6429](https://github.com/SocialGouv/code-du-travail-numerique/issues/6429)) ([6364fc2](https://github.com/SocialGouv/code-du-travail-numerique/commit/6364fc20e3e5a6466e7ef40a7f063909c2f66bae))


### Features

* **A propos:** migration au DSFR des pages A propos et Déclaration d'accessibilité ([#6440](https://github.com/SocialGouv/code-du-travail-numerique/issues/6440)) ([aacfbb9](https://github.com/SocialGouv/code-du-travail-numerique/commit/aacfbb94a6e66e28159f3a6de7b57a04c3d31faa))
* **A propos:** migration au DSFR des pages A propos et Déclaration d'accessibilité ([#6440](https://github.com/SocialGouv/code-du-travail-numerique/issues/6440)) ([a53f878](https://github.com/SocialGouv/code-du-travail-numerique/commit/a53f878a108d7f799ed627657c76100a5f8872dc))
* **contribution:** passage au DSFR ([#6428](https://github.com/SocialGouv/code-du-travail-numerique/issues/6428)) ([423d249](https://github.com/SocialGouv/code-du-travail-numerique/commit/423d249be4abb6db04fc66fa7ba75026bae70cd4)), closes [#6096](https://github.com/SocialGouv/code-du-travail-numerique/issues/6096) [#6099](https://github.com/SocialGouv/code-du-travail-numerique/issues/6099) [#6094](https://github.com/SocialGouv/code-du-travail-numerique/issues/6094)
* **contribution:** passage au DSFR ([#6428](https://github.com/SocialGouv/code-du-travail-numerique/issues/6428)) ([04ed765](https://github.com/SocialGouv/code-du-travail-numerique/commit/04ed765428a53741ea61d123cb84e24f12942712)), closes [#6096](https://github.com/SocialGouv/code-du-travail-numerique/issues/6096) [#6099](https://github.com/SocialGouv/code-du-travail-numerique/issues/6099) [#6094](https://github.com/SocialGouv/code-du-travail-numerique/issues/6094)





## [4.171.1](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.171.0...v4.171.1) (2025-01-23)


Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
}
},
"npmClient": "yarn",
"version": "4.171.1",
"version": "4.172.0",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
17 changes: 17 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,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.172.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.171.1...v4.172.0) (2025-02-03)


### Bug Fixes

* **autocomplete:** réutilisation du composant autocomplete sur la home, accentuation du contraste quand on parcours les suggestions au clavier ([#6429](https://github.com/SocialGouv/code-du-travail-numerique/issues/6429)) ([e968432](https://github.com/SocialGouv/code-du-travail-numerique/commit/e968432b0c3987f24bc7edabdf61e952be085180))


### Features

* **A propos:** migration au DSFR des pages A propos et Déclaration d'accessibilité ([#6440](https://github.com/SocialGouv/code-du-travail-numerique/issues/6440)) ([aacfbb9](https://github.com/SocialGouv/code-du-travail-numerique/commit/aacfbb94a6e66e28159f3a6de7b57a04c3d31faa))
* **contribution:** passage au DSFR ([#6428](https://github.com/SocialGouv/code-du-travail-numerique/issues/6428)) ([423d249](https://github.com/SocialGouv/code-du-travail-numerique/commit/423d249be4abb6db04fc66fa7ba75026bae70cd4)), closes [#6096](https://github.com/SocialGouv/code-du-travail-numerique/issues/6096) [#6099](https://github.com/SocialGouv/code-du-travail-numerique/issues/6099) [#6094](https://github.com/SocialGouv/code-du-travail-numerique/issues/6094)





## [4.171.1](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.171.0...v4.171.1) (2025-01-23)


Expand Down
2 changes: 1 addition & 1 deletion packages/code-du-travail-frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cdt/frontend",
"version": "4.171.1",
"version": "4.172.0",
"description": "Code du travail frontend",
"private": true,
"homepage": "https://code-du-travail.beta.gouv.fr/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useContributionTracking } from "./tracking";
import { isAgreementSupported, isAgreementValid } from "./contributionUtils";
import { ContributionGenericContent } from "./ContributionGenericContent";
import { Contribution } from "./type";
import { useLocalStorageForAgreement } from "../common/useLocalStorage";
import { useLocalStorageForAgreementOnPageLoad } from "../common/useLocalStorage";
import { ContributionGenericAgreementSearch } from "./ContributionGenericAgreementSearch";
import { Button } from "@codegouvfr/react-dsfr/Button";
import { fr } from "@codegouvfr/react-dsfr";
Expand All @@ -20,7 +20,7 @@ export function ContributionGeneric({ contribution }: Props) {
const [displayGeneric, setDisplayGeneric] = useState(false);

const [selectedAgreement, setSelectedAgreement] =
useLocalStorageForAgreement();
useLocalStorageForAgreementOnPageLoad();
const {
emitAgreementTreatedEvent,
emitAgreementUntreatedEvent,
Expand Down Expand Up @@ -62,7 +62,7 @@ export function ContributionGeneric({ contribution }: Props) {
emitDisplayAgreementContent(getTitle());
}
}}
defaultAgreement={selectedAgreement}
selectedAgreement={selectedAgreement}
trackingActionName={getTitle()}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,23 @@ type Props = {
onAgreementSelect: (agreement?: EnterpriseAgreement) => void;
onDisplayClick: (ev: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
contribution: Contribution;
defaultAgreement?: EnterpriseAgreement;
selectedAgreement?: EnterpriseAgreement;
trackingActionName: string;
};

export function ContributionGenericAgreementSearch({
contribution,
onAgreementSelect,
onDisplayClick,
defaultAgreement,
selectedAgreement,
trackingActionName,
}: Props) {
const { slug } = contribution;

const [selectedAgreement, setSelectedAgreement] =
useState<EnterpriseAgreement>();
const [isValid, setIsValid] = useState(
defaultAgreement ? isAgreementValid(contribution, defaultAgreement) : false
);
const [isValid, setIsValid] = useState(false);
useEffect(() => {
setIsValid(
isAgreementValid(contribution, selectedAgreement ?? defaultAgreement)
);
}, [selectedAgreement, defaultAgreement]);
setIsValid(isAgreementValid(contribution, selectedAgreement));
}, [selectedAgreement]);

const selectedAgreementAlert = (agreement: EnterpriseAgreement) => {
const isSupported = isAgreementSupported(contribution, agreement);
const isUnextended = isAgreementUnextended(contribution, agreement);
Expand Down Expand Up @@ -96,23 +90,19 @@ export function ContributionGenericAgreementSearch({
</div>
<div>
<AgreementSearchForm
onAgreementSelect={(agreement) => {
onAgreementSelect(agreement);
setSelectedAgreement(
isAgreementValid(contribution, agreement) ? agreement : undefined
);
}}
onAgreementSelect={onAgreementSelect}
selectedAgreementAlert={selectedAgreementAlert}
defaultAgreement={defaultAgreement}
defaultAgreement={selectedAgreement}
trackingActionName={trackingActionName}
/>
{((contribution.isNoCDT && isValid) || !contribution.isNoCDT) && (
<Button
className={fr.cx("fr-mt-2w")}
linkProps={{
href: isValid
? `/contribution/${(selectedAgreement ?? defaultAgreement)?.num}-${slug}`
: "",
href:
isValid && selectedAgreement
? `/contribution/${selectedAgreement?.num}-${slug}`
: "",
onClick: onDisplayClick,
}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
EnterpriseAgreement,
EnterpriseAgreementSearchInput,
} from "../../enterprise";
import { AgreementRoute } from "../../../outils/common/type/WizardType";

type Props = {
onAgreementSelect: (agreement?: EnterpriseAgreement) => void;
Expand All @@ -24,9 +25,15 @@ export const AgreementSearchForm = ({
defaultAgreement,
trackingActionName,
}: Props) => {
const [mode, setMode] = useState<
"agreementSearch" | "enterpriseSearch" | "noSearch" | undefined
>(!!defaultAgreement ? "agreementSearch" : undefined);
const [selectedRoute, setSelectedRoute] = useState<
AgreementRoute | undefined
>();

useEffect(() => {
if (defaultAgreement && !selectedRoute) {
setSelectedRoute("agreement");
}
}, [defaultAgreement]);

const { emitClickP1, emitClickP2 } = useContributionTracking();

Expand All @@ -39,24 +46,24 @@ export const AgreementSearchForm = ({
label:
"Je sais quelle est ma convention collective et je la saisis.",
nativeInputProps: {
checked: mode === "agreementSearch",
onChange: () => setMode("agreementSearch"),
checked: selectedRoute === "agreement",
onChange: () => setSelectedRoute("agreement"),
},
},
{
label:
"Je cherche mon entreprise pour trouver ma convention collective.",
nativeInputProps: {
checked: mode === "enterpriseSearch",
checked: selectedRoute === "enterprise",
onChange: () => {
onAgreementSelect();
setMode("enterpriseSearch");
setSelectedRoute("enterprise");
},
},
},
]}
/>
{mode === "agreementSearch" && (
{selectedRoute === "agreement" && (
<AgreementSearchInput
onAgreementSelect={(agreement) => {
emitClickP1(trackingActionName);
Expand All @@ -67,7 +74,7 @@ export const AgreementSearchForm = ({
trackingActionName={trackingActionName}
/>
)}
{mode === "enterpriseSearch" && (
{selectedRoute === "enterprise" && (
<EnterpriseAgreementSearchInput
onAgreementSelect={(agreement) => {
emitClickP2(trackingActionName);
Expand Down
8 changes: 8 additions & 0 deletions packages/code-du-travail-modeles/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.172.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.171.1...v4.172.0) (2025-02-03)

**Note:** Version bump only for package @socialgouv/modeles-social





## [4.171.1](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.171.0...v4.171.1) (2025-01-23)

**Note:** Version bump only for package @socialgouv/modeles-social
Expand Down
2 changes: 1 addition & 1 deletion packages/code-du-travail-modeles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"version": "4.171.1",
"version": "4.172.0",
"description": "Les règles publicodes des simulateurs de code du travail numérique",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
Expand Down
8 changes: 8 additions & 0 deletions packages/code-du-travail-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.172.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.171.1...v4.172.0) (2025-02-03)

**Note:** Version bump only for package @socialgouv/cdtn-utils





## [4.171.1](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.171.0...v4.171.1) (2025-01-23)

**Note:** Version bump only for package @socialgouv/cdtn-utils
Expand Down
2 changes: 1 addition & 1 deletion packages/code-du-travail-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"version": "4.171.1",
"version": "4.172.0",
"main": "build/index.js",
"module": "build/index.js",
"types": "build/index.d.ts",
Expand Down
8 changes: 8 additions & 0 deletions packages/react-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.172.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.171.1...v4.172.0) (2025-02-03)

**Note:** Version bump only for package @socialgouv/cdtn-ui





## [4.171.1](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.171.0...v4.171.1) (2025-01-23)

**Note:** Version bump only for package @socialgouv/cdtn-ui
Expand Down
2 changes: 1 addition & 1 deletion packages/react-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"version": "4.171.1",
"version": "4.172.0",
"description": "Composants ReactJS",
"main": "lib/index.js",
"files": [
Expand Down

0 comments on commit c5e2487

Please sign in to comment.