Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2363 - WIP Réutiliser le même composant d'affichage de détail d'une convention #2465

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

celineung
Copy link
Contributor

@celineung celineung commented Nov 4, 2024

WIP

📔 Remarques

  • dans ConvenionImmersionPage: la props PageHeader de MainWrapper fait afficher le titre en dehors de <main> => cette correction va impacter plusieurs pages qui utilisent MainWrapper/PageHeader

@celineung celineung force-pushed the 2363-regrouper-les-pages-pilotage-dune-convention-et-vrification-dune-demande-de-convention-en-une-seule branch 4 times, most recently from 1aa1abb to 23f3e51 Compare November 13, 2024 14:15
@celineung celineung force-pushed the 2363-regrouper-les-pages-pilotage-dune-convention-et-vrification-dune-demande-de-convention-en-une-seule branch 3 times, most recently from b824997 to c6fb16e Compare November 13, 2024 22:07
@celineung celineung force-pushed the 2363-regrouper-les-pages-pilotage-dune-convention-et-vrification-dune-demande-de-convention-en-une-seule branch from c6fb16e to eb0d481 Compare November 14, 2024 17:41
label: "Email",
value: (
<a
href={`mailto:${convention.signatories.beneficiary.email}`}

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.

Copilot Autofix AI about 17 hours ago

To fix the problem, we need to ensure that the email address is properly escaped before being used in an HTML context. This can be achieved by using a library that provides HTML escaping functionality, such as he (HTML entities).

  • Import the he library to escape the email address.
  • Replace the direct usage of the email address in the href and title attributes with the escaped version.
Suggested changeset 2
front/src/app/components/admin/conventions/ConventionValidationDetails.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/front/src/app/components/admin/conventions/ConventionValidationDetails.tsx b/front/src/app/components/admin/conventions/ConventionValidationDetails.tsx
--- a/front/src/app/components/admin/conventions/ConventionValidationDetails.tsx
+++ b/front/src/app/components/admin/conventions/ConventionValidationDetails.tsx
@@ -26,2 +26,3 @@
 import type { ConventionValidationProps } from "./ConventionValidation";
+import he from 'he';
 
@@ -62,4 +63,4 @@
             <a
-              href={`mailto:${convention.signatories.beneficiary.email}`}
-              title={convention.signatories.beneficiary.email}
+              href={`mailto:${he.encode(convention.signatories.beneficiary.email)}`}
+              title={he.encode(convention.signatories.beneficiary.email)}
             >
EOF
@@ -26,2 +26,3 @@
import type { ConventionValidationProps } from "./ConventionValidation";
import he from 'he';

@@ -62,4 +63,4 @@
<a
href={`mailto:${convention.signatories.beneficiary.email}`}
title={convention.signatories.beneficiary.email}
href={`mailto:${he.encode(convention.signatories.beneficiary.email)}`}
title={he.encode(convention.signatories.beneficiary.email)}
>
front/package.json
Outside changed files

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/front/package.json b/front/package.json
--- a/front/package.json
+++ b/front/package.json
@@ -93,2 +93,5 @@
     "@emotion/styled": "^11.8.1"
+  },
+  "dependencies": {
+    "he": "^1.2.0"
   }
EOF
@@ -93,2 +93,5 @@
"@emotion/styled": "^11.8.1"
},
"dependencies": {
"he": "^1.2.0"
}
This fix introduces these dependencies
Package Version Security advisories
he (npm) 1.2.0 None
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
label: "Email",
value: (
<a
href={`mailto:${convention.signatories.establishmentRepresentative.email}`}

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.

Copilot Autofix AI about 17 hours ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

label: "Email",
value: (
<a
href={`mailto:${convention.establishmentTutor.email}`}

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.

Copilot Autofix AI about 17 hours ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regrouper les pages "Pilotage d'une convention" et "Vérification d'une demande de convention" en une seule
1 participant