Tasks und Vertragstyp fix #17
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 30s
Build and Push Docker Images / build-frontend (push) Successful in 1m8s

This commit is contained in:
2026-02-15 22:02:16 +01:00
parent 087ba1126e
commit 3f8ce5daf7
23 changed files with 1037 additions and 24 deletions

View File

@@ -31,6 +31,7 @@ const dataStore = useDataStore()
const tempStore = useTempStore()
const router = useRouter()
const createRoute = computed(() => type.value === "tasks" ? `/tasks/create?${props.queryStringData}` : `/standardEntity/${type.value}/create?${props.queryStringData}`)
let dataType = null
@@ -80,7 +81,7 @@ setup()
</template>
<Toolbar>
<UButton
@click="router.push(`/standardEntity/${type}/create?${props.queryStringData}`)"
@click="router.push(createRoute)"
>
+ {{dataType.labelSingle}}
</UButton>
@@ -125,4 +126,4 @@ setup()
<style scoped>
</style>
</style>

View File

@@ -1,4 +1,6 @@
<script setup>
const getShowRoute = (entityType, id) => entityType === "tasks" ? `/tasks/show/${id}` : `/standardEntity/${entityType}/show/${id}`
defineShortcuts({
/*'/': () => {
//console.log(searchinput)
@@ -8,7 +10,7 @@
'Enter': {
usingInput: true,
handler: () => {
router.push(`/standardEntity/${props.type}/show/${props.rows.value[selectedItem.value].id}`)
router.push(getShowRoute(props.type, props.rows[selectedItem.value].id))
}
},
'arrowdown': () => {
@@ -75,7 +77,7 @@
:columns="props.columns"
class="w-full"
:ui="{ divide: 'divide-gray-200 dark:divide-gray-800' }"
@select="(i) => router.push(`/standardEntity/${type}/show/${i.id}`) "
@select="(i) => router.push(getShowRoute(type, i.id))"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: `Keine ${dataType.label} anzuzeigen` }"
>
<!-- <template
@@ -134,4 +136,4 @@
<style scoped>
</style>
</style>

View File

@@ -46,6 +46,7 @@
const dataStore = useDataStore()
const router = useRouter()
const getShowRoute = (entityType, id) => entityType === "tasks" ? `/tasks/show/${id}` : `/standardEntity/${entityType}/show/${id}`
const dataType = dataStore.dataTypes[props.type]
@@ -59,7 +60,7 @@
<a
v-for="item in props.rows"
class="my-1"
@click="router.push(`/standardEntity/${type}/show/${item.id}`)"
@click="router.push(getShowRoute(type, item.id))"
>
<p class="truncate text-left text-primary text-xl">{{dataType.templateColumns.find(i => i.title).key ? item[dataType.templateColumns.find(i => i.title).key] : null}}</p>
<p class="text-sm">
@@ -126,4 +127,4 @@
<style scoped>
</style>
</style>

View File

@@ -20,7 +20,7 @@ const links = computed(() => {
} else if (pin.type === "standardEntity") {
return {
label: pin.label,
to: `/standardEntity/${pin.datatype}/show/${pin.id}`,
to: pin.datatype === "tasks" ? `/tasks/show/${pin.id}` : `/standardEntity/${pin.datatype}/show/${pin.id}`,
icon: pin.icon,
pinned: true
}
@@ -47,7 +47,7 @@ const links = computed(() => {
children: [
...has("tasks") ? [{
label: "Aufgaben",
to: "/standardEntity/tasks",
to: "/tasks",
icon: "i-heroicons-rectangle-stack"
}] : [],
...true ? [{
@@ -278,6 +278,10 @@ const links = computed(() => {
label: "Projekttypen",
to: "/projecttypes",
icon: "i-heroicons-clipboard-document-list",
}, {
label: "Vertragstypen",
to: "/standardEntity/contracttypes",
icon: "i-heroicons-document-duplicate",
}, {
label: "Export",
to: "/export",
@@ -365,4 +369,4 @@ const buttonItems = computed(() =>
</UAccordion>
<Calculator v-if="showCalculator" v-model="showCalculator"/>
</template>
</template>

View File

@@ -0,0 +1,13 @@
<script setup>
const props = defineProps({
row: {
type: Object,
required: true,
default: {}
}
})
</script>
<template>
<span>{{ props.row.contracttype ? props.row.contracttype.name : '' }}</span>
</template>

View File

@@ -5,8 +5,11 @@ const router = useRouter()
const auth = useAuthStore()
const setupPage = async () => {
//TODO: BACKEND CHANGE Migrate to auth_users for profile
openTasks.value = (await useEntities("tasks").select()).filter(i => !i.archived && i.user_id === auth.user.id)
openTasks.value = (await useEntities("tasks").select()).filter((task) => {
const assignee = task.userId || task.user_id || task.profile
const currentUser = auth.user?.user_id || auth.user?.id
return !task.archived && assignee === currentUser
})
}
setupPage()
@@ -18,7 +21,7 @@ setupPage()
v-if="openTasks.length > 0"
:rows="openTasks"
:columns="[{key:'name',label:'Name'},{key:'categorie',label:'Kategorie'}]"
@select="(i) => router.push(`/standardEntity/tasks/show/${i.id}`)"
@select="(i) => router.push(`/tasks/show/${i.id}`)"
/>
<div v-else>
<p class="text-center font-bold">Keine offenen Aufgaben</p>
@@ -27,4 +30,4 @@ setupPage()
<style scoped>
</style>
</style>