chore: standardize chrono provider
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -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({
|
||||
<v-list v-else density="compact" nav class="pa-0">
|
||||
<v-list-item
|
||||
v-for="collection in filteredCollections"
|
||||
:key="collection.id"
|
||||
:value="collection.id"
|
||||
:active="selectedCollection?.id === collection.id"
|
||||
:key="collection.identifier"
|
||||
:value="collection.identifier"
|
||||
:active="selectedCollection?.identifier === collection.identifier"
|
||||
@click="onCollectionSelect(collection)"
|
||||
rounded="lg"
|
||||
class="mb-1"
|
||||
>
|
||||
<template #prepend>
|
||||
<v-checkbox-btn
|
||||
:model-value="collection.enabled !== false"
|
||||
:color="collection.color || 'primary'"
|
||||
:model-value="collection.properties.visibility !== false"
|
||||
:color="collection.properties.color || 'primary'"
|
||||
hide-details
|
||||
@click.stop="onToggleVisibility(collection)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<v-list-item-title>{{ collection.label || 'Unnamed Collection' }}</v-list-item-title>
|
||||
<v-list-item-title>{{ collection.properties.label || 'Unnamed Collection' }}</v-list-item-title>
|
||||
|
||||
<template #append>
|
||||
<div class="d-flex align-center">
|
||||
<v-icon
|
||||
:color="collection.color || 'primary'"
|
||||
:color="collection.properties.color || 'primary'"
|
||||
size="small"
|
||||
class="mr-1"
|
||||
>mdi-circle</v-icon>
|
||||
|
||||
Reference in New Issue
Block a user