Many Changes for 1.0

This commit is contained in:
2024-02-04 20:21:09 +01:00
parent bd09d07698
commit fa661ff6b3
17 changed files with 1220 additions and 88 deletions

View File

@@ -0,0 +1,11 @@
<script setup>
</script>
<template>
</template>
<style scoped>
</style>

View File

@@ -178,7 +178,6 @@ const calendarOptionsTimeline = reactive({
<template #header>
Neuen Termin erstellen
</template>
{{newEventData.resources}}
<UFormGroup
label="Resource:"
>

View File

@@ -24,8 +24,10 @@ setupPage()
Bearbeiten
</UButton>
</InputGroup>
<DevOnly>
{{itemInfo}}
</DevOnly>
{{itemInfo}}
<DocumentDisplay

View File

@@ -13,6 +13,7 @@ const supabase = useSupabaseClient()
const user = useSupabaseUser()
const toast = useToast()
const timeTypes = dataStore.getTimeTypes
const timeInfo = ref({
user: "",
@@ -28,12 +29,20 @@ const filterUser = ref(user.value.id || "")
const filteredRows = computed(() => {
if(filterUser.value !== "" && dataStore.times) {
return dataStore.times.filter(time => time.user === filterUser.value)
let times = dataStore.times
if(dataStore.hasRight('viewTimes')) {
if(filterUser.value !== "") {
times = times.filter(i => i.user === filterUser.value)
}
} else if(dataStore.hasRight('viewOwnTimes')) {
times = times.filter(i => i.user === user.value.id)
} else {
return dataStore.times
times = []
}
return times
})
@@ -210,7 +219,7 @@ const setState = async (newState) => {
<InputGroup>
<UButton
@click="startTime"
:disabled="runningTimeInfo.id"
:disabled="runningTimeInfo.id "
>
Start
</UButton>
@@ -221,11 +230,12 @@ const setState = async (newState) => {
Stop
</UButton>
<UButton
@click="configTimeMode = 'create'; itemInfo = {start: new Date(), end: new Date()}; showConfigTimeModal = true"
@click="configTimeMode = 'create'; itemInfo = {start: new Date(), end: new Date(), user: user.id}; showConfigTimeModal = true"
>
Erstellen
</UButton>
<USelectMenu
v-if="dataStore.hasRight('viewTimes')"
:options="dataStore.profiles"
option-attribute="fullName"
value-attribute="id"
@@ -321,13 +331,6 @@ const setState = async (newState) => {
:disabled="configTimeMode === 'create' ? false : itemInfo.state !== 'Entwurf'"
/>
</UFormGroup>
<!-- <UFormGroup
label="Dauer:"
>
<UInput
/>
</UFormGroup>-->
<UFormGroup
label="Benutzer:"
>
@@ -336,10 +339,10 @@ const setState = async (newState) => {
v-model="itemInfo.user"
option-attribute="fullName"
value-attribute="id"
:disabled="configTimeMode === 'create' ? false : itemInfo.state !== 'Entwurf'"
:disabled="(configTimeMode === 'create' ? false : itemInfo.state !== 'Entwurf') || (!dataStore.hasRight('createTime') || !dataStore.hasRight('createOwnTime'))"
>
<template #label>
{{dataStore.profiles.find(profile => profile.id === itemInfo.user) ? dataStore.profiles.find(profile => profile.id === itemInfo.user).firstName : "Benutzer auswählen"}}
{{dataStore.profiles.find(profile => profile.id === itemInfo.user) ? dataStore.profiles.find(profile => profile.id === itemInfo.user).fullName : "Benutzer auswählen"}}
</template>
</USelectMenu>
</UFormGroup>

View File

@@ -15,11 +15,11 @@
createTask: {label: "Aufgabe erstellen"},
viewOwnTasks: {label:"Eigene Aufgaben sehen"},
viewAllTasks: {label: "Alle Aufgaben sehen"},
trackOwnTime: {label:""},
createOwnTime: {label:""},
createTime: {label:""},
viewOwnTimes: {label:""},
viewAllTimesTimes: {label:""},
trackOwnTime: {label:"Eigene Zeite erfassen"},
createOwnTime: {label:"Eigene Zeiten erstellen"},
createTime: {label:"Zeiten erstellen"},
viewOwnTimes: {label:"Eigene Zeiten anzeigen"},
viewTimes: {label:"Zeiten anzeigen"},
}
let roles = [

View File

@@ -7,21 +7,13 @@ const router = useRouter()
const columns = [
{
key:"id",
label: "Id"
},
{
key:"firstName",
label: "Vorname:",
},
{
key: "lastName",
label: "Nachname:"
},
key:"fullName",
label: "Name",
},/*
{
key: "username",
label: "Benutzername"
},
},*/
{
key: "role",
label: "Rolle"

View File

@@ -0,0 +1,41 @@
<script setup>
import dayjs from "dayjs";
const dataStore = useDataStore()
const timeColumns = [
{
key: "state",
label: "Status"
},
{
key: "user",
label: "Mitarbeiter"
}, {
key: "date",
label: "Datum"
}, {
key: "start",
label: "Start"
}, {
key: "end",
label: "Ende"
}
]
</script>
<template>
<UTable
:rows="dataStore.workingtimes"
:columns="timeColumns"
>
<template #user-data="{row}">
{{dataStore.getProfileById(row.user).fullName }}
</template>
</UTable>
</template>
<style scoped>
</style>