Some Fixes in Tickets

This commit is contained in:
2025-02-13 17:30:00 +01:00
parent 85ffd61c16
commit d675eb96a6
2 changed files with 32 additions and 5 deletions

View File

@@ -69,6 +69,13 @@ const closeTicket = async () => {
console.log(error) console.log(error)
} else { } else {
console.log(data) console.log(data)
addEntryData.value.type = "Notiz"
addEntryData.value.internal = false
addEntryData.value.content = `Ticket durch ${profileStore.activeProfile.fullName} geschlossen`
addEntry()
} }
setup() setup()
@@ -161,7 +168,7 @@ const closeTicket = async () => {
v-for="item in itemInfo.ticketmessages.filter(i => !i.internal)" v-for="item in itemInfo.ticketmessages.filter(i => !i.internal)"
:description="item.content" :description="item.content"
:avatar="{ alt: item.profile.fullName}" :avatar="{ alt: item.profile.fullName}"
:title="item.profile.fullName" :title="`${item.type} - ${item.profile.fullName}`"
class="mb-3" class="mb-3"
:color="item.profile.tenant === 5 ? 'primary' : 'white'" :color="item.profile.tenant === 5 ? 'primary' : 'white'"
variant="outline" variant="outline"

View File

@@ -6,21 +6,33 @@ const router = useRouter()
const tickets = ref([]) const tickets = ref([])
const showClosedTickets = ref(false)
const setup = async () => { const setup = async () => {
if(profileStore.currentTenant === 5) { if(profileStore.currentTenant === 5) {
tickets.value = (await supabase.from("tickets").select("*,created_by(*), ticketmessages(*), tenant(*)")).data tickets.value = (await supabase.from("tickets").select("*,created_by(*), ticketmessages(*), tenant(*)").order("created_at", {ascending: false})).data
} else { } else {
tickets.value = (await supabase.from("tickets").select("*,created_by(*), ticketmessages(*)").eq("tenant",profileStore.currentTenant)).data tickets.value = (await supabase.from("tickets").select("*,created_by(*), ticketmessages(*)").eq("tenant",profileStore.currentTenant).order("created_at", {ascending: false})).data
} }
} }
setup() setup()
const filteredRows = computed(() => {
if(showClosedTickets.value) {
return tickets.value
} else {
return tickets.value.filter(i => i.status !== "Geschlossen")
}
})
</script> </script>
<template> <template>
<UDashboardNavbar <UDashboardNavbar
title="Suport Tickets" title="Support Tickets"
> >
<template #right> <template #right>
<UButton <UButton
@@ -30,8 +42,16 @@ setup()
</UButton> </UButton>
</template> </template>
</UDashboardNavbar> </UDashboardNavbar>
<UDashboardToolbar>
<template #left>
<UCheckbox
label="Geschlossene Tickets anzeigen"
v-model="showClosedTickets"
/>
</template>
</UDashboardToolbar>
<UTable <UTable
:rows="tickets" :rows="filteredRows"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: `Keine Tickets anzuzeigen` }" :empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: `Keine Tickets anzuzeigen` }"
@select="(i) => router.push(`/support/${i.id}`)" @select="(i) => router.push(`/support/${i.id}`)"
:columns="[{key:'created_at',label:'Datum'}, ...profileStore.currentTenant === 5 ? [{key:'tenant',label:'Tenant'}] : [],{key:'status',label:'Status'},{key:'title',label:'Titel'},{key:'created_by',label:'Ersteller'},{key:'ticketmessages',label:'Nachrichten'}]" :columns="[{key:'created_at',label:'Datum'}, ...profileStore.currentTenant === 5 ? [{key:'tenant',label:'Tenant'}] : [],{key:'status',label:'Status'},{key:'title',label:'Titel'},{key:'created_by',label:'Ersteller'},{key:'ticketmessages',label:'Nachrichten'}]"