chore: standardize chrono provider
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -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) => {
|
||||
<div v-if="mode === 'edit'" class="mb-4"><strong>Service:</strong> {{ editingCollection.service }}</div>
|
||||
|
||||
<v-text-field
|
||||
v-model="editingCollection.label"
|
||||
v-model="editingCollection.properties.label"
|
||||
label="Label"
|
||||
required
|
||||
:rules="[(v: string) => !!v || 'Label is required']"
|
||||
@@ -170,7 +170,7 @@ watch(() => 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)">
|
||||
<v-icon
|
||||
v-if="editingCollection.color === color"
|
||||
v-if="editingCollection.properties.color === color"
|
||||
icon="mdi-check"
|
||||
size="x-small"
|
||||
color="white"
|
||||
@@ -218,7 +218,7 @@ watch(() => props.modelValue, async (newValue) => {
|
||||
|
||||
<div class="color-menu-body__picker">
|
||||
<v-color-picker
|
||||
v-model="editingCollection.color"
|
||||
v-model="editingCollection.properties.color"
|
||||
mode="hex"
|
||||
hide-canvas
|
||||
width="100%"
|
||||
@@ -232,7 +232,7 @@ watch(() => props.modelValue, async (newValue) => {
|
||||
</v-text-field>
|
||||
|
||||
<v-textarea
|
||||
v-model="editingCollection.description"
|
||||
v-model="editingCollection.properties.description"
|
||||
label="Description"
|
||||
rows="2"
|
||||
/>
|
||||
@@ -240,7 +240,7 @@ watch(() => props.modelValue, async (newValue) => {
|
||||
<v-row>
|
||||
<v-col v-if="mode === 'edit'" cols="6">
|
||||
<v-switch
|
||||
v-model="editingCollection.enabled"
|
||||
v-model="editingCollection.properties.visibility"
|
||||
label="Enabled"
|
||||
color="primary"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user