diff --git a/client/src/components/dashboard/AttendancePerChosenProfileChart.vue b/client/src/components/dashboard/AttendancePerChosenProfileChart.vue index 07584563..a5a687af 100644 --- a/client/src/components/dashboard/AttendancePerChosenProfileChart.vue +++ b/client/src/components/dashboard/AttendancePerChosenProfileChart.vue @@ -1,14 +1,14 @@ w @@ -58,6 +44,7 @@ w v-for="(value, key) in props.data" :key="key" class="flex items-center space-x-2" + :data-cy="`dashboard.stats.trainingResponsible.chart.${CHOSEN_PROFILE_TO_NAME[key]}.${value}`" > { {{ $t("Kosten in") }} {{ new Date().getFullYear() }} - + {{ formatCurrencyChfCentimes(totalCostInCurrentYear) }} CHF @@ -72,13 +75,14 @@ const attendanceCountPerChosenProfile = computed(() => { {{ $t("Teilnehmer im 2024") }} {{ attendanceCountInCurrentYear }} diff --git a/client/src/components/dashboard/composables.ts b/client/src/components/dashboard/composables.ts new file mode 100644 index 00000000..6e4ac2c2 --- /dev/null +++ b/client/src/components/dashboard/composables.ts @@ -0,0 +1,24 @@ +import { useTranslation } from "i18next-vue"; + +export function useChosenProfileMapping() { + const { t } = useTranslation(); + + const CHOSEN_PROFILE_TO_NAME: Record = { + all: t("a.Allbranche"), + leben: t("a.Leben"), + nichtleben: t("a.Nichtleben"), + krankenzusatzversicherung: t("a.Krankenzusatzversicherungen"), + }; + + const CHOSEN_PROFILE_TO_COLOR: Record = { + all: "#558AED", + leben: "#FE955A", + nichtleben: "#54CE8B", + krankenzusatzversicherung: "#FAC852", + }; + + return { + CHOSEN_PROFILE_TO_NAME, + CHOSEN_PROFILE_TO_COLOR, + }; +} diff --git a/client/src/pages/dashboard/DashboardCostPage.vue b/client/src/pages/dashboard/DashboardCostPage.vue index bfc8428d..ff9863cb 100644 --- a/client/src/pages/dashboard/DashboardCostPage.vue +++ b/client/src/pages/dashboard/DashboardCostPage.vue @@ -45,15 +45,14 @@ const participantsForYear = (year: number) => { {{ entry?.year }} - + {{ participantsForYear(entry?.year ?? 0) }} {{ $t("a.Teilnehmer") }} - + {{ formatCurrencyChfCentimes(entry?.total_cost) }} CHF diff --git a/client/src/pages/dashboard/DashboardPersonsPage.vue b/client/src/pages/dashboard/DashboardPersonsPage.vue index 457b75f5..fa811e02 100644 --- a/client/src/pages/dashboard/DashboardPersonsPage.vue +++ b/client/src/pages/dashboard/DashboardPersonsPage.vue @@ -1,4 +1,5 @@
{{ entry?.year }}
+
{{ participantsForYear(entry?.year ?? 0) }} {{ $t("a.Teilnehmer") }}
{{ formatCurrencyChfCentimes(entry?.total_cost) }} CHF