Skip to content

Commit 747fe86

Browse files
committed
Add reminder
1 parent 705715b commit 747fe86

7 files changed

Lines changed: 282 additions & 697 deletions

File tree

src/app/auth/callback/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const AuthCallbackPage = () => {
9595
<Alert
9696
severity='success'
9797
title='Connexion réussie'
98-
description={'Vous allez être redirigé vers la page d\'accueil...'}
98+
description='Veuillez patienter quelques instants...'
9999
/>
100100
)}
101101

src/app/declarants/[id]/page.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
import {notFound} from 'next/navigation'
66

77
import PreleveurMap from '@/components/declarants/preleveur-map.js'
8+
import DeclarationReminderCard from '@/components/declarations/declaration-reminder-card.js'
89
import DocumentsList from '@/components/documents/documents-list.js'
910
import ExploitationsList from '@/components/exploitations/exploitations-list.js'
1011
import SeriesExplorer from '@/components/points-prelevement/series-explorer.js'
@@ -128,6 +129,7 @@ const Page = async ({params}) => {
128129
]}
129130
/>
130131
<InfoCard declarant={declarant} />
132+
<DeclarationReminderCard declarant={declarant} />
131133
{pointsPrelevement.length > 0 && (
132134
<PreleveurMap points={pointsPrelevement} />
133135
)}

src/app/mes-declarations/page.js

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,45 @@ export const dynamic = 'force-dynamic'
1515

1616
const Dossiers = async () => {
1717
const result = await getMyDeclarationsAction()
18-
const dossiers = result?.success ? result.data.data : []
18+
const response = result?.success ? result.data : null
19+
const dossiers = response?.data ?? []
20+
const canCreateDeclaration = response?.meta?.canCreateDeclaration ?? false
1921

2022
return (
2123
<>
2224
<StartDsfrOnHydration />
2325

24-
<div
25-
className='fr-mt-4w fr-mb-4w'
26-
style={{
27-
backgroundColor: fr.colors.decisions.background.alt.blueFrance.default
28-
}}
29-
>
30-
<div className='fr-container fr-py-6w text-center'>
31-
<h2 className='fr-h3 fr-mb-2w'>
32-
Déclarez vos prélèvements d’eau
33-
</h2>
26+
{canCreateDeclaration && (
27+
<div
28+
className='fr-mt-4w fr-mb-4w'
29+
style={{
30+
backgroundColor: fr.colors.decisions.background.alt.blueFrance.default
31+
}}
32+
>
33+
<div className='fr-container fr-py-6w text-center'>
34+
<h2 className='fr-h3 fr-mb-2w'>
35+
Déclarez vos prélèvements d’eau
36+
</h2>
3437

35-
<p className='fr-text fr-mb-3w'>
36-
Déposez vos fichiers de déclaration après validation automatique.
37-
</p>
38+
<p className='fr-text fr-mb-3w'>
39+
Déposez vos fichiers de déclaration après validation automatique.
40+
</p>
3841

39-
<Button
40-
size='large'
41-
priority='primary'
42-
iconId='fr-icon-add-line'
43-
iconPosition='left'
44-
linkProps={{
45-
href: '/mes-declarations/new'
46-
}}
47-
title='Déposer une nouvelle déclaration'
48-
>
49-
Déposer une nouvelle déclaration
50-
</Button>
42+
<Button
43+
size='large'
44+
priority='primary'
45+
iconId='fr-icon-add-line'
46+
iconPosition='left'
47+
linkProps={{
48+
href: '/mes-declarations/new'
49+
}}
50+
title='Déposer une nouvelle déclaration'
51+
>
52+
Déposer une nouvelle déclaration
53+
</Button>
54+
</div>
5155
</div>
52-
</div>
56+
) }
5357

5458
<div className='fr-container fr-mt-6w fr-mb-6w'>
5559
<h2 className='fr-h4 fr-mb-1w'>
@@ -69,17 +73,17 @@ const Dossiers = async () => {
6973
</CallOut>
7074
) : (
7175
<div>
72-
{ dossiers
76+
{dossiers
7377
.filter(dossier => dossier.source)
74-
.map(((d, idx) => (
78+
.map((dossier, idx) => (
7579
<DossierCard
76-
key={d.id}
80+
key={dossier.id}
7781
background={idx % 2 === 0 ? 'primary' : 'secondary'}
7882
className='fr-mb-2w'
79-
dossier={d}
80-
url={getMyDeclarationURL(d)}
83+
dossier={dossier}
84+
url={getMyDeclarationURL(dossier)}
8185
/>
82-
))) }
86+
))}
8387
</div>
8488
)}
8589
</div>

0 commit comments

Comments
 (0)