Add comprehensive iCal properties support to event creation modal

Enhanced the create event modal to include all major iCalendar properties:
- Event status (confirmed/tentative/cancelled)
- Privacy classification (public/private/confidential)
- Priority levels (0-9 numeric scale)
- Organizer email field
- Attendees list (comma-separated emails)
- Categories (comma-separated tags)
- Reminder options (none to 1 week before)
- Recurrence patterns (none/daily/weekly/monthly/yearly)

Updated backend to parse and handle all new fields, with proper enum conversion
and comma-separated list parsing. Events now generate complete iCal data with
STATUS, CLASS, PRIORITY, ORGANIZER, ATTENDEE, CATEGORIES, VALARM, and RRULE properties.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Connor Johnstone
2025-08-28 22:43:03 -04:00
parent 749ffaff58
commit 34461640af
7 changed files with 453 additions and 12 deletions

View File

@@ -2,7 +2,7 @@ use yew::prelude::*;
use yew_router::prelude::*;
use gloo_storage::{LocalStorage, Storage};
use web_sys::MouseEvent;
use crate::components::{Sidebar, CreateCalendarModal, ContextMenu, EventContextMenu, CalendarContextMenu, CreateEventModal, EventCreationData, RouteHandler};
use crate::components::{Sidebar, CreateCalendarModal, ContextMenu, EventContextMenu, CalendarContextMenu, CreateEventModal, EventCreationData, RouteHandler, EventStatus, EventClass, ReminderType, RecurrenceType};
use crate::services::{CalendarService, calendar_service::{UserInfo, CalendarEvent}};
use chrono::NaiveDate;
@@ -221,6 +221,38 @@ pub fn App() -> Html {
let end_date = event_data.end_date.format("%Y-%m-%d").to_string();
let end_time = event_data.end_time.format("%H:%M").to_string();
// Convert enums to strings for backend
let status_str = match event_data.status {
EventStatus::Tentative => "tentative",
EventStatus::Cancelled => "cancelled",
_ => "confirmed",
}.to_string();
let class_str = match event_data.class {
EventClass::Private => "private",
EventClass::Confidential => "confidential",
_ => "public",
}.to_string();
let reminder_str = match event_data.reminder {
ReminderType::Minutes15 => "15min",
ReminderType::Minutes30 => "30min",
ReminderType::Hour1 => "1hour",
ReminderType::Hours2 => "2hours",
ReminderType::Day1 => "1day",
ReminderType::Days2 => "2days",
ReminderType::Week1 => "1week",
_ => "none",
}.to_string();
let recurrence_str = match event_data.recurrence {
RecurrenceType::Daily => "daily",
RecurrenceType::Weekly => "weekly",
RecurrenceType::Monthly => "monthly",
RecurrenceType::Yearly => "yearly",
_ => "none",
}.to_string();
match calendar_service.create_event(
&token,
&password,
@@ -232,6 +264,14 @@ pub fn App() -> Html {
end_time,
event_data.location,
event_data.all_day,
status_str,
class_str,
event_data.priority,
event_data.organizer,
event_data.attendees,
event_data.categories,
reminder_str,
recurrence_str,
None // Let backend use first available calendar
).await {
Ok(_) => {