This commit is contained in:
2024-10-08 13:08:13 +02:00
parent 856628bce6
commit 16932ad71c
7 changed files with 161 additions and 116 deletions

View File

@@ -269,7 +269,6 @@ const downloadSelected = async () => {
<div v-if="!loadingDocs">
<DocumentList
v-if="filteredDocuments.length > 0"
:documents="filteredDocuments"

View File

@@ -20,8 +20,13 @@ const emailAccounts = ref([])
const preloadedContent = ref("")
const loadedDocuments = ref([])
const loaded = ref(false)
const noAccountsPresent = ref(false)
const setupPage = async () => {
emailAccounts.value = await useSupabaseSelect("emailAccounts")
if(emailAccounts.value.length === 0) {
noAccountsPresent.value = true
} else {
emailData.value.account = emailAccounts.value[0].id
preloadedContent.value = `<p></p><p></p><p></p>${dataStore.activeProfile.emailSignature}`
@@ -51,6 +56,10 @@ const setupPage = async () => {
}
loaded.value = true
}
}
@@ -142,6 +151,17 @@ const sendEmail = async () => {
</script>
<template>
<div v-if="noAccountsPresent" class="mx-auto mt-5 flex flex-col justify-center">
<span class="font-bold text-2xl">Keine E-Mail Konten vorhanden</span>
<UButton
@click="router.push(`/settings/emailAccounts`)"
class="mx-auto mt-5"
>
+ E-Mail Konto
</UButton>
</div>
<div v-else>
<UProgress animation="carousel" v-if="!loaded" class="mt-5 w-2/3 mx-auto"/>
<div v-else>
@@ -170,7 +190,7 @@ const sendEmail = async () => {
v-model="emailData.account"
/>
</UFormGroup>
<UDivider class="my-3"/>
<UInput
class="w-full my-1"
placeholder="Empfänger"
@@ -234,6 +254,9 @@ const sendEmail = async () => {
/>
</UDashboardPanelContent>
</div>
</div>
</template>

View File

@@ -303,7 +303,6 @@ const setState = async (newState) => {
<template #header>
Zeiteintrag {{configTimeMode === 'create' ? "erstellen" : "bearbeiten"}}
</template>
{{itemInfo}}
<UFormGroup
label="Start:"
>

View File

@@ -53,6 +53,9 @@
<template #project-data="{row}">
{{row.project ? dataStore.getProjectById(row.project).name: ""}}
</template>
<template #resources-data="{row}">
{{row.resources ? row.resources.map(i => i.title).join(", ") : ""}}
</template>
</UTable>
</template>

View File

@@ -57,15 +57,13 @@
>
<display-open-balances/>
</UDashboardCard>
</UDashboardPanelContent>
</UDashboardPanel>
</UDashboardPage>
</template>
<script setup>
definePageMeta({
middleware: "auth"
})

View File

@@ -99,9 +99,16 @@ const tags = dataStore.getDocumentTags
const phasesTemplates = ref([])
const phasesTemplateSelected = ref(null)
const plants = ref([])
const contracts = ref([])
//Functions
const setupPage = async() => {
plants.value = await useSupabaseSelect("plants")
contracts.value = await useSupabaseSelect("contracts")
if(mode.value === "show" ){
itemInfo.value = await useSupabaseSelectSingle("projects",route.params.id,"*, customer(*), plant(*)")
} else if (mode.value === "edit") {
@@ -562,14 +569,30 @@ const loadPhases = async () => {
>
<USelectMenu
v-model="itemInfo.plant"
:options="dataStore.plants"
:options="plants"
option-attribute="name"
value-attribute="id"
searchable
:search-attributes="['name']"
>
<template #label>
{{dataStore.getPlantById(itemInfo.plant) ? dataStore.getPlantById(itemInfo.plant).name : "Objekt auswählen"}}
{{plants.find(i => i.id === itemInfo.plant) ? plants.find(i => i.id === itemInfo.plant).name : "Objekt auswählen"}}
</template>
</USelectMenu>
</UFormGroup>
<UFormGroup
label="Vertrag:"
>
<USelectMenu
v-model="itemInfo.contract"
:options="contracts"
option-attribute="name"
value-attribute="id"
searchable
:search-attributes="['name']"
>
<template #label>
{{contracts.find(i => i.id === itemInfo.contract) ? contracts.find(i => i.id === itemInfo.contract).name : "Vertrag auswählen"}}
</template>
</USelectMenu>
</UFormGroup>

View File

@@ -93,12 +93,12 @@ const columns = computed(() => templateColumns.filter((column) => selectedColumn
</UCard>
</UModal>
<UDashboardNavbar title="E-Mail Accounts">
<UDashboardNavbar title="E-Mail Konten">
<template #right>
<UButton
@click="showEmailAddressModal = true"
>
+ Account
+ E-Mail Konto
</UButton>
</template>
</UDashboardNavbar>
@@ -107,7 +107,7 @@ const columns = computed(() => templateColumns.filter((column) => selectedColumn
:columns="columns"
class="w-full"
:ui="{ divide: 'divide-gray-200 dark:divide-gray-800' }"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Projekte anzuzeigen' }"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine E-Mail Konten anzuzeigen' }"
>
<template #profiles-data="{row}">
{{row.profiles.map(i => profiles.find(x => x.id === i).fullName).join(", ")}}