1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-02 20:15:24 +02:00

feat: support require_all property for cookbooks (#1130)

* add direction prop for icon position

* add support for require_all properties on cookbook

* update type annotations

* add and - or filter support

* update cookbook API

* generate types

* implement editor for additional options

* update version number
This commit is contained in:
Hayden 2022-04-03 16:32:58 -08:00 committed by GitHub
parent c988de1921
commit 10784b6e24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 129 additions and 13 deletions

View file

@ -1,6 +1,6 @@
<template>
<div class="text-center">
<v-menu top offset-y left open-on-hover>
<v-menu top offset-y :right="right" :left="!right" open-on-hover>
<template #activator="{ on, attrs }">
<v-btn :small="small" icon v-bind="attrs" v-on="on" @click.stop>
<v-icon :small="small"> {{ $globals.icons.help }} </v-icon>
@ -24,6 +24,10 @@ export default defineComponent({
type: Boolean,
default: false,
},
right: {
type: Boolean,
default: false,
},
},
});
</script>

View file

@ -41,16 +41,35 @@
:items="allCategories || []"
selector-type="category"
/>
<RecipeOrganizerSelector v-model="cookbooks[index].tags" :items="allTags || []" selector-type="tag" />
<RecipeOrganizerSelector v-model="cookbooks[index].tools" :items="tools || []" selector-type="tool" />
<v-switch v-model="cookbooks[index].public">
<v-switch v-model="cookbooks[index].public" hide-details single-line>
<template #label>
Public Cookbook
<HelpIcon class="ml-4">
<HelpIcon small right class="ml-2">
Public Cookbooks can be shared with non-mealie users and will be displayed on your groups page.
</HelpIcon>
</template>
</v-switch>
<div class="mt-4">
<h3 class="text-subtitle-1 d-flex align-center mb-0 pb-0">
Filter Options
<HelpIcon right small class="ml-2">
When require all is selected the cookbook will only include recipes that have all of the items
selected. This applies to each subset of selectors and not a cross section of the selected items.
</HelpIcon>
</h3>
<v-switch v-model="cookbooks[index].requireAllCategories" class="mt-0" hide-details single-line>
<template #label> Require All Categories </template>
</v-switch>
<v-switch v-model="cookbooks[index].requireAllTags" hide-details single-line>
<template #label> Require All Tags </template>
</v-switch>
<v-switch v-model="cookbooks[index].requireAllTools" hide-details single-line>
<template #label> Require All Tools </template>
</v-switch>
</div>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>

View file

@ -19,6 +19,9 @@ export interface CreateCookBook {
categories?: CategoryBase[];
tags?: TagBase[];
tools?: RecipeTool[];
requireAllCategories?: boolean;
requireAllTags?: boolean;
requireAllTools?: boolean;
}
export interface TagBase {
name: string;
@ -40,6 +43,9 @@ export interface ReadCookBook {
categories?: CategoryBase[];
tags?: TagBase[];
tools?: RecipeTool[];
requireAllCategories?: boolean;
requireAllTags?: boolean;
requireAllTools?: boolean;
groupId: string;
id: string;
}
@ -52,6 +58,9 @@ export interface RecipeCookBook {
categories?: CategoryBase[];
tags?: TagBase[];
tools?: RecipeTool[];
requireAllCategories?: boolean;
requireAllTags?: boolean;
requireAllTools?: boolean;
groupId: string;
id: string;
recipes: RecipeSummary[];
@ -138,6 +147,9 @@ export interface SaveCookBook {
categories?: CategoryBase[];
tags?: TagBase[];
tools?: RecipeTool[];
requireAllCategories?: boolean;
requireAllTags?: boolean;
requireAllTools?: boolean;
groupId: string;
}
export interface UpdateCookBook {
@ -149,6 +161,9 @@ export interface UpdateCookBook {
categories?: CategoryBase[];
tags?: TagBase[];
tools?: RecipeTool[];
requireAllCategories?: boolean;
requireAllTags?: boolean;
requireAllTools?: boolean;
groupId: string;
id: string;
}

View file

@ -229,7 +229,7 @@ export interface RecipeCommentOut {
user: UserBase;
}
export interface UserBase {
id: number;
id: string;
username?: string;
admin: boolean;
}