From 0297fab83b7e19a64ceecc92052bdfd877285c46 Mon Sep 17 00:00:00 2001 From: quirinecker Date: Sun, 6 Jul 2025 11:52:00 +0200 Subject: [PATCH] dragging task in the calendar works visually --- web/components/ui/MainContent.vue | 5 ++- web/components/ui/Sidebar.vue | 13 +++++-- web/components/ui/TaskFormModal.vue | 9 ++--- web/components/ui/calendar/Calendar.vue | 8 +++-- .../ui/calendar/CalendarCollumn.vue | 31 ++++++++++++++-- web/pages/index.vue | 10 ++++-- web/utils/task.ts | 35 +++++++++++++++++-- 7 files changed, 94 insertions(+), 17 deletions(-) diff --git a/web/components/ui/MainContent.vue b/web/components/ui/MainContent.vue index 2c8bf5f..2faaffb 100644 --- a/web/components/ui/MainContent.vue +++ b/web/components/ui/MainContent.vue @@ -6,6 +6,7 @@ import type { DateTime } from 'luxon'; const events = defineModel('events', { required: true }) const date = defineModel('date', { required: true }) +const draggedTask = defineModel('draggedTask', { required: true }) const emits = defineEmits<{ (e: 'createEvent', event: Event): void @@ -15,7 +16,9 @@ const emits = defineEmits<{ diff --git a/web/components/ui/Sidebar.vue b/web/components/ui/Sidebar.vue index 78973cd..d337a79 100644 --- a/web/components/ui/Sidebar.vue +++ b/web/components/ui/Sidebar.vue @@ -7,6 +7,7 @@ import { DateTime } from 'luxon'; const colorMode = useColorMode(); const toast = useToast() +const instance = getCurrentInstance() const currentTheme = ref<'dark' | 'system' | 'light'>(colorMode.preference as 'dark' | 'system' | 'light'); const showTaskCreateModal = ref(false); @@ -20,6 +21,7 @@ const emits = defineEmits<{ (e: 'createTask', task: Task): void (e: 'deleteTask', id: number): void (e: 'editTask', task: Task): void + (e: 'scheduleTask', task: Task): void }>() const isLight = computed(() => currentTheme.value === 'light'); @@ -96,6 +98,7 @@ function deleteTask(task: Task) { emits('deleteTask', task.id) } + function editTask(task: Task) { emits('editTask', task) } @@ -110,6 +113,10 @@ function openTaskEditModal(task: Task) { showTaskEditModal.value = true } +function scheduleTask(task: Task) { + emits('scheduleTask', task) +} +