diff --git a/CHANGELOG.md b/CHANGELOG.md index 81fe04b..9448d56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Yummy Changelog +## [2.7.0] - 2022-08-23 + +- [mjkuranda]: Meals without image render no image photo. + +### Added + +- New sections in `README.md` file such us: `Using`, `Yummy for developers`. +- Improved `README.md` file. + +### Changed + +- No image photo for meals without image. + ## [2.6.3] - 2022-08-16 - [mjkuranda]: New routing structure diff --git a/IDEAS.md b/IDEAS.md index 9b40b3a..c5ee09c 100644 --- a/IDEAS.md +++ b/IDEAS.md @@ -4,20 +4,26 @@ - Validation - client side: The patterns should be loaded from pattern file? Or simply embedeed inside elements. - Error page for multer and other errors while you are trying to add a new meal. -- 6 meals in `/search` should be removed in a near future. - Edition of existing meals - you can edit anything you want apart from the title - because it occurs as the name. - Each result has a property called `relevance` - could be measured as a percentage. The found results should be sorted according to the this property. - Better handling MongoDB errors - types of errors and their communicates. -- Improved README and guide for developers how to add ingredients and other things. ## Bugs -- +- NaN ## Added - (vNaN): NaN +## Changed + +v2.7.0: + +- 6 meals in `/search` should be removed in a near future. + +- Improved README (guide for the customers and the developers - how to add ingredients and other stuff. + ## Fixed - (v2.6.3): When you try to add a new meal and its image is too large, then you receive a message about failure but the meal wil be added. diff --git a/README.md b/README.md index a3f4434..c670098 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,84 @@ Website that will help you to find somewhat to eat! -# About +
+ +## About Have you ever encountered a situation when you didn't know what to cook? Yummy will help you to make the best decision! + +
+ +## Using + +Being in the main page (locally is `http://localhost:3000/`) you can see panel, containg the three following buttons: + +- `Wyszukaj po produktach` - redirects to `/search` and move to the ingredients. +- `Propozycja na dziś` - returns the best option for you at the time (currently disabled option) +- `Wyszukaj z bazy` - redirects to `/search` + +The subpage `/search` allows you finding the best results. You can select multiple ingredients and a type of looking for a meal/meals. Below these filters, `/search` renders the results. + +When you hover on a result, it magnifies. You can see title, description and an image of such meal. + +When you click on a result, it redirects to `/result` subpage, where you can see the full description of the meal and its all ingredients. + +There is one more button on the bottom `/search` subpage. The `Dodaj` button allows you adding a new meal. It redirects to `/meals/add`. + +Being in `/meals/add`, you can see a form, containing the fields. + +- `Nazwa posiłku` +- `Opis posiłku` +- `Rodzaj posiłku` +- `Imię autora wprowadzającego posiłek` +- `Składniki` + +are required. You can optionally add an image for a new meal. +Additionally, `Nazwa posiłku` is unique i.e. there is no any meal with that name in the database. + +
+ +# Yummy for developers + +This section contains information about adding the new stuff. + +
+ +## Adding a new icon + +1. Download a new icon image and attach to the appropriate directory, locating in `/icons`. +2. Open `YummyData.ts` and add a new property to `icons` object, naming it according to `camelCase` convention. +3. For the object being created set following properties: `name`, `url` (starting in `/icons`), `ext` (abbr. extension) and `link` (i.e. `source`) + +
+ +### Adding the new property for `icons` object + +The below example creates a new icon located in directory `/icons/default/new-icon.jpg`. +
+ +```javascript +newIcon: new Icon( + "new icon", + "/default", + "jpg", + "https://cool-icons.com/new-icon-source" +), +``` + +## Adding a new ingredient + +1. Open `YummyData.ts` and find `ingredients` object. +2. Add a new property using `camelCase` convention. +3. Assign an object of ingredient to the new property. + +```javascript +newIngredient: new Ingredient( + Category.SOME_CATEGORY, // Category + icons.newIcon, // Icon object + "nowy składnik" // Name +), +``` + +where `Category` has enum type and `icons` is the object planty of icons in the same file as `ingredients`. diff --git a/package.json b/package.json index cf7fe59..b69284a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yummy", - "version": "2.6.3", + "version": "2.7.0", "description": "Website that will help you the best!", "main": "index.js", "scripts": { diff --git a/src/YummyData.ts b/src/YummyData.ts index 5514e4d..b90a2fa 100644 --- a/src/YummyData.ts +++ b/src/YummyData.ts @@ -1,5 +1,4 @@ import Ingredient from "./classes/Ingredient"; -import Meal, { Type } from "./classes/Meal"; import Icon from "./classes/Icon"; import Category from "./enums/categories";