Added Content to HelpSlideover

Added Shortcut to Settings
Added Feature Disabling Settings to tenant.vue
This commit is contained in:
2024-04-07 12:44:23 +02:00
parent 7c162f157a
commit 281f3562ec
6 changed files with 74 additions and 22 deletions

View File

@@ -9,16 +9,15 @@ const links = [{
label: 'Shortcuts', label: 'Shortcuts',
icon: 'i-heroicons-key', icon: 'i-heroicons-key',
trailingIcon: 'i-heroicons-arrow-right-20-solid', trailingIcon: 'i-heroicons-arrow-right-20-solid',
color: 'gray',
onClick: () => { onClick: () => {
shortcuts.value = true shortcuts.value = true
} }
}, { }, {
label: 'Documentation', label: 'Documentation',
icon: 'i-heroicons-book-open', icon: 'i-heroicons-book-open',
to: 'https://ui.nuxt.com/pro/guide', to: 'https://fedeo.de',
target: '_blank' target: '_blank'
}, { }/*, {
label: 'GitHub repository', label: 'GitHub repository',
icon: 'i-simple-icons-github', icon: 'i-simple-icons-github',
to: 'https://github.com/nuxt/ui-pro', to: 'https://github.com/nuxt/ui-pro',
@@ -28,31 +27,32 @@ const links = [{
icon: 'i-heroicons-credit-card', icon: 'i-heroicons-credit-card',
to: 'https://ui.nuxt.com/pro/purchase', to: 'https://ui.nuxt.com/pro/purchase',
target: '_blank' target: '_blank'
}] }*/]
const categories = computed(() => [{ const categories = computed(() => [{
title: 'General', title: 'General',
items: [ items: [
{ shortcuts: [metaSymbol.value, 'K'], name: 'Command menu' }, { shortcuts: [metaSymbol.value, 'K'], name: 'Hauptmenü' },
{ shortcuts: ['N'], name: 'Notifications' }, { shortcuts: ['N'], name: 'Benachrichtigungen' },
{ shortcuts: ['?'], name: 'Help & Support' }, { shortcuts: ['?'], name: 'Help & Support' },
{ shortcuts: ['/'], name: 'Search' } { shortcuts: ['/'], name: 'Suche' }
] ]
}, { }, {
title: 'Navigation', title: 'Navigation',
items: [ items: [
{ shortcuts: ['G', 'H'], name: 'Go to Home' }, { shortcuts: ['G', 'H'], name: 'Gehe zu Dashboard' },
{ shortcuts: ['G', 'A'], name: 'Gehe zu Aufgaben' },/*
{ shortcuts: ['G', 'I'], name: 'Go to Inbox' }, { shortcuts: ['G', 'I'], name: 'Go to Inbox' },
{ shortcuts: ['G', 'U'], name: 'Go to Users' }, { shortcuts: ['G', 'U'], name: 'Go to Users' },*/
{ shortcuts: ['G', 'S'], name: 'Go to Settings' } { shortcuts: ['G', 'S'], name: 'Gehe zu Einstellungen' }
] ]
}, { }, /*{
title: 'Inbox', title: 'Inbox',
items: [ items: [
{ shortcuts: ['↑'], name: 'Prev notification' }, { shortcuts: ['↑'], name: 'Prev notification' },
{ shortcuts: ['↓'], name: 'Next notification' } { shortcuts: ['↓'], name: 'Next notification' }
] ]
}]) }*/])
const filteredCategories = computed(() => { const filteredCategories = computed(() => {
return categories.value.map(category => ({ return categories.value.map(category => ({
@@ -66,7 +66,7 @@ const filteredCategories = computed(() => {
<template> <template>
<UDashboardSlideover v-model="isHelpSlideoverOpen"> <UDashboardSlideover v-model="isHelpSlideoverOpen">
<!-- <template #title> <template #title>
<UButton <UButton
v-if="shortcuts" v-if="shortcuts"
color="gray" color="gray"
@@ -102,6 +102,6 @@ const filteredCategories = computed(() => {
</div> </div>
<div v-else class="flex flex-col gap-y-3"> <div v-else class="flex flex-col gap-y-3">
<UButton v-for="(link, index) in links" :key="index" color="white" v-bind="link" /> <UButton v-for="(link, index) in links" :key="index" color="white" v-bind="link" />
</div>--> </div>
</UDashboardSlideover> </UDashboardSlideover>
</template> </template>

View File

@@ -5,7 +5,6 @@ const supabase = useSupabaseClient()
//const tenant = ref(dataStore.currentTenant) //const tenant = ref(dataStore.currentTenant)
const selectedProfile = ref(dataStore.activeProfile.id) const selectedProfile = ref(dataStore.activeProfile.id)
console.log(dataStore.ownProfiles)
</script> </script>
<template> <template>

View File

@@ -9,6 +9,7 @@ const _useDashboard = () => {
defineShortcuts({ defineShortcuts({
'g-h': () => router.push('/'), 'g-h': () => router.push('/'),
'g-a': () => router.push('/tasks'), 'g-a': () => router.push('/tasks'),
'g-s': () => router.push('/settings'),
'?': () => isHelpSlideoverOpen.value = !isHelpSlideoverOpen.value, '?': () => isHelpSlideoverOpen.value = !isHelpSlideoverOpen.value,
n: () => isNotificationsSlideoverOpen.value = !isNotificationsSlideoverOpen.value n: () => isNotificationsSlideoverOpen.value = !isNotificationsSlideoverOpen.value
}) })

View File

@@ -1,6 +1,5 @@
<script setup> <script setup>
import TenantDropdown from "~/components/ProfileDropdown.vue";
const dataStore = useDataStore() const dataStore = useDataStore()
const colorMode = useColorMode() const colorMode = useColorMode()
@@ -12,7 +11,7 @@ const route = useRoute()
dataStore.initializeData((await supabase.auth.getUser()).data.user.id) dataStore.initializeData((await supabase.auth.getUser()).data.user.id)
const isLight = computed({ /*const isLight = computed({
get() { get() {
return colorMode.value !== 'dark' return colorMode.value !== 'dark'
}, },
@@ -115,12 +114,12 @@ const navLinks = [
icon: "i-heroicons-envelope" icon: "i-heroicons-envelope"
}, },
] ]
},/* },/!*
{ {
label: "Chat", label: "Chat",
to: "/chat", to: "/chat",
icon:'i-heroicons-chat-bubble-left-right' icon:'i-heroicons-chat-bubble-left-right'
},*/ },*!/
{ {
label: "Mitarbeiter", label: "Mitarbeiter",
icon: 'i-heroicons-user', icon: 'i-heroicons-user',
@@ -172,7 +171,7 @@ const navLinks = [
}, },
] ]
}, },
] ]*/
//const activeFeatures = dataStore.tenants.find(dataStore.currentTenant).features //const activeFeatures = dataStore.tenants.find(dataStore.currentTenant).features

View File

@@ -1,5 +1,17 @@
<script setup> <script setup>
const dataStore = useDataStore()
const supabase = useSupabaseClient()
const features = ref(dataStore.ownTenant.features)
const updateTenant = async () => {
const {data,error} = await supabase.from("tenants")
.update({features: features.value})
.eq("id",dataStore.currentTenant)
.select()
}
</script> </script>
<template> <template>
@@ -13,6 +25,8 @@
label: 'Rechnung & Kontakt' label: 'Rechnung & Kontakt'
},{ },{
label: 'Lizenz' label: 'Lizenz'
},{
label: 'Funktionen'
},{ },{
label: 'Bankkonten' label: 'Bankkonten'
},{ },{
@@ -25,6 +39,45 @@
<div v-if="item.label === 'Rechnung & Kontakt'"> <div v-if="item.label === 'Rechnung & Kontakt'">
</div> </div>
<div v-else-if="item.label === 'Funktionen'">
<UAlert
title="Funktionen ausblenden"
description="Nur Funktionen mit gesetztem Haken sind im Unternehmen verfügbar. Diese Einstellungen gelten für alle Mitarbeiter und sind unabhängig von Berechtigungen."
color="rose"
variant="outline"
class="mb-5"
/>
<UCheckbox
label="Kalendar"
v-model="features.calendar"
@change="updateTenant"
/>
<UCheckbox
label="Plantafel"
v-model="features.planningBoard"
@change="updateTenant"
/>
<UCheckbox
label="Zeiterfassung"
v-model="features.timeTracking"
@change="updateTenant"
/>
<UCheckbox
label="Anwesenheiten"
v-model="features.workingTimeTracking"
@change="updateTenant"
/>
<UCheckbox
label="Verträge"
v-model="features.contracts"
@change="updateTenant"
/>
<UCheckbox
label="Fahrzeuge"
v-model="features.vehicles"
@change="updateTenant"
/>
</div>
</UCard> </UCard>
</template> </template>
</UTabs> </UTabs>

View File

@@ -570,8 +570,8 @@ export const useDataStore = defineStore('data', () => {
async function fetchOwnProfiles () { async function fetchOwnProfiles () {
let profiles = (await supabase.from("profiles").select().order("fullName")).data let profiles = (await supabase.from("profiles").select().order("fullName")).data
let conns = (await supabase.from("profileconnections").select()).data.map(i => i.profile_id) let conns = (await supabase.from("profileconnections").select()).data.map(i => i.profile_id)
console.log(conns) //console.log(conns)
console.log(profiles.filter(i => conns.includes(i.id))) //console.log(profiles.filter(i => conns.includes(i.id)))
ownProfiles.value = profiles.filter(i => conns.includes(i.id)) ownProfiles.value = profiles.filter(i => conns.includes(i.id))
} }