diff --git a/components/calendar/CalendarEventDetails.vue b/components/calendar/CalendarEventDetails.vue index eac1413..cbbc47f 100644 --- a/components/calendar/CalendarEventDetails.vue +++ b/components/calendar/CalendarEventDetails.vue @@ -75,7 +75,7 @@ function deployDeleteModal() { >
-
+
{{ event.title }}
@@ -100,18 +100,26 @@ function deployDeleteModal() {
-

- {{ dateDifference }} -

+
+
+ +
+

{{ dateDifference }}

+
@@ -134,7 +142,7 @@ function deployDeleteModal() { diff --git a/components/calendar/form/UpdateEvent.vue b/components/calendar/form/UpdateEvent.vue index 70a5652..644e550 100644 --- a/components/calendar/form/UpdateEvent.vue +++ b/components/calendar/form/UpdateEvent.vue @@ -104,6 +104,7 @@ function handleCancel() { name="new-event-title" required :placeholder="$t('entity.calendar.event.title')" + :maxlength="120" class="w-full -my-1 py-1 -mx-1 px-1 text-lg border-b-[1px] bg-transparent focus-visible:outline-none focus-visible:border-blue-600" >
@@ -116,6 +117,7 @@ function handleCancel() { name="new-event-description" :placeholder="$t('entity.addDescription')" class="w-full -my-1 py-1 -mx-1 px-1 min-h-24 max-h-36 text-sm border-b-[1px] bg-transparent focus-visible:outline-none focus-visible:border-blue-600" + :maxlength="1200" />
@@ -170,7 +172,9 @@ function handleCancel() { type="text" name="new-event-location" :placeholder="$t('entity.calendar.event.addLocation')" - class="w-full -my-1 py-2 px-2 text-sm border-b-[1px] bg-transparent focus-visible:outline-none focus-visible:border-blue-600"> + class="w-full -my-1 py-2 px-2 text-sm border-b-[1px] bg-transparent focus-visible:outline-none focus-visible:border-blue-600" + :maxlength="160" + > diff --git a/i18n.config.ts b/i18n.config.ts index e655bfc..628b124 100644 --- a/i18n.config.ts +++ b/i18n.config.ts @@ -142,9 +142,9 @@ export default defineI18nConfig(() => ({ }, editErrors: { toastTitle: "Event wasn't updated.", - title_too_big: "Title should be less than 240 characters long.", + title_too_big: "Title should be less than 120 characters long.", description_too_big: "Description should be less than 1200 characters long.", - location_too_big: "Location should be less than 240 characters long.", + location_too_big: "Location should be less than 160 characters long.", }, deleteDialog: { title: "Delete this event", @@ -356,9 +356,9 @@ export default defineI18nConfig(() => ({ }, editErrors: { toastTitle: "L'évènement n'a pas été modifié", - title_too_big: "Le titre doit être inférieur à 240 caractères.", + title_too_big: "Le titre doit être inférieur à 120 caractères.", description_too_big: "La description doit être inférieure à 1200 caractères.", - location_too_big: "La localisation doit être inférieure à 240 caractères.", + location_too_big: "La localisation doit être inférieure à 160 caractères.", }, deleteDialog: { title: "Supprimer l'évènement", diff --git a/models/CalendarEvent.ts b/models/CalendarEvent.ts index cd6dfc2..65562fa 100644 --- a/models/CalendarEvent.ts +++ b/models/CalendarEvent.ts @@ -20,9 +20,9 @@ export interface CalendarEvent { */ export const postEventBodySchema = z.object({ event: z.object({ - title: z.string().max(240), + title: z.string().max(120), description: z.string().max(1200).optional().nullable(), - location: z.string().max(240).optional().nullable(), + location: z.string().max(160).optional().nullable(), startDate: dateSchema.required(), endDate: dateSchema.optional().nullable(), hidden: z.boolean().optional().nullable(), diff --git a/supabase/migrations/202401_init.sql b/supabase/migrations/202401_init.sql index 96d19a4..7916e7c 100644 --- a/supabase/migrations/202401_init.sql +++ b/supabase/migrations/202401_init.sql @@ -92,9 +92,9 @@ comment on table public.calendar_events is 'Events linked to a world'; alter table public.calendar_events add constraint calendar_events_maxlen_check check ( - char_length(title) <= 240 AND + char_length(title) <= 120 AND (description IS NULL OR char_length(description) <= 1200) AND - (location IS NULL OR char_length(location) <= 240) + (location IS NULL OR char_length(location) <= 160) ); -- Link table for events - categories