mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-25 08:09:41 +02:00
feat: "I Made This" Dialog (#1801)
* added chef hat * removed unnecessary log * modified recipe and recipe timeline event schema changed timeline event "message" -> "event_message" added "last made" timestamp to recipe * added "I made this" dialog to recipe action menu * added missing field and re-ran code-gen * moved dialog out of context menu and refactored removed references in action menu and context menu refactored dialog to be triggered by a button instead added route to update recipe last made timestamp added visual for last made timestamp to recipe header and title * added sorting by last made * switched event type to comment * replaced alter column with pydantic alias * added tests for event message alias
This commit is contained in:
parent
f0e6496001
commit
a2dcdc1adf
20 changed files with 275 additions and 9 deletions
|
@ -103,6 +103,7 @@ export interface RecipeSummary {
|
|||
dateUpdated?: string;
|
||||
createdAt?: string;
|
||||
updateAt?: string;
|
||||
lastMade?: string;
|
||||
}
|
||||
export interface RecipeCategory {
|
||||
id?: string;
|
||||
|
|
|
@ -88,6 +88,7 @@ export interface RecipeSummary {
|
|||
dateUpdated?: string;
|
||||
createdAt?: string;
|
||||
updateAt?: string;
|
||||
lastMade?: string;
|
||||
}
|
||||
export interface RecipeCategory {
|
||||
id?: string;
|
||||
|
|
|
@ -396,6 +396,7 @@ export interface RecipeSummary {
|
|||
dateUpdated?: string;
|
||||
createdAt?: string;
|
||||
updateAt?: string;
|
||||
lastMade?: string;
|
||||
}
|
||||
export interface RecipeCategory {
|
||||
id?: string;
|
||||
|
|
|
@ -118,6 +118,7 @@ export interface RecipeSummary {
|
|||
dateUpdated?: string;
|
||||
createdAt?: string;
|
||||
updateAt?: string;
|
||||
lastMade?: string;
|
||||
}
|
||||
export interface RecipeCategory {
|
||||
id?: string;
|
||||
|
|
|
@ -211,6 +211,7 @@ export interface Recipe {
|
|||
dateUpdated?: string;
|
||||
createdAt?: string;
|
||||
updateAt?: string;
|
||||
lastMade?: string;
|
||||
recipeInstructions?: RecipeStep[];
|
||||
nutrition?: Nutrition;
|
||||
settings?: RecipeSettings;
|
||||
|
@ -286,6 +287,7 @@ export interface RecipeSummary {
|
|||
dateUpdated?: string;
|
||||
createdAt?: string;
|
||||
updateAt?: string;
|
||||
lastMade?: string;
|
||||
}
|
||||
export interface RecipeCommentCreate {
|
||||
recipeId: string;
|
||||
|
@ -345,7 +347,7 @@ export interface RecipeTimelineEventCreate {
|
|||
userId: string;
|
||||
subject: string;
|
||||
eventType: TimelineEventType;
|
||||
message?: string;
|
||||
eventMessage?: string;
|
||||
image?: string;
|
||||
timestamp?: string;
|
||||
recipeId: string;
|
||||
|
@ -354,7 +356,7 @@ export interface RecipeTimelineEventIn {
|
|||
userId?: string;
|
||||
subject: string;
|
||||
eventType: TimelineEventType;
|
||||
message?: string;
|
||||
eventMessage?: string;
|
||||
image?: string;
|
||||
timestamp?: string;
|
||||
}
|
||||
|
@ -362,7 +364,7 @@ export interface RecipeTimelineEventOut {
|
|||
userId: string;
|
||||
subject: string;
|
||||
eventType: TimelineEventType;
|
||||
message?: string;
|
||||
eventMessage?: string;
|
||||
image?: string;
|
||||
timestamp?: string;
|
||||
recipeId: string;
|
||||
|
@ -372,7 +374,7 @@ export interface RecipeTimelineEventOut {
|
|||
}
|
||||
export interface RecipeTimelineEventUpdate {
|
||||
subject: string;
|
||||
message?: string;
|
||||
eventMessage?: string;
|
||||
image?: string;
|
||||
}
|
||||
export interface RecipeToolCreate {
|
||||
|
|
|
@ -192,6 +192,7 @@ export interface RecipeSummary {
|
|||
dateUpdated?: string;
|
||||
createdAt?: string;
|
||||
updateAt?: string;
|
||||
lastMade?: string;
|
||||
}
|
||||
export interface RecipeCategory {
|
||||
id?: string;
|
||||
|
|
|
@ -10,6 +10,7 @@ import {
|
|||
ParsedIngredient,
|
||||
UpdateImageResponse,
|
||||
RecipeZipTokenResponse,
|
||||
RecipeTimelineEventIn,
|
||||
} from "~/lib/api/types/recipe";
|
||||
import { ApiRequestInstance } from "~/lib/api/types/non-generated";
|
||||
|
||||
|
@ -44,6 +45,9 @@ const routes = {
|
|||
|
||||
recipesSlugComments: (slug: string) => `${prefix}/recipes/${slug}/comments`,
|
||||
recipesSlugCommentsId: (slug: string, id: number) => `${prefix}/recipes/${slug}/comments/${id}`,
|
||||
|
||||
recipesSlugTimelineEvent: (slug: string) => `${prefix}/recipes/${slug}/timeline/events`,
|
||||
recipesSlugTimelineEventId: (slug: string, id: number) => `${prefix}/recipes/${slug}/timeline/events/${id}`,
|
||||
};
|
||||
|
||||
export class RecipeAPI extends BaseCRUDAPI<CreateRecipe, Recipe, Recipe> {
|
||||
|
@ -126,4 +130,8 @@ export class RecipeAPI extends BaseCRUDAPI<CreateRecipe, Recipe, Recipe> {
|
|||
|
||||
return await this.requests.post(routes.recipesCreateFromOcr, formData);
|
||||
}
|
||||
|
||||
async createTimelineEvent(recipeSlug: string, payload: RecipeTimelineEventIn) {
|
||||
return await this.requests.post(routes.recipesSlugTimelineEvent(recipeSlug), payload);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue