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

improve(Statistiques territoire): Mettre un message pour l'année en cours (2024) et cacher certains chiffres #4968

Merged
Merged
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
25 changes: 20 additions & 5 deletions frontend/src/views/PublicCanteenStatisticsPage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@
Aucune cantine n'a renseigné des données relatives à la loi EGalim pour l'année {{ year }}.
</p>
</div>
<div v-else-if="year === yearLast">
<DsfrCallout class="my-6">
<p class="mb-0">
Les données {{ yearLast }} récoltées durant la campagne {{ yearLast + 1 }} seront disponibles d'ici la fin
d'année (dès lors que le rapport statistique sera validé par le parlement).
</p>
</DsfrCallout>
</div>
<div v-else>
<p class="mt-4">Parmi les {{ statistics.diagnosticsCount }} cantines qui ont télédéclaré&nbsp;:</p>
<v-row class="px-2">
Expand Down Expand Up @@ -290,6 +298,14 @@ import BreadcrumbsNav from "@/components/BreadcrumbsNav"
import DsfrAutocomplete from "@/components/DsfrAutocomplete"
import DsfrSelect from "@/components/DsfrSelect"
import GraphComponent from "@/components/GraphComponent"
import DsfrCallout from "@/components/DsfrCallout"

const yearLast = lastYear()
const yearsList = Array.from(new Array(yearLast - 2020 + 1), (x, i) => i + 2020).map((year) => ({
key: year,
text: `données ${year} (télédéclarées en ${year + 1})`,
}))
console.log(yearsList)
Copy link
Member Author

Choose a reason for hiding this comment

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

zut j'ai oublié d'enlever, on cleanera à la prochaine modif sur cette page


export default {
name: "PublicCanteenStatisticsPage",
Expand All @@ -300,14 +316,13 @@ export default {
DsfrAutocomplete,
DsfrSelect,
GraphComponent,
DsfrCallout,
},
data() {
const yearGenerator = function*() {
for (let n = 2020; n <= lastYear(); n += 1) yield { key: n, text: `données ${n} (télédéclarées en ${n + 1})` }
}
return {
year: lastYear(),
yearsList: Array.from(yearGenerator()),
year: yearLast, // init
yearLast: yearLast,
yearsList: yearsList,
labels,
approMeasure: keyMeasures.find((measure) => measure.badgeId === "appro"),
otherMeasures: keyMeasures.filter((measure) => measure.badgeId !== "appro"),
Expand Down
Loading