Fixed auth, NAV, projecttypes,numberranges,tenant,textemplates

This commit is contained in:
2025-09-07 19:26:46 +02:00
parent 34c5764472
commit 949b094490
7 changed files with 129 additions and 125 deletions

View File

@@ -21,8 +21,6 @@ defineShortcuts({
})
const openTab = ref(0)
const dataStore = useDataStore()
const supabase = useSupabaseClient()
const route = useRoute()
const router = useRouter()
const toast = useToast()
@@ -53,9 +51,9 @@ const setKeys = () => {
const setupPage = async() => {
if(mode.value === "show" ){
itemInfo.value = await useSupabaseSelectSingle("projecttypes",route.params.id,"*")
itemInfo.value = await useEntities("projecttypes").selectSingle(route.params.id,"*")
} else if (mode.value === "edit") {
itemInfo.value = await useSupabaseSelectSingle("projecttypes",route.params.id,"*")
itemInfo.value = await useEntities("projecttypes").selectSingle(route.params.id,"*")
}
if(mode.value === "create") {
@@ -74,7 +72,7 @@ setupPage()
const addPhase = () => {
itemInfo.value.initialPhases.push({label: '', icon: ''}),
setKeys
setKeys
}
</script>
@@ -99,13 +97,13 @@ const addPhase = () => {
<template #right>
<UButton
v-if="mode === 'edit'"
@click="dataStore.updateItem('projecttypes',itemInfo,oldItemInfo)"
@click="useEntities('projecttypes').update(itemInfo.id, itemInfo)"
>
Speichern
</UButton>
<UButton
v-else-if="mode === 'create'"
@click="dataStore.createNewItem('projecttypes', itemInfo)"
@click="useEntities('projecttypes').create( itemInfo)"
>
Erstellen
</UButton>
@@ -158,7 +156,7 @@ const addPhase = () => {
variant="outline"
class="mb-5"
v-if="mode === 'edit'"
description="Achtung Änderungen an diesem Projekttypen betreffen nur Projekte die damit neu erstellt werden. Bestehende Projekte bleiben unverändert."
description="Achtung Änderungen an diesem Projekttypen betreffen nur Projekte die damit neu erstellt werden. Bestehende Projekte bleiben unverändert."
/>
<UFormGroup
@@ -242,9 +240,9 @@ const addPhase = () => {
selectedKeyForQuickAction = phase.key"
>+ Schnellaktion</UButton>
<UButton
@click="phase.quickactions = phase.quickactions.filter(i => i.label !== button.label)"
v-for="button in phase.quickactions"
class="ml-1"
@click="phase.quickactions = phase.quickactions.filter(i => i.label !== button.label)"
v-for="button in phase.quickactions"
class="ml-1"
>
{{ button.label }}
</UButton>

View File

@@ -17,14 +17,14 @@ defineShortcuts({
}
},
'arrowdown': () => {
if(selectedItem.value < filteredRows.value.length - 1) {
if (selectedItem.value < filteredRows.value.length - 1) {
selectedItem.value += 1
} else {
selectedItem.value = 0
}
},
'arrowup': () => {
if(selectedItem.value === 0) {
if (selectedItem.value === 0) {
selectedItem.value = filteredRows.value.length - 1
} else {
selectedItem.value -= 1
@@ -34,14 +34,14 @@ defineShortcuts({
const router = useRouter()
const tempStore = useTempStore()
const items = ref([])
const selectedItem = ref(0)
const setup = async () => {
items.value = await useSupabaseSelect("projecttypes","*")
items.value = await useEntities("projecttypes").select()
}
setup()
@@ -56,7 +56,7 @@ const templateColumns = [
const selectedColumns = ref(templateColumns)
const columns = computed(() => templateColumns.filter((column) => selectedColumns.value.includes(column)))
const searchString = ref("")
const searchString = ref(tempStore.searchStrings["projecttypes"] || '')
const filteredRows = computed(() => {
return useListFilter(searchString.value, items.value)
@@ -75,9 +75,10 @@ const filteredRows = computed(() => {
placeholder="Suche..."
class="hidden lg:block"
@keydown.esc="$event.target.blur()"
@change="tempStore.modifySearchString('projecttypes',searchString)"
>
<template #trailing>
<UKbd value="/" />
<UKbd value="/"/>
</template>
</UInput>
@@ -94,8 +95,8 @@ const filteredRows = computed(() => {
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Projekttypen anzuzeigen' }"
>
<template #name-data="{row}">
<span class="text-primary-500 font-bold" v-if="row === filteredRows[selectedItem]">{{row.name}}</span>
<span v-else>{{row.name}}</span>
<span class="text-primary-500 font-bold" v-if="row === filteredRows[selectedItem]">{{ row.name }}</span>
<span v-else>{{ row.name }}</span>
</template>
</UTable>