-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Major overhaul (RecipeView
update, sections support, recipes list view, ...)
#2115
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2115 +/- ##
=======================================
Coverage 80.07% 80.07%
=======================================
Files 92 92
Lines 2650 2650
=======================================
Hits 2122 2122
Misses 528 528
Flags with carried forward coverage won't be shown. Click here to find out more. |
Test Results 12 files 572 suites 1m 31s ⏱️ Results for commit 54de35b. ♻️ This comment has been updated with latest results. |
4a16282
to
3005528
Compare
…nd `title-rename.js` to typescript Signed-off-by: Sebastian Fey <[email protected]>
…ema.org objects Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
…string/string[] Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
…ject. Signed-off-by: Sebastian Fey <[email protected]>
…ect. Signed-off-by: Sebastian Fey <[email protected]>
…oTool` object. Signed-off-by: Sebastian Fey <[email protected]>
…ToDirection` object. Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
…nd `QuantitativeValue`. Signed-off-by: Sebastian Fey <[email protected]>
…Tool`. Signed-off-by: Sebastian Fey <[email protected]>
…wToSection`. Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
…imple strings for `tool`, `recipeInstructions`, and `supply` properties Signed-off-by: Sebastian Fey <[email protected]>
…uctions`, and `supply` properties to `fromJSON` method of `Recipe`. Signed-off-by: Sebastian Fey <[email protected]>
…ud/axios usage. Fix wrong import order in `HowToTool` Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
…uter . Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
…issing route names. Fix 'All recipes' view. Signed-off-by: Sebastian Fey <[email protected]>
…s without requiring page reload. Signed-off-by: Sebastian Fey <[email protected]>
RecipeView
update, sections support, recipes list view, ...)
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
…ounts of `HowToSupply`s Signed-off-by: Sebastian Fey <[email protected]>
…d add tests Signed-off-by: Sebastian Fey <[email protected]>
…up. Closes #2114 Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
…and list Signed-off-by: Sebastian Fey <[email protected]>
…d from list. Signed-off-by: Sebastian Fey <[email protected]>
Signed-off-by: Sebastian Fey <[email protected]>
…ries to recipe filters Signed-off-by: Sebastian Fey <[email protected]>
Topic and Scope
A lot of the UI is touched, with a focus on the
RecipeView
.This PRs goal is manifold:
schema.org
entities should provide a cleaner way of dealing with recipe datasupply
, which would allow structuring ingredients<router-view>
s the need for a different structure of the URLSome minor changes/fixes that popped up during development include additional helper functions, file restructuring, improving the Jest config and reworking the
RecipeView
:Related: #382 #428 #311 #135 #1875 #1244
Closes #1855 closes #2114
Currently supported in
RecipeView
HowToSection
sHowToSection
's titleHowToSection
's descriptionHowToSection
's sub-stepsHowToTip
s inHowToSection
HowToSection
s,HowToStep
s and stringsHowToSection
s (At some point this might even be confusing for the user) Note: In a meeting w/ the NC design team, we decided not to support nested sections (for now).HowToDirection
s in aHowToSection
HowToDirection
s in aHowToSection
HowToTip
s inHowToStep
HowToTool
objects inRecipe
HowToSupply
objects inRecipe
NutritionInformation
objects inRecipe
Concerns/issues
Currently the UI does not support
We need to consider how to handle recipes where both
supply
andrecipeIngredient
are defined.Supported properties are checked for their correctness, but additional properties, e.g., those allowed by the
schema.org
standard that are not supported in our app are currently ignored.Recipes List
Restructured paths
With the introduction of the list view which required additional
<router-view>
s the need for a different structure of the URLs appeared that allows defining the selected (filtered) list of recipes as well as a selected recipe. Currently the routes look like:category/:value
tags/:value
search/:value
for filtering/searching the available recipes. These paths can remain the same. However if additional filters are applied, they are added as query parameters.
category/:value?q=tag%3A%2522spicy%2522
(?q=tag:"spicy"
)When viewing a recipe the user was directed to
recipe/:id
This would loose the information that the recipe was, e.g., selected from a list of recipes within a specific category, maybe filtered down by certain parameters. This PR introduces new paths in the form of
category/:value/:id?q=tag%3A%2522spicy%2522
(?q=tag:"spicy"
)`where
id
is the recipe identifier. Navigating to the URL will show the same view as before when the list view is selected: A filtered list with the recipe open next to it. For editing the recipe the pathcategory/:value/:id/edit?q=tag%3A%2522spicy%2522
is introduced.
Try out locally
Although the backend does not support the current structure it is possible to test this locally. You may start with copying the JSON code to a
recipe.json
file in a new subdirectory of theRecipes/
folder. If you wish you can download some image and add it asfull.jpg
to the same folder.Then you need to make two tweaks to the PHP code. In
FixInstructionsFilter.php
early return the apply functionand in
FixToolsFilter.php
in theapply
function remove the else block and early returnPreview
Current state of the
RecipeView
. The following JSON produces below imageRecipe JSON
RecipeView
:Details sidebar opened:
Recipe sections
Clicking an image opens a modal with a slideshow of the full images:
Wide screen
The width of the recipe content is limited to maintain readability
Narrow screen
List view
Filtering:
Filter modal opened:
Filter selected (URL gets updated to
${HOST}/index.php/apps/cookbook/#/category/Dinner/412?q=tag%3A%2522spicy%2522
):Formal requirements
There are some formal requirements that should be satisfied. Please mark those by checking the corresponding box.