Many Changes for 1.0
This commit is contained in:
@@ -52,17 +52,12 @@ const navLinks = [
|
||||
label: "Belege",
|
||||
to: "/receipts",
|
||||
icon: "i-heroicons-document-text"
|
||||
},
|
||||
/*{
|
||||
label: "Ausgangsrechnungen",
|
||||
to: "/customerinvoices",
|
||||
icon: "i-heroicons-document-text"
|
||||
},*/
|
||||
},/*
|
||||
{
|
||||
label: "Bank",
|
||||
to: "/banking",
|
||||
icon: "i-heroicons-currency-euro"
|
||||
},
|
||||
},*/
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -111,12 +106,12 @@ const navLinks = [
|
||||
icon: "i-heroicons-document"
|
||||
},
|
||||
]
|
||||
},
|
||||
},/*
|
||||
{
|
||||
label: "Chat",
|
||||
to: "/chat",
|
||||
icon:'i-heroicons-chat-bubble-left-right'
|
||||
},
|
||||
},*/
|
||||
{
|
||||
label: "Mitarbeiter",
|
||||
icon: 'i-heroicons-user',
|
||||
@@ -126,6 +121,11 @@ const navLinks = [
|
||||
to: "/employees/timetracking",
|
||||
icon: "i-heroicons-clock"
|
||||
},
|
||||
{
|
||||
label: "Stechuhr",
|
||||
to: "/workingtimes",
|
||||
icon: "i-heroicons-clock"
|
||||
},
|
||||
{
|
||||
label: "Abwesenheiten",
|
||||
to: "/absenceRequests",
|
||||
@@ -163,11 +163,11 @@ const navLinks = [
|
||||
|
||||
const showUserMenu = ref(false)
|
||||
const userMenuItems = ref([
|
||||
{
|
||||
/*{
|
||||
label: "Profil",
|
||||
badge: dataStore.notifications.filter(item => item.read).length,
|
||||
icon: "i-heroicons-user-20-solid"
|
||||
},
|
||||
},*/
|
||||
{
|
||||
label: "Nummernkreise",
|
||||
icon: "i-heroicons-cog-8-tooth",
|
||||
@@ -245,7 +245,7 @@ const userMenuItems = ref([
|
||||
:links="userMenuItems"
|
||||
/>
|
||||
|
||||
<UDivider
|
||||
<!-- <UDivider
|
||||
class="my-3"
|
||||
label="Benachrichtigungen"
|
||||
/>
|
||||
@@ -263,7 +263,7 @@ const userMenuItems = ref([
|
||||
if(error) console.log(error)
|
||||
dataStore.fetchNotifications()
|
||||
}"
|
||||
/>
|
||||
/>-->
|
||||
|
||||
|
||||
|
||||
|
||||
11
spaces/pages/banking/addAccount.vue
Normal file
11
spaces/pages/banking/addAccount.vue
Normal file
@@ -0,0 +1,11 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -178,7 +178,6 @@ const calendarOptionsTimeline = reactive({
|
||||
<template #header>
|
||||
Neuen Termin erstellen
|
||||
</template>
|
||||
{{newEventData.resources}}
|
||||
<UFormGroup
|
||||
label="Resource:"
|
||||
>
|
||||
|
||||
@@ -24,8 +24,10 @@ setupPage()
|
||||
Bearbeiten
|
||||
</UButton>
|
||||
</InputGroup>
|
||||
<DevOnly>
|
||||
{{itemInfo}}
|
||||
</DevOnly>
|
||||
|
||||
{{itemInfo}}
|
||||
|
||||
|
||||
<DocumentDisplay
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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"
|
||||
|
||||
41
spaces/pages/workingtimes.vue
Normal file
41
spaces/pages/workingtimes.vue
Normal 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>
|
||||
@@ -155,6 +155,66 @@ export const useDataStore = defineStore('data', () => {
|
||||
const chats = ref([])
|
||||
const messages = ref([])
|
||||
const createddocuments = ref([])
|
||||
const workingtimes = ref([])
|
||||
|
||||
|
||||
const rights = ref({
|
||||
createUser: {label: "Benutzer erstellen"},
|
||||
modifyUser: {label: "Benutzer bearbeiten"},
|
||||
deactivateUser: {label: "Benutzer sperren"},
|
||||
createProject: {label: "Projekt erstellen"},
|
||||
viewOwnProjects: {label: "Eigene Projekte sehen"},
|
||||
viewAllProjects: {label: "Alle Projekte sehen"},
|
||||
createTask: {label: "Aufgabe erstellen"},
|
||||
viewOwnTasks: {label:"Eigene Aufgaben sehen"},
|
||||
viewAllTasks: {label: "Alle Aufgaben sehen"},
|
||||
trackOwnTime: {label:"Eigene Zeite erfassen"},
|
||||
createOwnTime: {label:"Eigene Zeiten erstellen"},
|
||||
createTime: {label:"Zeiten erstellen"},
|
||||
viewOwnTimes: {label:"Eigene Zeiten anzeigen"},
|
||||
viewTimes: {label:"Zeiten anzeigen"},
|
||||
})
|
||||
|
||||
const roles = ref([
|
||||
{
|
||||
key: "tenantAdmin",
|
||||
label: "Firmenadministrator",
|
||||
rights: [
|
||||
...Object.keys(rights.value)
|
||||
]
|
||||
},
|
||||
{
|
||||
key:"worker",
|
||||
label: "Monteur",
|
||||
rights: [
|
||||
"viewOwnProjects",
|
||||
"createTasks",
|
||||
"viewOwnTasks",
|
||||
"viewOwnTimes",
|
||||
"createOwnTime"
|
||||
]
|
||||
},
|
||||
{
|
||||
key:"manager",
|
||||
label: "Vorarbeiter",
|
||||
rights: [
|
||||
"createProjects",
|
||||
"viewOwnProjects",
|
||||
"createTasks",
|
||||
"viewOwnTasks",
|
||||
]
|
||||
},
|
||||
{
|
||||
key:"booker",
|
||||
label: "Buchhalter",
|
||||
rights: [
|
||||
"createTasks",
|
||||
"viewOwnTasks",
|
||||
"createTime",
|
||||
"viewAllTimes"
|
||||
]
|
||||
}
|
||||
])
|
||||
|
||||
async function initializeData () {
|
||||
await fetchProfiles()
|
||||
@@ -175,7 +235,6 @@ export const useDataStore = defineStore('data', () => {
|
||||
|
||||
async function fetchData () {
|
||||
await fetchProfiles()
|
||||
|
||||
await fetchDocuments()
|
||||
await fetchOwnTenant()
|
||||
await fetchEvents()
|
||||
@@ -207,6 +266,7 @@ export const useDataStore = defineStore('data', () => {
|
||||
await fetchChats()
|
||||
await fetchMessages()
|
||||
await fetchCreatedDocuments()
|
||||
await fetchWorkingTimes()
|
||||
loaded.value = true
|
||||
}
|
||||
|
||||
@@ -245,8 +305,20 @@ export const useDataStore = defineStore('data', () => {
|
||||
chats.value = []
|
||||
messages.value = []
|
||||
createddocuments.value = []
|
||||
workingtimes.value = []
|
||||
}
|
||||
|
||||
function hasRight (right) {
|
||||
const role = profiles.value.find(i => i.id === user.value.id).role
|
||||
const grantedRights = roles.value.find(i => i.key === role).rights
|
||||
|
||||
if(grantedRights.includes(right)){
|
||||
return true
|
||||
} else return false
|
||||
|
||||
}
|
||||
|
||||
|
||||
//Realtime Update
|
||||
const channelA = supabase
|
||||
.channel('schema-db-changes')
|
||||
@@ -476,6 +548,10 @@ export const useDataStore = defineStore('data', () => {
|
||||
createddocuments.value = (await supabase.from("createddocuments").select().eq('tenant', currentTenant.value).order('created_at', {ascending:true})).data
|
||||
}
|
||||
|
||||
async function fetchWorkingTimes() {
|
||||
workingtimes.value = (await supabase.from("workingtimes").select().eq('tenant', currentTenant.value).order('created_at', {ascending:true})).data
|
||||
}
|
||||
|
||||
async function fetchDocuments () {
|
||||
let tempDocuments = (await supabase.from("documents").select().eq('tenant', currentTenant.value)).data
|
||||
|
||||
@@ -844,7 +920,7 @@ export const useDataStore = defineStore('data', () => {
|
||||
initializeData,
|
||||
changeTenant,
|
||||
uploadFiles,
|
||||
|
||||
hasRight,
|
||||
|
||||
//Data
|
||||
profiles,
|
||||
@@ -878,6 +954,7 @@ export const useDataStore = defineStore('data', () => {
|
||||
chats,
|
||||
messages,
|
||||
createddocuments,
|
||||
workingtimes,
|
||||
documentTypesForCreation,
|
||||
//Functions
|
||||
createNewItem,
|
||||
|
||||
Reference in New Issue
Block a user