Implement complete event editing functionality with backend update endpoint

Frontend Changes:
- Add edit context menu option to EventContextMenu with pencil icon
- Enhance CreateEventModal to support both create and edit modes
- Add event data conversion methods for pre-populating edit forms
- Implement conditional submit logic (on_create vs on_update callbacks)
- Add update_event method to CalendarService with POST /calendar/events/update

Backend Changes:
- Add UpdateEventRequest and UpdateEventResponse models
- Implement update_event handler with event search by UID across calendars
- Add POST /api/calendar/events/update route
- Full validation and parsing of all event properties for updates
- Integrate with existing CalDAV client update_event functionality

Users can now right-click events, select "Edit Event", modify properties in the modal, and successfully update existing events instead of creating duplicates.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Connor Johnstone
2025-08-29 09:41:16 -04:00
parent 1b57adab98
commit 2a2666e75f
7 changed files with 570 additions and 14 deletions

View File

@@ -15,6 +15,7 @@ pub struct EventContextMenuProps {
pub x: i32,
pub y: i32,
pub event: Option<CalendarEvent>,
pub on_edit: Callback<()>,
pub on_delete: Callback<DeleteAction>,
pub on_close: Callback<()>,
}
@@ -37,6 +38,15 @@ pub fn event_context_menu(props: &EventContextMenuProps) -> Html {
.map(|event| event.recurrence_rule.is_some())
.unwrap_or(false);
let on_edit_click = {
let on_edit = props.on_edit.clone();
let on_close = props.on_close.clone();
Callback::from(move |_: MouseEvent| {
on_edit.emit(());
on_close.emit(());
})
};
let create_delete_callback = |action: DeleteAction| {
let on_delete = props.on_delete.clone();
let on_close = props.on_close.clone();
@@ -52,6 +62,10 @@ pub fn event_context_menu(props: &EventContextMenuProps) -> Html {
class="context-menu"
style={style}
>
<div class="context-menu-item" onclick={on_edit_click}>
<span class="context-menu-icon">{"✏️"}</span>
{"Edit Event"}
</div>
{
if is_recurring {
html! {