✨ Finish event creation and editing flow - #952
Conversation
|
Follow-up on #945: instructions for making the calendar reusable Functionally this PR already covers the ask (fetch/create/edit/delete events, month grid, upcoming/past lists). What's still needed is a refactor so The page (
1. Consolidate the data logic into a hook
2. Split into componentsTwo new pieces, both currently inlined in (a) Reusable
The (b) "Create an event" CTA — extract the 3.
|
nadavosa
left a comment
There was a problem hiding this comment.
Reviewed the diff and checked it out locally. tsc --noEmit and yarn lint both pass clean on this branch (only the same 4 pre-existing, unrelated hook warnings you already called out). Note GitHub hasn't actually run CI on this PR yet, it's a fork PR and no check runs exist for the head commit yet (probably needs a maintainer to approve the workflow run), so "CI passes" isn't confirmed from GitHub's side yet, just from my local run.
Found a few real issues worth addressing before merge:
1. Event type is hardcoded to WORKSHOP for every event. toPayload() in CreateEvent.tsx always sets type: EventN4DType.WORKSHOP, but the SDK enum has two values (PARTY, WORKSHOP) and there's no UI to choose. Every event a coordinator creates through this flow, including a purely social one, gets tagged as a workshop. Was this intentional (e.g. "party" isn't used yet), or should there be a type selector in the form?
2. Events only get a translation in the coordinator's current UI language. toPayload() submits a single-element translations array using i18n.language. Since the public site is bilingual and translations is a required array (per ApiEventN4DCreate), an event created by a German-speaking coordinator has no English translation record at all, and vice versa. Non-matching-locale visitors to the public event page would presumably see nothing (or a broken fallback) for that event. This seems like a real gap for a bilingual site rather than an edge case.
3. Multi-day events aren't reflected on the calendar past their start day. eventDays (for the dot markers) and clickDay (click-to-scroll-to-event) in CalendarContent.tsx both key only on event.date, never event.dateEnd. Since the date/time step explicitly supports a different end date (with end > start validation), a coordinator can create a multi-day event, but the calendar only marks its first day. Clicking the event's other days (including its own end day) shows no marker and offers "create event" there instead, since nothing flags that day as occupied.
4. Multi-day event card display reads as a same-day range. EventCard's range() helper builds the date from event.date but appends endTime from event.dateEnd regardless of whether they're the same calendar day, e.g. a Friday 18:00 → Saturday 09:00 event renders as "Friday, ... · 18:00–09:00", which reads like an invalid same-day range rather than a two-day span.
5. Minor: /dashboard/calendar/[id]/edit/page.tsx does Number(id), if the id in the URL isn't numeric this becomes NaN, which is falsy, so CreateEvent silently falls into "create new event" mode instead of showing an error for a malformed edit URL. Low severity, just flagging.
None of these are typos or crashes, the flow works for the straightforward same-day, single-language case shown in the screenshots, but 1-3 look like they'd affect real usage once coordinators create multi-day or non-English-only events.
|
@arturasmckwcz @nadavosa Thank you both for reviewing the PR and for the detailed feedback. I’ve pushed commit For Arturas’s refactor request:
For Nadav’s findings:
One question remains about translations: should coordinators enter both English and German title/description, or should the public event pages rely on the backend fallback when only one translation exists? Updated calendar
Event type selector
Please let me know if I should make any further changes to PR #952. |


Description
Finishes the dashboard event-management flow so coordinators can create, view, edit, and delete persisted events.
The calendar now displays real event data and provides a clearer overview of upcoming and past events. The existing three-step creation design is preserved while adding the missing event fields and backend integration.
Related Issues
Closes #945
Changes
need4deed-sdkpackage.Screenshots / Demos
Before
After
Events dashboard — German
Events dashboard and event flow — English
Testing
yarn typecheck— passedyarn lint— passed with four pre-existing, unrelated React Hook warningsgit diff --check— passedChecklist