Skip to content

Commit 21d00a6

Browse files
committed
[DEMANDE DEVENIR AIDANT] Affiche l'encart de confirmation que la demande à bien été créée
1 parent 6e6a9f6 commit 21d00a6

File tree

8 files changed

+99
-23
lines changed

8 files changed

+99
-23
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const LienMailtoMAC = () => {
2+
return (
3+
<a href="mailto:[email protected]" target="_blank" rel="noreferrer">
4+
5+
</a>
6+
);
7+
};

mon-aide-cyber-ui/src/composants/gestion-demandes/etre-aide/Confirmation.tsx

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { LienMailtoMAC } from '../../atomes/LienMailtoMAC.tsx';
2+
13
type ProprietesConfirmation = {
24
onClick: () => void;
35
};
@@ -17,13 +19,7 @@ export const Confirmation = (proprietes: ProprietesConfirmation) => {
1719
</p>
1820
<p>
1921
Pensez à vérifier dans vos spams ou contactez-nous à{' '}
20-
<a
21-
href="mailto:[email protected]"
22-
target="_blank"
23-
rel="noreferrer"
24-
>
25-
26-
</a>
22+
<LienMailtoMAC />
2723
</p>
2824
</div>
2925
<button

mon-aide-cyber-ui/src/domaine/gestion-demandes/devenir-aidant/formulaire-devenir-aidant/CapteurFormulaireDevenirAidant.tsx

+4-9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { TypographieH4 } from '../../../../composants/communs/typographie/Typogr
1515
import { TypographieH5 } from '../../../../composants/communs/typographie/TypographieH5/TypographieH5.tsx';
1616
import Button from '../../../../composants/atomes/Button/Button.tsx';
1717
import { useState } from 'react';
18+
import { LienMailtoMAC } from '../../../../composants/atomes/LienMailtoMAC.tsx';
1819

1920
export const CapteurFormulaireDevenirAidant = () => {
2021
const navigationMAC = useNavigationMAC();
@@ -91,18 +92,12 @@ export const CapteurFormulaireDevenirAidant = () => {
9192
<br />
9293
<br />
9394
Pensez à vérifier dans vos spams ou contactez-nous à&nbsp;
94-
<a
95-
href="mailto:[email protected]"
96-
target="_blank"
97-
rel="noreferrer"
98-
>
99-
100-
</a>
95+
<LienMailtoMAC />
10196
</p>
10297
<a href="/">
103-
<button className="fr-btn bouton-mac bouton-mac-primaire">
98+
<Button type="button" variant="primary">
10499
Retour à la page d&apos;accueil
105-
</button>
100+
</Button>
106101
</a>
107102
</div>
108103
</div>

mon-aide-cyber-ui/src/domaine/gestion-demandes/parcours-aidant/EcranDemandeDevenirAidant.tsx

+36-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React, { useCallback, useReducer, useState } from 'react';
33
import {
44
choixTypeAidantFait,
55
choixUtilisationFaite,
6+
demandeDevenirAidantCreee,
67
Etape,
78
initialiseReducteur,
89
reducteurEtapes,
@@ -32,6 +33,8 @@ import { FormulaireDevenirAidant } from '../devenir-aidant/formulaire-devenir-ai
3233
import { TypographieH5 } from '../../../composants/communs/typographie/TypographieH5/TypographieH5.tsx';
3334
import { Toast } from '../../../composants/communs/Toasts/Toast.tsx';
3435
import Button from '../../../composants/atomes/Button/Button.tsx';
36+
import { TypographieH4 } from '../../../composants/communs/typographie/TypographieH4/TypographieH4.tsx';
37+
import { LienMailtoMAC } from '../../../composants/atomes/LienMailtoMAC.tsx';
3538

3639
export const EcranDemandeDevenirAidant = () => {
3740
const navigationMAC = useNavigationMAC();
@@ -84,8 +87,6 @@ export const EcranDemandeDevenirAidant = () => {
8487
'Une erreur est survenue lors de la demande devenir aidant'
8588
);
8689

87-
console.log({ corpsMutation });
88-
return Promise.resolve();
8990
return macAPI.execute<void, void, CorpsDemandeDevenirAidant>(
9091
constructeurParametresAPI<CorpsDemandeDevenirAidant>()
9192
.url(actionSoumettre.url)
@@ -96,7 +97,8 @@ export const EcranDemandeDevenirAidant = () => {
9697
);
9798
},
9899
onSuccess: () => {
99-
// navigate('#formulaire-formation');
100+
envoie(demandeDevenirAidantCreee());
101+
window.scrollTo({ top: 0 });
100102
},
101103
});
102104

@@ -233,6 +235,37 @@ export const EcranDemandeDevenirAidant = () => {
233235
</FormulaireDevenirAidant>
234236
</div>,
235237
],
238+
[
239+
'confirmationDemandeDevenirAidantPriseEnCompte',
240+
<div
241+
id="confirmationDemandeDevenirAidantPriseEnCompte"
242+
className="fr-container fr-grid-row fr-grid-row--center zone-confirmation-formulaire-devenir-aidant"
243+
>
244+
<div className="fr-col-md-8 fr-col-sm-12 section confirmation">
245+
<TypographieH4>
246+
Votre demande a bien été prise en compte !
247+
</TypographieH4>
248+
<p>
249+
Celle-ci sera traitée dans les meilleurs délais.
250+
<br />
251+
<br />
252+
Celle-ci sera traitée dans les meilleurs délais. Vous allez être mis
253+
en relation avec la délégation régionale de l’ANSSI de votre
254+
territoire, qui reviendra vers vous par mail pour vous indiquer les
255+
prochaines dates des ateliers Devenir Aidant MonAideCyber.
256+
<br />
257+
<br />
258+
Pensez à vérifier dans vos spams ou contactez-nous à&nbsp;
259+
<LienMailtoMAC />
260+
</p>
261+
<a href="/">
262+
<Button type="button" variant="primary">
263+
Retour à la page d&apos;accueil
264+
</Button>
265+
</a>
266+
</div>
267+
</div>,
268+
],
236269
]);
237270

238271
return (

mon-aide-cyber-ui/src/domaine/gestion-demandes/parcours-aidant/choix-type-aidant/ChoixTypeAidant.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Entreprise } from '../Entreprise';
66
import { SelecteurTypeAidant } from './SelecteurTypeAidant.tsx';
77
import { RechercheEntreprise } from './RechercheEntreprise.tsx';
88
import { TypographieH5 } from '../../../../composants/communs/typographie/TypographieH5/TypographieH5.tsx';
9+
import { LienMailtoMAC } from '../../../../composants/atomes/LienMailtoMAC.tsx';
910

1011
export const ChoixTypeAidant = ({
1112
surClick,
@@ -96,13 +97,13 @@ export const ChoixTypeAidant = ({
9697
surChoix={() => setChoix('FuturAdherent')}
9798
coche={choix === 'FuturAdherent'}
9899
contenuZoneDepliee={
99-
<>
100+
<p>
100101
Vous pouvez consulter une liste d’associations dont font
101102
partie certains de nos Aidants cyber : <br />
102103
monaide.cyber.gouv.fr/associations-partenaires. <br />
103104
Vous pouvez aussi proposer un partenariat en contactant
104-
l’équipe via [email protected]
105-
</>
105+
l’équipe via <LienMailtoMAC />
106+
</p>
106107
}
107108
/>
108109
</div>

mon-aide-cyber-ui/src/domaine/gestion-demandes/parcours-aidant/ecran-demande-devenir-aidant.scss

+4
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@
181181
grid-area: entete;
182182
}
183183

184+
.zone-confirmation-formulaire-devenir-aidant {
185+
grid-area: entete;
186+
}
187+
184188
.separation-formulaire {
185189
border-top: none;
186190
margin: 32px 0;

mon-aide-cyber-ui/src/domaine/gestion-demandes/parcours-aidant/reducteurEtapes.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ export type Etape =
1717
| 'choixTypeAidant'
1818
| 'signatureCharteAidant'
1919
| 'signatureCGUs'
20-
| 'formulaireDevenirAidant';
20+
| 'formulaireDevenirAidant'
21+
| 'confirmationDemandeDevenirAidantPriseEnCompte';
2122

2223
type DemandeDevenirAidant = {
2324
type: TypeAidantEtSonEntite;
@@ -34,6 +35,7 @@ enum TypeActionEtapesDemande {
3435
CHOIX_UTILISATION_FAITE = 'CHOIX_UTILISATION_FAITE',
3536
CHOIX_TYPE_AIDANT_FAIT = 'CHOIX_TYPE_AIDANT_FAIT',
3637
CHARTE_AIDANT_SIGNEE = 'CHARTE_AIDANT_SIGNEE',
38+
DEMANDE_DEVENIR_AIDANT_CREEE = 'DEMANDE_DEVENIR_AIDANT_CREEE',
3739
RETOUR_ETAPE_PRECEDENTE = 'RETOUR_ETAPE_PRECEDENTE',
3840
}
3941

@@ -49,6 +51,7 @@ type ActionEtapesDemande =
4951
| {
5052
type: TypeActionEtapesDemande.CHARTE_AIDANT_SIGNEE;
5153
}
54+
| { type: TypeActionEtapesDemande.DEMANDE_DEVENIR_AIDANT_CREEE }
5255
| {
5356
type: TypeActionEtapesDemande.RETOUR_ETAPE_PRECEDENTE;
5457
};
@@ -101,6 +104,11 @@ export const reducteurEtapes = (
101104
}),
102105
etapeCourante: 'formulaireDevenirAidant',
103106
};
107+
case TypeActionEtapesDemande.DEMANDE_DEVENIR_AIDANT_CREEE:
108+
return {
109+
...etat,
110+
etapeCourante: 'confirmationDemandeDevenirAidantPriseEnCompte',
111+
};
104112
}
105113
};
106114

@@ -122,6 +130,10 @@ export const signeCharteAidant = (): ActionEtapesDemande => ({
122130
type: TypeActionEtapesDemande.CHARTE_AIDANT_SIGNEE,
123131
});
124132

133+
export const demandeDevenirAidantCreee = (): ActionEtapesDemande => ({
134+
type: TypeActionEtapesDemande.DEMANDE_DEVENIR_AIDANT_CREEE,
135+
});
136+
125137
export const retourEtapePrecedente = (): ActionEtapesDemande => ({
126138
type: TypeActionEtapesDemande.RETOUR_ETAPE_PRECEDENTE,
127139
});

mon-aide-cyber-ui/test/domaine/gestion-demandes/parcours-aidant/reducteurEtapes.spec.ts

+28
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { describe, expect } from 'vitest';
22
import {
33
choixTypeAidantFait,
44
choixUtilisationFaite,
5+
demandeDevenirAidantCreee,
56
EtatEtapesDemande,
67
initialiseReducteur,
78
reducteurEtapes,
@@ -170,4 +171,31 @@ describe('Reducteur d’étapes pour le parcours Aidant', () => {
170171
});
171172
});
172173
});
174+
175+
describe('Demande devenir Aidant créée', () => {
176+
it("Passe à l'étape suivante", () => {
177+
const etat = reducteurEtapes(
178+
{
179+
etapeCourante: 'formulaireDevenirAidant',
180+
demande: {
181+
type: {
182+
typeAidant: 'FuturAdherent',
183+
},
184+
signatureCharte: true,
185+
},
186+
},
187+
demandeDevenirAidantCreee()
188+
);
189+
190+
expect(etat).toStrictEqual<EtatEtapesDemande>({
191+
etapeCourante: 'confirmationDemandeDevenirAidantPriseEnCompte',
192+
demande: {
193+
type: {
194+
typeAidant: 'FuturAdherent',
195+
},
196+
signatureCharte: true,
197+
},
198+
});
199+
});
200+
});
173201
});

0 commit comments

Comments
 (0)