From ea4d685db4309b243092f3029021af64bbf71fbf Mon Sep 17 00:00:00 2001 From: alma Date: Thu, 15 Jan 2026 19:58:00 +0100 Subject: [PATCH] vision refactor --- app/vision/page.tsx | 68 +++------------------------------------------ 1 file changed, 4 insertions(+), 64 deletions(-) diff --git a/app/vision/page.tsx b/app/vision/page.tsx index 56e46f4..e096e97 100644 --- a/app/vision/page.tsx +++ b/app/vision/page.tsx @@ -79,10 +79,8 @@ export default function VisionPage() { start: string; end: string; allDay: boolean; - location: string; description: string; recurrence: "none" | "daily" | "weekly" | "monthly"; - isVideoConference: boolean; }>({ type: "", entityId: "", @@ -91,10 +89,8 @@ export default function VisionPage() { start: "", end: "", allDay: false, - location: "", description: "", recurrence: "none", - isVideoConference: false, }); // Redirect if not authenticated @@ -269,6 +265,7 @@ export default function VisionPage() { } // Otherwise, generate URL from type and id using shared function + if (!type) return; // Type must be "group" or "mission" const url = generateJitsiUrl(type, id); setSelectedConference({ type, id, name }); @@ -334,10 +331,8 @@ export default function VisionPage() { start: startDate.toISOString().slice(0, 16), end: endDate.toISOString().slice(0, 16), allDay: false, - location: "", description: "", recurrence: "none", - isVideoConference: false, }); setShowMeetingDialog(true); }; @@ -433,8 +428,8 @@ export default function VisionPage() { } } - // Determine location: use Jitsi URL if video conference is enabled, otherwise use manual location - const locationToSave = meetingForm.isVideoConference ? getJitsiUrl() : (meetingForm.location || null); + // All meetings in Vision page are video conferences, so always generate Jitsi URL + const jitsiUrlToSave = getJitsiUrl(); // Create all events via API const eventPromises = eventsToCreate.map(async ({ start, end }) => { @@ -449,7 +444,7 @@ export default function VisionPage() { start: start.toISOString(), end: end.toISOString(), allDay: meetingForm.allDay, - location: locationToSave, + location: jitsiUrlToSave, calendarId: targetCalendar.id, }), }); @@ -480,10 +475,8 @@ export default function VisionPage() { start: "", end: "", allDay: false, - location: "", description: "", recurrence: "none", - isVideoConference: false, }); toast({ title: "Succès", @@ -1107,57 +1100,6 @@ export default function VisionPage() { -
-
- { - const isChecked = checked as boolean; - setMeetingForm({ - ...meetingForm, - isVideoConference: isChecked, - // If enabling video conference, generate Jitsi URL - // If disabling, clear location - location: isChecked ? getJitsiUrl() : "" - }); - }} - /> - -
- {meetingForm.isVideoConference ? ( -
- -

- Le lien Jitsi sera généré automatiquement pour cette réunion -

-
- ) : ( -
- - - setMeetingForm({ ...meetingForm, location: e.target.value }) - } - placeholder="Ajouter un lieu" - className="bg-white text-gray-900" - /> -
- )} -
@@ -1211,10 +1153,8 @@ export default function VisionPage() { start: "", end: "", allDay: false, - location: "", description: "", recurrence: "none", - isVideoConference: false, }); }} className="bg-white hover:bg-gray-50 text-gray-900 border-gray-200"