Merge branch 'beta' into 'main'
Version 1.1.1 See merge request fedeo/software!4
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
<script setup>
|
||||
const { isHelpSlideoverOpen } = useDashboard()
|
||||
const { metaSymbol } = useShortcuts()
|
||||
|
||||
@@ -101,42 +101,33 @@ 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)
|
||||
console.log("ADD")
|
||||
const retVal = await useFunctions().useCreateTicket({
|
||||
subject: contactRequestData.value.title,
|
||||
message: contactRequestData.value.message,
|
||||
url: router.currentRoute.value.fullPath,
|
||||
source: "helpSlideover",
|
||||
})
|
||||
|
||||
if(error) {
|
||||
toast.add({title: "Anfrage konnte nicht erstellt werden",color:"rose"})
|
||||
} else {
|
||||
if(retVal) {
|
||||
toast.add({title: "Anfrage erfolgreich erstellt"})
|
||||
resetContactRequest()
|
||||
} else {
|
||||
toast.add({title: "Anfrage konnte nicht erstellt werden",color:"rose"})
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
@@ -185,14 +176,14 @@ const resetContactRequest = () => {
|
||||
@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:"
|
||||
>
|
||||
|
||||
@@ -38,5 +38,26 @@ export const useFunctions = () => {
|
||||
})).data.usedNumber
|
||||
}
|
||||
|
||||
return {getWorkingTimesEvaluationData, useNextNumber}
|
||||
const useCreateTicket = async (subject,message,url,source) => {
|
||||
const {data:{session:{access_token}}} = await supabase.auth.getSession()
|
||||
|
||||
const {data} = await axios({
|
||||
method: "POST",
|
||||
url: `${baseURL}/functions/createticket`,
|
||||
data: {
|
||||
subject,
|
||||
message,
|
||||
source,
|
||||
url
|
||||
},
|
||||
headers: {
|
||||
Authorization: `Bearer ${access_token}`
|
||||
}
|
||||
})
|
||||
|
||||
return !!data.ticket_created;
|
||||
|
||||
}
|
||||
|
||||
return {getWorkingTimesEvaluationData, useNextNumber, useCreateTicket}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ const setupPage = async () => {
|
||||
console.log(item.value)
|
||||
} else if(mode.value === "list") {
|
||||
//Load Data for List
|
||||
items.value = await useSupabaseSelect(type, dataType.supabaseSelectWithInformation || "*", dataType.supabaseSortColumn)
|
||||
items.value = await useSupabaseSelect(type, dataType.supabaseSelectWithInformation || "*", dataType.supabaseSortColumn,dataType.supabaseSortAscending || false)
|
||||
}
|
||||
|
||||
loaded.value = true
|
||||
|
||||
@@ -23,6 +23,11 @@ const setupPage = () => {
|
||||
//setStartEnd()
|
||||
}
|
||||
oldItemInfo.value = itemInfo.value
|
||||
|
||||
if(route.query) {
|
||||
if(route.query.profile) itemInfo.value.profile = route.query.profile
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*const setStartEnd = () => {
|
||||
|
||||
@@ -12,16 +12,27 @@ const dataStore = useDataStore()
|
||||
const profileStore = useProfileStore()
|
||||
const supabase = useSupabaseClient()
|
||||
const router = useRouter()
|
||||
|
||||
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const filterUser = ref(profileStore.activeProfile.id || "")
|
||||
|
||||
const workingtimes = ref([])
|
||||
|
||||
const setupPage = async () => {
|
||||
if(route.query) {
|
||||
if(route.query.profile) filterUser.value = route.query.profile
|
||||
}
|
||||
|
||||
workingtimes.value = (await supabase.from("workingtimes").select().eq("profile",filterUser.value).order("startDate",{ascending: false})).data
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const changeFilterUser = async () => {
|
||||
await router.push(`/workingtimes/?profile=${filterUser.value}`)
|
||||
await setupPage()
|
||||
}
|
||||
|
||||
setupPage()
|
||||
@@ -147,9 +158,9 @@ const setEndDate = (row) => {
|
||||
<UDashboardNavbar title="Anwesenheiten">
|
||||
<template #right>
|
||||
<UButton
|
||||
@click="router.push(`/workingtimes/edit`)"
|
||||
@click="router.push(`/workingtimes/edit?profile=${filterUser}`)"
|
||||
>
|
||||
Erstellen
|
||||
+ Anwesenheit
|
||||
</UButton>
|
||||
</template>
|
||||
</UDashboardNavbar>
|
||||
@@ -161,7 +172,7 @@ const setEndDate = (row) => {
|
||||
option-attribute="fullName"
|
||||
value-attribute="id"
|
||||
v-model="filterUser"
|
||||
@change="setupPage"
|
||||
@change="changeFilterUser"
|
||||
>
|
||||
<template #label>
|
||||
{{profileStore.getProfileById(filterUser) ? profileStore.getProfileById(filterUser).fullName : "Kein Benutzer ausgewählt"}}
|
||||
|
||||
@@ -506,6 +506,8 @@ export const useDataStore = defineStore('data', () => {
|
||||
label: "Abwesenheitsanträge",
|
||||
labelSingle: "Abwesenheitsantrag",
|
||||
isStandardEntity: true,
|
||||
supabaseSortColumn:"startDate",
|
||||
supabaseSortAscending: false,
|
||||
supabaseSelectWithInformation: "*",
|
||||
historyItemHolder: "absencerequest",
|
||||
redirect:true,
|
||||
|
||||
Reference in New Issue
Block a user