diff --git a/src/components/AgendaView.vue b/src/components/AgendaView.vue index d3a0ba3..bd68f7e 100644 --- a/src/components/AgendaView.vue +++ b/src/components/AgendaView.vue @@ -27,15 +27,15 @@ {{ formatAgendaDate(date) }} - {{ entity.data?.label || 'Untitled' }} + {{ entity.properties?.label || 'Untitled' }} - {{ entity.data?.allDay ? 'All day' : `${entity.data?.startsOn ? formatTime(new Date(entity.data.startsOn)) : ''} - ${entity.data?.endsOn ? formatTime(new Date(entity.data.endsOn)) : ''}` }} + {{ entity.properties?.timeless ? 'All day' : `${entity.properties?.startsOn ? formatTime(new Date(entity.properties.startsOn)) : ''} - ${entity.properties?.endsOn ? formatTime(new Date(entity.properties.endsOn)) : ''}` }} @@ -132,17 +132,17 @@ const groupedEvents = computed(() => { const { start, end } = dateRange.value; const filtered = props.events.filter(e => { - if (!e.data?.startsOn) return false; - const eventStart = new Date(e.data.startsOn); + if (!e.properties?.startsOn) return false; + const eventStart = new Date(e.properties.startsOn); return eventStart >= start && eventStart <= end; }); const sorted = filtered.sort((a, b) => - new Date(a.data.startsOn).getTime() - new Date(b.data.startsOn).getTime() + new Date(a.properties.startsOn).getTime() - new Date(b.properties.startsOn).getTime() ); sorted.forEach(entity => { - const dateKey = new Date(entity.data.startsOn).toDateString(); + const dateKey = new Date(entity.properties.startsOn).toDateString(); if (!grouped[dateKey]) { grouped[dateKey] = []; } @@ -153,9 +153,9 @@ const groupedEvents = computed(() => { }); function getEventColor(entity: any): string { - if (entity.data?.color) return entity.data.color; - const calendar = props.calendars.find(cal => cal.id === entity.in); - return calendar?.color || '#1976D2'; + if (entity.properties?.color) return entity.properties.color; + const calendar = props.calendars.find(cal => cal.identifier === entity.collection); + return calendar?.properties?.color || '#1976D2'; } function formatTime(date: Date): string { diff --git a/src/components/CollectionEditor.vue b/src/components/CollectionEditor.vue index e01e4e5..6fac087 100644 --- a/src/components/CollectionEditor.vue +++ b/src/components/CollectionEditor.vue @@ -61,7 +61,7 @@ const dialogIcon = computed(() => { // Functions const onOpen = async () => { if (services.value.length === 0) { - services.value = await servicesStore.list() + services.value = Object.values(await servicesStore.list()) } if (!props.collection) { @@ -71,10 +71,10 @@ const onOpen = async () => { // Clone the collection to avoid mutating the original editingCollection.value = props.collection.clone() - if (props.collection.id !== null) { + if (props.mode === 'edit') { // Edit mode - find the service editingCollectionService.value = services.value.find(s => - s.provider === props.collection!.provider && s.id === props.collection!.service + s.provider === props.collection!.provider && s.identifier === props.collection!.service ) || null } else { // Create mode - use first service that can create @@ -102,7 +102,7 @@ const onColorSelect = (color: string | null, closeMenu = true) => { if (!editingCollection.value) { return } - editingCollection.value.color = color + editingCollection.value.properties.color = color if (closeMenu) { colorMenuOpen.value = false } @@ -144,7 +144,7 @@ watch(() => props.modelValue, async (newValue) => { label="Service" :items="services.filter(s => s.capabilities?.CollectionCreate)" item-title="label" - item-value="id" + item-value="identifier" required :rules="[(v: ServiceObject) => !!v || 'Service is required']" /> @@ -152,7 +152,7 @@ watch(() => props.modelValue, async (newValue) => {
Service: {{ editingCollection.service }}
props.modelValue, async (newValue) => { icon variant="text" size="small" - :style="{ color: editingCollection.color || 'var(--v-theme-on-surface)' }" + :style="{ color: editingCollection.properties.color || 'var(--v-theme-on-surface)' }" aria-label="Select color" title="Select color" > @@ -203,11 +203,11 @@ watch(() => props.modelValue, async (newValue) => { variant="flat" size="small" class="color-menu-body__presets--swatch" - :class="{ 'color-menu-body__presets--swatch--active': editingCollection.color === color }" + :class="{ 'color-menu-body__presets--swatch--active': editingCollection.properties.color === color }" :style="{ backgroundColor: color }" @click="onColorSelect(color)"> props.modelValue, async (newValue) => {
props.modelValue, async (newValue) => { @@ -240,7 +240,7 @@ watch(() => props.modelValue, async (newValue) => { diff --git a/src/components/CollectionList.vue b/src/components/CollectionList.vue index 7d8ad58..414e554 100644 --- a/src/components/CollectionList.vue +++ b/src/components/CollectionList.vue @@ -29,9 +29,9 @@ const filteredCollections = computed(() => { return collections.value.filter(collection => { if (props.type === 'calendar') { - return collection.contents?.event + return collection.properties.contents?.event } else if (props.type === 'tasklist') { - return collection.contents?.task + return collection.properties.contents?.task } return true }) @@ -53,7 +53,7 @@ const displayIcon = computed(() => { onMounted(async () => { loading.value = true try { - collections.value = await collectionsStore.list() + collections.value = Object.values(await collectionsStore.list()) } catch (error) { console.error('[Chrono] - Failed to load collections:', error) } @@ -71,7 +71,7 @@ const onCollectionEdit = (collection: CollectionObject) => { } const onToggleVisibility = (collection: CollectionObject) => { - collection.enabled = !collection.enabled + collection.properties.visibility = collection.properties.visibility === false emit('toggle-visibility', collection) } @@ -80,7 +80,7 @@ defineExpose({ async refresh() { loading.value = true try { - collections.value = await collectionsStore.list() + collections.value = Object.values(await collectionsStore.list()) } catch (error) { console.error('[Chrono] - Failed to load collections:', error) } @@ -106,28 +106,28 @@ defineExpose({ - {{ collection.label || 'Unnamed Collection' }} + {{ collection.properties.label || 'Unnamed Collection' }}