Skip to content

Commit

Permalink
Merge pull request #849 from betagouv/842-expiration-date-display
Browse files Browse the repository at this point in the history
Displays expiration date in declaration page
  • Loading branch information
alemangui authored Aug 15, 2024
2 parents 7c5aca2 + f61a98a commit ed63717
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/serializers/declaration.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ class Meta:
"post_validation_expiration_days",
"private_notes",
"blocking_reasons",
"expiration_date",
)
read_only_fields = (
"id",
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/components/DeclarationAlert.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<template>
<DsfrAlert v-if="displayData" :type="displayData.type" :title="displayData.title">
<p v-if="displayData.body">{{ displayData.body }}</p>
<p v-if="displayData.expirationDate">
<v-icon name="ri-error-warning-line"></v-icon>
Sans retour de votre part, ce dossier expirera le {{ isoToPrettyDate(displayData.expirationDate) }}.
</p>
<DsfrButton v-if="displayData.canDownloadCertificate" icon="ri-file-text-line" class="mt-2" secondary>
<a :href="`/declarations/${declaration.id}/certificate`" target="_blank" rel="noopener noreferrer">
{{ displayData.downloadButtonText || "Télécharger l'attestation" }}
Expand All @@ -11,6 +15,7 @@

<script setup>
import { computed } from "vue"
import { isoToPrettyDate } from "@/utils/date"
const props = defineProps({ declaration: Object, role: { type: String, default: "declarant" } })
const displayData = computed(() => {
Expand Down Expand Up @@ -63,13 +68,15 @@ const declarantDisplayData = computed(() => {
return {
type: "warning",
title: "Une objection a été emise sur cette déclaration",
expirationDate: props.declaration?.expirationDate,
body: blockingReasons.value,
canDownloadCertificate: false,
}
case "OBSERVATION":
return {
type: "warning",
title: "Une observation a été emise sur cette déclaration",
expirationDate: props.declaration?.expirationDate,
body: blockingReasons.value,
canDownloadCertificate: false,
}
Expand Down

0 comments on commit ed63717

Please sign in to comment.