From b531256263db9f01deedf19625375dc5878c9063 Mon Sep 17 00:00:00 2001 From: Massedil Date: Tue, 11 Feb 2025 17:54:59 +0100 Subject: [PATCH] fix(event_creation): explains when the event will be an activity Solves #1568 --- src/i18n/fr_FR.json | 1 + src/views/Event/EditView.vue | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/i18n/fr_FR.json b/src/i18n/fr_FR.json index c3a8bfe43..15639dc53 100644 --- a/src/i18n/fr_FR.json +++ b/src/i18n/fr_FR.json @@ -70,6 +70,7 @@ "Activate notifications": "Activer les notifications", "Activated": "Activé", "Active": "Actif·ive", + "Activities are disabled on this instance.|An event with a duration of more than one day will be categorized as an activity.|An event with a duration of more than {number} days will be categorized as an activity.": "Les activités sont désactivées sur cette instance.|Un événement avec une durée de plus d'un jour sera considéré comme une activité.|Un événement avec une durée de plus de {number} jours sera considéré comme une activité.", "Activity": "Activité", "Actor": "Acteur", "Adapt to system theme": "S’adapter au thème du système", diff --git a/src/views/Event/EditView.vue b/src/views/Event/EditView.vue index d46e36961..53aced04a 100644 --- a/src/views/Event/EditView.vue +++ b/src/views/Event/EditView.vue @@ -99,6 +99,21 @@ +

+ {{ + t( + "Activities are disabled on this instance.|An event with a duration of more than one day will be categorized as an activity.|An event with a duration of more than {number} days will be categorized as an activity.", + { number: configResult.config.durationOfLongEvent }, + configResult.config.durationOfLongEvent + ) + }} +

+ {{ t("Timezone parameters") }} @@ -652,7 +667,7 @@ import { useFeatures, useTimezones, } from "@/composition/apollo/config"; -import { useMutation } from "@vue/apollo-composable"; +import { useMutation, useQuery } from "@vue/apollo-composable"; import { Dialog } from "@/plugins/dialog"; import { Notifier } from "@/plugins/notifier"; import { useHead } from "@/utils/head"; @@ -660,6 +675,8 @@ import { useOruga } from "@oruga-ui/oruga-next"; import sortBy from "lodash/sortBy"; import { escapeHtml } from "@/utils/html"; import EventDatePicker from "@/components/Event/EventDatePicker.vue"; +import { CONFIG } from "@/graphql/config"; +import { IConfig } from "@/types/config.model"; const DEFAULT_LIMIT_NUMBER_OF_PLACES = 10; @@ -694,6 +711,8 @@ useHead({ ), }); +const { result: configResult } = useQuery<{ config: IConfig }>(CONFIG); + const event = ref(new EventModel()); const unmodifiedEvent = ref(new EventModel());