-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rgaa link target title (#6367)
* feat: rgaa link target title * fix: link sur les pages générés * chore: clean * update links on fiche SP * only add title if target="_blank" * Update packages/code-du-travail-frontend/src/modules/fiche-ministere-travail/ContentParser.tsx * update link * fix: rgga pour liens de la politique confidentialite * fix: rgaa titre de l'iframe non pertinent * fix: mention légal titre lien contact * chore: fix tests * fix: link politique confidentialite * fix: link mention legal * chore: snap --------- Co-authored-by: victor <[email protected]> Co-authored-by: carolineBda <[email protected]> Co-authored-by: Caroline <[email protected]>
- Loading branch information
1 parent
9c0e5ac
commit a01a52b
Showing
28 changed files
with
92 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/code-du-travail-frontend/src/modules/common/Link.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React, { ReactNode } from "react"; | ||
import BaseLink, { LinkProps } from "next/link"; | ||
|
||
type Props = LinkProps & { | ||
children: ReactNode; | ||
title?: string; | ||
target?: string; | ||
className?: string; | ||
rel?: string; | ||
}; | ||
|
||
const Link = ({ ...props }: Props): JSX.Element => { | ||
if (props.target === "_blank" && props.children) { | ||
props.title = `${props.title || props.children.toString()} - nouvelle fenêtre`; | ||
} | ||
return <BaseLink {...props} />; | ||
}; | ||
|
||
export default Link; |
2 changes: 1 addition & 1 deletion
2
packages/code-du-travail-frontend/src/modules/common/LogoLink.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/code-du-travail-frontend/src/modules/config/DefaultLayout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/code-du-travail-frontend/src/modules/config/StartDsfrDark.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/code-du-travail-frontend/src/modules/config/StartDsfrLight.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/code-du-travail-frontend/src/modules/config/StartDsfrSystem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...-du-travail-frontend/src/modules/convention-collective/Agreements/AgreementsGlossaire.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...code-du-travail-frontend/src/modules/convention-collective/Agreements/AgreementsIntro.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...de-du-travail-frontend/src/modules/convention-collective/Agreements/AgreementsSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/code-du-travail-frontend/src/modules/error/NotFound.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...e-du-travail-frontend/src/modules/fiche-service-public/builder/components/LienExterne.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...u-travail-frontend/src/modules/fiche-service-public/builder/components/ServiceEnLigne.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...es/code-du-travail-frontend/src/modules/fiche-service-public/builder/components/Video.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,6 +118,7 @@ exports[`<OuSAdresser /> should render a ressource web component 1`] = ` | |
href="mailto:[email protected]" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
title="[email protected] - nouvelle fenêtre" | ||
> | ||
[email protected] | ||
</a> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ exports[`<MentionsLegales /> should match snapshot 1`] = ` | |
<a | ||
href="https://www.fabrique.social.gouv.fr/" | ||
target="_blank" | ||
title="fabrique des Ministères sociaux - nouvelle fenêtre" | ||
> | ||
fabrique des Ministères sociaux | ||
</a> | ||
|
@@ -90,7 +91,7 @@ exports[`<MentionsLegales /> should match snapshot 1`] = ` | |
<a | ||
href="mailto:[email protected]" | ||
title="Envoyer un mail à [email protected]" | ||
title="Merci de nous en faire part en envoyant un mail à [email protected]" | ||
> | ||
merci de nous en faire part. | ||
</a> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { fr } from "@codegouvfr/react-dsfr"; | ||
import { Container } from "../layout/Container"; | ||
import Link from "../common/Link"; | ||
|
||
export const MentionsLegales = () => ( | ||
<Container> | ||
|
@@ -11,9 +12,9 @@ export const MentionsLegales = () => ( | |
<div className={fr.cx("fr-mb-3w")}> | ||
<p className={fr.cx("fr-mb-0")}> | ||
Le site est édité par la{" "} | ||
<a target="_blank" href="https://www.fabrique.social.gouv.fr/"> | ||
<Link target="_blank" href="https://www.fabrique.social.gouv.fr/"> | ||
fabrique des Ministères sociaux | ||
</a>{" "} | ||
</Link>{" "} | ||
située : | ||
</p> | ||
<address> | ||
|
@@ -60,7 +61,7 @@ export const MentionsLegales = () => ( | |
Si vous rencontrez un défaut d’accessibilité vous empêchant d’accéder à un | ||
contenu ou une fonctionnalité du site,{" "} | ||
<a | ||
title="Envoyer un mail à [email protected]" | ||
title="Merci de nous en faire part en envoyant un mail à [email protected]" | ||
href="mailto:[email protected]" | ||
> | ||
merci de nous en faire part. | ||
|
2 changes: 1 addition & 1 deletion
2
packages/code-du-travail-frontend/src/modules/plan-du-site/SiteMap.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.