Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/frontend-usagers/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ export default defineNuxtConfig({
headers: {
crossOriginEmbedderPolicy: "unsafe-none",
contentSecurityPolicy: {
"img-src": ["'self'", "*.openstreetmap.org", "data:"],
"img-src": [
"'self'",
"*.openstreetmap.org",
"jedonnemonavis.numerique.gouv.fr",
"data:",
],
"script-src": [
"'self'",
"https:",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<template>
<h2 class="fr-h4">
<span
class="fr-icon-check-line fr-icon--lg fr-mr-1w icon-success"
aria-hidden="true"
></span>
Votre déclaration a bien été transmise
</h2>
<section class="fr-container fr-my-4w">
<p>Votre demande est en cours de traitement</p>

<div class="avis-box" role="region" aria-labelledby="avis-title">

Check warning on line 12 in packages/frontend-usagers/src/components/demande-sejour/ConfirmTransmission.vue

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use <section> instead of the region role to ensure accessibility across all devices.

See more on https://sonarcloud.io/project/issues?id=SocialGouv_vao&issues=AZ1DAAXjPAYx8a-QKeix&open=AZ1DAAXjPAYx8a-QKeix&pullRequest=1248
<div class="fr-grid-row fr-grid-row--gutters fr-grid-row--middle">
<div class="fr-col-12 fr-col-md-6">
<h3 id="avis-title" class="fr-h4">
Comment s’est passée votre démarche ?
</h3>

<p class="fr-text--sm">
Aidez-nous à améliorer cette démarche en donnant votre avis, cela ne
prend que 2 minutes.
</p>
</div>
<div class="fr-col-12 fr-col-md-6 fr-text--right">
<a
href="https://jedonnemonavis.numerique.gouv.fr/Demarches/4077?button=4503"
target="_blank"
Comment on lines +25 to +27
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[IMPORTANT] Hardcoded external URLs should be driven by configuration

  • Both the survey link (https://jedonnemonavis.numerique.gouv.fr/Demarches/4077?button=4503) and the image source are hardcoded.
  • If the survey ID or button ID ever changes (e.g. for a staging vs. production environment), a code change + deployment is required.
  • The image URL is also duplicated between this component and nuxt.config.ts CSP img-src, creating a maintenance coupling.

Recommended approach: expose the URL via runtimeConfig.public (already used elsewhere in this page) so it can be overridden per environment without a code change.

// nuxt.config.ts → runtimeConfig.public
jedonnemonavisUrl: "https://jedonnemonavis.numerique.gouv.fr/Demarches/4077?button=4503",
<!-- ConfirmTransmission.vue -->
<script setup lang="ts">
const config = useRuntimeConfig();
</script>
<!-- then bind :href="config.public.jedonnemonavisUrl" -->

rel="noopener noreferrer"
title="Je donne mon avis - nouvelle fenêtre"
>
<img
src="https://jedonnemonavis.numerique.gouv.fr/static/bouton-bleu-clair.svg"
alt="Je donne mon avis"
/>
Comment thread
l-scherer marked this conversation as resolved.
</a>
</div>
</div>
</div>
</section>
</template>

<script setup lang="ts"></script>

<style scoped>
.icon-success {
color: var(--text-default-success);
}
.avis-box {
background-color: var(--background-contrast-blue-france);
padding: 1rem;
margin: 1rem;
}
Comment thread
l-scherer marked this conversation as resolved.
a img {
width: 90%;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@
</div>
</div>
</div>
<DsfrModal
class="fr-icon-checkbox-circle-line fr-icon--lg"
name="modal-confirm-transmission"
:opened="isModalConfirmTransmissionOpened"
size="md"
@close="onCloseConfirmTransmissionModal"
>
<DemandeSejourConfirmTransmission />
</DsfrModal>
</div>
</DsfrTabContent>

Expand Down Expand Up @@ -241,7 +250,12 @@

<script setup>
import dayjs from "dayjs";
import { Chat, DemandeStatusBadge, fileUtils, useToaster } from "@vao/shared-ui";
import {
Chat,
DemandeStatusBadge,
fileUtils,
useToaster,
} from "@vao/shared-ui";
const getFileUploadErrorMessage = fileUtils.getFileUploadErrorMessage;

const route = useRoute();
Expand Down Expand Up @@ -475,6 +489,12 @@ const hash = computed(() => {
return sommaireOptions[0];
});

const isModalConfirmTransmissionOpened = ref(false);

async function onCloseConfirmTransmissionModal() {
isModalConfirmTransmissionOpened.value = false;
await navigateTo("/demande-sejour/liste");
}
const canModify = computed(() => {
return (
!demandeCourante.value.statut ||
Expand Down Expand Up @@ -663,12 +683,10 @@ async function updateOrCreate(data, type) {
},
});

toaster.success(
{
titleTag: "h2",
description: `Déclaration de séjour ${sejourId.value ? "sauvegardée" : "créée"}`,
}
);
toaster.success({
titleTag: "h2",
description: `Déclaration de séjour ${sejourId.value ? "sauvegardée" : "créée"}`,
});
log.d(`demande de séjour ${sejourId.value} mis à jour`);
sejourId.value = response.id;
return await nextHash();
Expand Down Expand Up @@ -735,7 +753,7 @@ async function finalize(attestation) {
});
}
log.d(`demande de séjour ${sejourId.value} transmise`);
return await navigateTo("/demande-sejour/liste");
isModalConfirmTransmissionOpened.value = true;
} catch (error) {
log.w("Finalisation de la declaration de sejour : ", { error });
const codeError = error?.data?.name;
Expand Down Expand Up @@ -782,4 +800,7 @@ onMounted(async () => {
justify-content: end;
align-items: start;
}
a img {
display: block;
}
</style>
Loading