Changes in Events

Changes in Times
This commit is contained in:
2024-07-10 21:10:39 +02:00
parent dc3c8a2b60
commit f9909a87aa
2 changed files with 18 additions and 6 deletions

View File

@@ -111,6 +111,7 @@ const startTime = async () => {
console.log("started") console.log("started")
timeInfo.value.user = user.value.id timeInfo.value.user = user.value.id
timeInfo.value.start = new Date().toISOString() timeInfo.value.start = new Date().toISOString()
timeInfo.value.tenant = dataStore.currentTenant
const {data,error} = await supabase const {data,error} = await supabase
.from("times") .from("times")
@@ -251,7 +252,7 @@ const setState = async (newState) => {
</USelectMenu> </USelectMenu>
</template> </template>
</UDashboardToolbar> </UDashboardToolbar>
<div v-if="runningTimeInfo.id" class="mt-3"> <div v-if="runningTimeInfo.id" class="m-3">
Start: {{dayjs(runningTimeInfo.start).format("DD.MM.YY HH:mm")}} Start: {{dayjs(runningTimeInfo.start).format("DD.MM.YY HH:mm")}}
@@ -318,7 +319,6 @@ const setState = async (newState) => {
:disabled="configTimeMode === 'create' ? false : itemInfo.state !== 'Entwurf'" :disabled="configTimeMode === 'create' ? false : itemInfo.state !== 'Entwurf'"
/> />
</UFormGroup> </UFormGroup>
{{itemInfo.state === 'Entwurf'}}{{itemInfo.state}}
<UFormGroup <UFormGroup
label="Ende:" label="Ende:"
> >

View File

@@ -26,10 +26,12 @@ const resourceToAdd = ref(dataStore.activeProfile.id)
}*/ }*/
const setupPage = () => { const setupPage = async () => {
if(mode.value === "show"){
itemInfo.value = await useSupabaseSelectSingle("events",useRoute().params.id,"*, project(id,name)")
} else if(mode.value === "edit") {
itemInfo.value = await useSupabaseSelectSingle("events",useRoute().params.id,"*")
if(mode.value === "show" || mode.value === "edit"){
itemInfo.value = dataStore.getEventById(Number(useRoute().params.id)) || {resources: [], start: new Date(), end: new Date(), type: dataStore.getEventTypes[0].label}
} }
if(route.query.start) itemInfo.value.start = new Date(route.query.start.replace(" ", "+")) if(route.query.start) itemInfo.value.start = new Date(route.query.start.replace(" ", "+"))
@@ -91,7 +93,17 @@ setupPage()
<template #item="{item}"> <template #item="{item}">
<UCard class="mt-5"> <UCard class="mt-5">
<div v-if="item.label === 'Informationen'"> <div v-if="item.label === 'Informationen'">
{{itemInfo}} <div class="truncate" >
<p>Titel: {{itemInfo.title ? itemInfo.title : ''}}</p>
<p>Typ: {{itemInfo.type? itemInfo.type : ''}}</p>
<p>Start: {{dayjs(itemInfo.start).format("DD.MM.YY HH:mm")}}</p>
<p>Ende: {{dayjs(itemInfo.end).format("DD.MM.YY HH:mm")}}</p>
<p>Projekt: {{itemInfo.project ? itemInfo.project.name : ''}}</p>
<p>Link: <a v-if="itemInfo.link" :href="itemInfo.link">{{itemInfo.link }}</a></p>
<p>Resources: {{itemInfo.resources.map((x) => `${x.type} - ${x.title}`).join(",")}}</p>
<p>Notizen: {{itemInfo.notes ? itemInfo.notes : ''}}</p>
</div>
</div> </div>
<div v-if="item.label === 'Logbuch'"> <div v-if="item.label === 'Logbuch'">
<HistoryDisplay <HistoryDisplay