This commit is contained in:
2024-07-12 22:20:45 +02:00
parent d01869fca8
commit fc0caf2d00
4 changed files with 10 additions and 12 deletions

View File

@@ -952,10 +952,12 @@ setupPage()
row.description = dataStore.getProductById(row.product).description" row.description = dataStore.getProductById(row.product).description"
> >
<template #label> <template #label>
<span class="truncate">{{dataStore.getProductById(row.product) ? dataStore.getProductById(row.product).name : "Kein Produkt ausgewählt" }}</span> <span class="truncate">{{row.product ? dataStore.getProductById(row.product).name : "Kein Produkt ausgewählt" }}</span>
</template> </template>
</USelectMenu> </USelectMenu>
<!--
{{dataStore.getProductById(66)}} {{dataStore.getProductById(66)}}
-->
</td> </td>
<td <td
class="w-120" class="w-120"

View File

@@ -28,9 +28,9 @@ const resourceToAdd = ref(dataStore.activeProfile.id)
const setupPage = async () => { const setupPage = async () => {
if(mode.value === "show"){ if(mode.value === "show"){
itemInfo.value = await useSupabaseSelectSingle("events",useRoute().params.id,"*, project(id,name)") itemInfo.value = await useSupabaseSelectSingle("events",route.params.id,"*, project(id,name)")
} else if(mode.value === "edit") { } else if(mode.value === "edit" && route.params.id) {
itemInfo.value = await useSupabaseSelectSingle("events",useRoute().params.id,"*") itemInfo.value = await useSupabaseSelectSingle("events",route.params.id,"*")
} }

View File

@@ -14,11 +14,6 @@
</UDashboardNavbar> </UDashboardNavbar>
<UDashboardPanelContent> <UDashboardPanelContent>
<UButton
@click="useToast().add({title: 'test'})"
>
Test
</UButton>
<UDashboardCard <UDashboardCard
title="Anwesenheiten" title="Anwesenheiten"
v-if="dataStore.getStartedWorkingTimes().length > 0" v-if="dataStore.getStartedWorkingTimes().length > 0"

View File

@@ -1376,14 +1376,15 @@ export const useDataStore = defineStore('data', () => {
events.value.forEach(event => { events.value.forEach(event => {
console.log(event) console.log(event)
event.resources.forEach(resource => { event.resources.forEach(resource => {
console.log(resource)
let eventColor = ownTenant.value.calendarConfig.eventTypes.find(type => type.label === event.type).color let eventColor = ownTenant.value.calendarConfig.eventTypes.find(type => type.label === event.type).color
let title = "" let title = ""
if(event.title) { if(event.title) {
title = event.title title = event.title
} else if(event.project) { } /*else if(event.project) {
projects.value.find(i => i.id === event.project) ? projects.value.find(i => i.id === event.project).name : "" projects.value.find(i => i.id === event.project) ? projects.value.find(i => i.id === event.project).name : ""
} }*/
@@ -1451,7 +1452,7 @@ export const useDataStore = defineStore('data', () => {
//Get Item By Id //Get Item By Id
const getProductById = computed(() => async (itemId) => { const getProductById = computed(() => (itemId) => {
return products.value.find(item => item.id === itemId) return products.value.find(item => item.id === itemId)
}) })