1
0
mirror of https://github.com/TandoorRecipes/recipes.git synced 2026-01-11 17:16:59 -05:00

moved space stuff to database and reworked invite link backend logic

This commit is contained in:
vabene1111
2025-09-11 21:44:40 +02:00
parent ad4b1393dd
commit 723b74509f
46 changed files with 213 additions and 48 deletions

View File

@@ -35,6 +35,17 @@
<database-model-col model="MealType"></database-model-col>
</v-row>
<v-row>
<v-col>
<h2>{{ $t('Space') }}</h2>
</v-col>
</v-row>
<v-row dense>
<database-model-col model="Space"></database-model-col>
<database-model-col model="UserSpace"></database-model-col>
<database-model-col model="InviteLink"></database-model-col>
</v-row>
<template v-if="useUserPreferenceStore().activeSpace.aiEnabled">
<v-row>
<v-col>

View File

@@ -43,7 +43,7 @@
</v-row>
<v-row>
<v-col>
<v-text-field prepend-inner-icon="$search" :label="$t('Search')" v-model="query" clearable></v-text-field>
<v-text-field prepend-inner-icon="$search" :label="$t('Search')" v-model="query" v-if="!genericModel.model.disableSearch" clearable></v-text-field>
<v-data-table-server
v-model="selectedItems"
@@ -82,13 +82,16 @@
<v-chip label v-if="item.space == null" color="success">{{ $t('Global') }}</v-chip>
<v-chip label v-else color="info">{{ $t('Space') }}</v-chip>
</template>
<template v-slot:item.groups="{ item }" v-if="genericModel.model.name == 'UserSpace'">
{{item.groups.flatMap((x: Group) => x.name).join(', ')}}
</template>
<template v-slot:item.action="{ item }">
<v-btn class="float-right" icon="$menu" variant="plain">
<v-icon icon="$menu"></v-icon>
<v-menu activator="parent" close-on-content-click>
<v-list density="compact">
<v-list-item prepend-icon="$edit" :to="{name: 'ModelEditPage', params: {model: model, id: item.id}}"
v-if="!genericModel.model.disableCreate && !genericModel.model.disableUpdate && !genericModel.model.disableDelete">
v-if="!(genericModel.model.disableCreate && genericModel.model.disableUpdate && genericModel.model.disableDelete)">
{{ $t('Edit') }}
</v-list-item>
<v-list-item prepend-icon="fa-solid fa-arrows-to-dot" v-if="genericModel.model.isMerge" link>
@@ -144,7 +147,7 @@ import {useUserPreferenceStore} from "@/stores/UserPreferenceStore";
import ModelMergeDialog from "@/components/dialogs/ModelMergeDialog.vue";
import {VDataTableUpdateOptions} from "@/vuetify";
import SyncDialog from "@/components/dialogs/SyncDialog.vue";
import {ApiApi, ApiRecipeListRequest, RecipeImport} from "@/openapi";
import {ApiApi, ApiRecipeListRequest, Group, RecipeImport} from "@/openapi";
import {useTitle} from "@vueuse/core";
import RecipeShareDialog from "@/components/dialogs/RecipeShareDialog.vue";
import AddToShoppingDialog from "@/components/dialogs/AddToShoppingDialog.vue";

View File

@@ -64,8 +64,6 @@ import SearchPage from "@/pages/SearchPage.vue";
import {useUserPreferenceStore} from "@/stores/UserPreferenceStore";
import {useRouter} from "vue-router";
const router = useRouter()
const totalRecipes = ref(-1)
onMounted(() => {
@@ -74,10 +72,6 @@ onMounted(() => {
api.apiRecipeList({pageSize: 1}).then((r) => {
totalRecipes.value = r.count
})
if (!useUserPreferenceStore().activeSpace.spaceSetupCompleted) {
router.push({name: 'WelcomePage'})
}
})
</script>

View File

@@ -17,7 +17,7 @@
<v-stepper-window>
<v-stepper-window-item value="1">
<v-card flat>
<v-card-title class="text-h4">{{ $t('WelcometoTandoor') }}</v-card-title>
<v-card-title class="text-h4">{{ $t('WelcometoTandoor') }} <span class="text-tandoor">{{useUserPreferenceStore().userSettings.user.displayName}}</span></v-card-title>
<v-card-text v-if="space">
<p class="text-subtitle-1 mb-4">{{ $t('WelcomeSettingsHelp') }}</p>