Feature/recipe instructions improvements (#785)

* feat(frontend):  split paragraph by 1. 1) or 1: regex matches

* feat(frontend):  Update frontend to support ingredient To step refs

* feat(backend):  Update backend to support ingredient to step refs

* fix title editor

* move about info to site-settings

* update change-log

Co-authored-by: Hayden K <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-11-05 15:48:10 -08:00
committed by GitHub
parent 9f8c61a75a
commit 5cb4a1ade0
22 changed files with 621 additions and 210 deletions

View File

@@ -43,7 +43,7 @@ class RecipeIngredient(CamelModel):
# Ref is used as a way to distinguish between an individual ingredient on the frontend
# It is required for the reorder and section titles to function properly because of how
# Vue handles reactivity. ref may serve another purpose in the future.
ref: UUID = Field(default_factory=uuid4)
reference_id: UUID = Field(default_factory=uuid4)
class Config:
orm_mode = True

View File

@@ -1,11 +1,24 @@
from typing import Optional
from uuid import UUID
from fastapi_camelcase import CamelModel
class IngredientReferences(CamelModel):
"""
A list of ingredient references.
"""
reference_id: UUID = None
class Config:
orm_mode = True
class RecipeStep(CamelModel):
title: Optional[str] = ""
text: str
ingredient_references: list[IngredientReferences] = []
class Config:
orm_mode = True