fix: cross-day drag-and-drop + persist showCalendarProviderIcon setting
- Cross-day drag now works: getEventsForSlot uses drag state's current start time to assign the dragged event to the correct day column - Add showCalendarProviderIcon to Prisma schema, profile API GET/PATCH so the setting persists across sessions (was frontend-only before) - DB migration applied via prisma db push v1.68.0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
343cc87e4d
commit
13bd90bd2a
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "my-weekly-todo-list",
|
||||
"version": "1.67.1",
|
||||
"version": "1.68.0",
|
||||
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@ -25,6 +25,7 @@ model User {
|
||||
timezone String @default("UTC")
|
||||
autoRolling Boolean @default(false)
|
||||
protectEventTimes Boolean @default(false)
|
||||
showCalendarProviderIcon Boolean @default(false)
|
||||
language String @default("de")
|
||||
dateFormat String @default("yyyy-MM-dd")
|
||||
timeFormat String @default("24h")
|
||||
|
||||
@ -18,6 +18,7 @@ export async function GET(request: NextRequest) {
|
||||
timezone: true,
|
||||
autoRolling: true,
|
||||
protectEventTimes: true,
|
||||
showCalendarProviderIcon: true,
|
||||
language: true,
|
||||
dateFormat: true,
|
||||
timeFormat: true,
|
||||
@ -126,7 +127,7 @@ export async function PATCH(request: NextRequest) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const {
|
||||
name, timezone, password, autoRolling, protectEventTimes,
|
||||
name, timezone, password, autoRolling, protectEventTimes, showCalendarProviderIcon,
|
||||
language, dateFormat, timeFormat, startHour, endHour,
|
||||
showNextTask, calendarEditMode, focusTimerDuration, focusBreakDuration,
|
||||
showTimeGrid, showSomeday, showAllDayEvents, showSchedule,
|
||||
@ -156,6 +157,7 @@ export async function PATCH(request: NextRequest) {
|
||||
...(timezone !== undefined && { timezone }),
|
||||
...(autoRolling !== undefined && { autoRolling }),
|
||||
...(protectEventTimes !== undefined && { protectEventTimes }),
|
||||
...(showCalendarProviderIcon !== undefined && { showCalendarProviderIcon }),
|
||||
...(language !== undefined && { language }),
|
||||
...(dateFormat !== undefined && { dateFormat }),
|
||||
...(timeFormat !== undefined && { timeFormat }),
|
||||
|
||||
@ -3605,11 +3605,11 @@ export default function WeeklyView() {
|
||||
const isAllDay = isAllDayEvent(event);
|
||||
if (isAllDay) return false;
|
||||
|
||||
if (event.title.includes("Valentinstag")) {
|
||||
// Debug removed
|
||||
}
|
||||
// During drag, use the drag state's current start time for slot assignment
|
||||
const isDraggedEvent = eventDragState?.eventId === event.id && eventDragState?.hasMoved && eventDragState?.mode === 'move';
|
||||
const startTime = isDraggedEvent ? eventDragState!.currentStartTime : event.startTime;
|
||||
|
||||
const eventDate = new Date(event.startTime);
|
||||
const eventDate = new Date(startTime);
|
||||
if (!isSameDay(eventDate, date)) return false;
|
||||
|
||||
// Extract hour:minute from event start time and compare with slot
|
||||
@ -3625,7 +3625,7 @@ export default function WeeklyView() {
|
||||
return eventStart >= slotStart && eventStart < slotEnd;
|
||||
});
|
||||
},
|
||||
[calendarEvents, effectiveCellDuration],
|
||||
[calendarEvents, effectiveCellDuration, eventDragState],
|
||||
);
|
||||
|
||||
// Precompute overlap layout: { [eventId]: { column, totalColumns } }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user