Merge branch 'beta'

This commit is contained in:
2025-01-23 16:04:31 +01:00
8 changed files with 161 additions and 60 deletions

View File

@@ -1,4 +1,4 @@
<script setup lang="ts">
<script setup>
const { isHelpSlideoverOpen } = useDashboard()
const { metaSymbol } = useShortcuts()
@@ -101,42 +101,32 @@ const filteredCategories = computed(() => {
})
const contactRequestData = ref({
source: "helpSlideover",
tenant: profileStore.currentTenant,
message: "",
title: "",
contactName: profileStore.activeProfile.fullName,
contactTel: profileStore.activeProfile.phoneMobile || profileStore.activeProfile.phoneHome,
contactMail: profileStore.activeProfile.email,
contactType: "Hilfe",
currentPath: router.currentRoute
})
const addContactRequest = async () => {
const {data,error} = await supabase.from("contactRequests").insert(contactRequestData.value)
const loadingContactRequest = ref(false)
if(error) {
toast.add({title: "Anfrage konnte nicht erstellt werden",color:"rose"})
} else {
const addContactRequest = async () => {
console.log("ADD")
loadingContactRequest.value = true
const retVal = await useFunctions().useCreateTicket(contactRequestData.value.title,contactRequestData.value.message,router.currentRoute.value.fullPath,"helpSlideover",)
if(retVal) {
toast.add({title: "Anfrage erfolgreich erstellt"})
resetContactRequest()
} else {
toast.add({title: "Anfrage konnte nicht erstellt werden",color:"rose"})
}
loadingContactRequest.value = false
}
const resetContactRequest = () => {
contactRequestData.value = {
source: "helpSlideover",
tenant: profileStore.currentTenant,
message: "",
title: "",
contactName: profileStore.activeProfile.fullName,
contactTel: profileStore.activeProfile.phoneMobile || profileStore.activeProfile.phoneHome,
contactMail: profileStore.activeProfile.email,
contactType: "Hilfe"
}
}
</script>
<template>
@@ -178,21 +168,21 @@ const resetContactRequest = () => {
<div v-else class="flex flex-col gap-y-3">
<UButton v-for="(link, index) in links" :key="index" color="white" v-bind="link" />
</div>
<div class="mt-5">
<div class="mt-5" v-if="!loadingContactRequest">
<h1 class="font-semibold">Kontaktanfrage:</h1>
<UForm
class="p-3"
@submit="addContactRequest"
@reset="resetContactRequest"
>
<UFormGroup
<!-- <UFormGroup
label="Art:"
>
<USelectMenu
:options="['Hilfe','Software Problem / Bug','Funktionsanfrage','Kontakt','Sonstiges']"
v-model="contactRequestData.contactType"
/>
</UFormGroup>
</UFormGroup>-->
<UFormGroup
label="Titel:"
>
@@ -225,5 +215,6 @@ const resetContactRequest = () => {
</UForm>
</div>
<UProgress class="mt-5" animation="carousel" v-else/>
</UDashboardSlideover>
</template>