Skip to content
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

DavRich-Recipe-App working prototype #24

Open
wants to merge 137 commits into
base: main
Choose a base branch
from
Open

DavRich-Recipe-App working prototype #24

wants to merge 137 commits into from

Conversation

amon-cofie
Copy link
Owner

In this pull request my partner, @RichardChileya, and I, @amon-cofie did the following things listed in the project requirements:

- You should follow the layout of the wireframes provided. You should personalize the rest of the design including colors, typographies, spacings, etc.
- Login page and registration page:
  - Should be built with Devise.
- Food list:
  - Should display a list of food added by the logged-in user as in the wireframe (for teams with only 2 people - display also quantity of a given food).
  - Should lead to a form that allows users to add new food.
- Recipes list:
  - Should display a list of recipes created by the logged-in user as in the wireframe.
  - Should lead to recipe details.
  - If the user is the owner of the recipe, should allow the user to delete it.
- Public recipe list:
  - Should display a list of all public recipes ordered by newest as in the wireframe.
  - Should lead to recipe details.
- Recipe details:
  - If the recipe is public or the user is the owner of the recipe, should display the recipe details as in the wireframe.
  - If the user is the owner of the recipe, should lead to the form that allows the user to add new food.
- General shopping list view (only for a group that has less than 3 members):
  - Should show the list of food that is missing for all recipes of the logged-in user (compare the list of food for all recipes with the general food list of that user).
  - Should count the total food items and total price of the missing food.
- Make sure there are no N+1 queries happening.
- Create a navigation menu that allows users to open all of the pages you created.

Copy link

@Felix45 Felix45 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @amon-cofie & @RichardChileya ,

Good job so far!
There are some issues that you still need to work on to go to the next project but you are almost there!

Highlights ✔️

  • No linter errors ✅
  • Students solved N+1 queries problem ✅
  • Descriptive pull request title and summary ✅
  • Git flow is used correctly ✅

Required Changes ♻️

Check the comments under the review.

Optional suggestions

  • [ Required ] I've noticed that the license link on your readme file is not working, it leads to a 404 page not found error. I would like to suggest that you fix this by adding License file in your root directory and provide a link to the license on the readme file. You can use the contents of the MIT license on this link Click Here >>

Screenshot from 2023-02-18 15-48-55

Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.

You can also consider:

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.

Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

Copy link

@codepantha codepantha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STATUS: CHANGES REQUIRED ♻️ 📌

Hi team 👋,

Great work on making the changes requested by the previous reviewer 👏
You've done well implementing some of the requested changes, but there are still some which aren't addressed yet.

Highlights 🎯

✔️ Descriptive PR
✔️ Used GitFlow correctly
✔️ No linter errors

Required Changes ♻️

Check the comments under the review.

  • You have done well writing some tests for your application 👏 Please write tests for the models as well 😎

Optional suggestions

Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will really improve your application.

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.

Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

Comment on lines +219 to +221
## 📝 License <a name="license"></a>

This project is [MIT](https://choosealicense.com/licenses/mit/) licensed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • [OPTIONAL] In order to have a license file for your project, you need to create a file called LICENSE in the root of your project, edit it with the correct information, then link it like this 👇
This project is [MIT](./LICENSE) licensed.

Comment on lines 3 to 14
def index
@all_ingredients = RecipeFood.includes(:recipe, :food)
@missing = @all_ingredients.select { |ing| ing.quantity > ing.foods.quantity }
@missing_ingredients = @missing.map do |ingredient|
{
name: ingredient.foods.name,
quantity: ingredient.quantity - ingredient.foods.quantity,
price: ingredient.foods.price * (ingredient.quantity - ingredient.foods.quantity)
}
end
@total_price = @missing_ingredients.map { |ing| ing[:price] }.sum
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • An error occurs while trying to generate the shopping list. Please see error screenshot below and try to fix it 👍
    image

Comment on lines +3 to +17
<%= form_with model: @recipe_new, url: recipe_recipe_foods_path do |f| %>
<div class="form_control">
<%= f.label :quantity %>
<%= f.number_field :quantity %>
</div>

<div class="form_control">
<%= f.select(:food_id, @foods.map{|u| [u.name, u.id]}) %>
</div>

<div class="form_control">
<%= f.hidden_field :recipe_id, value: @recipe_new.recipe_id %>
</div>
<%= f.submit "Submit", class:"btn btn-success" %>
<% end%>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Just like the previous reviewer observed and advised, only authorized users (owner of the recipe) should be able to add a new food to the recipe as stated in the project requirements below 👇
    image


def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: %i[name email password])
# devise_parameter_sanitizer.permit(:account_update, keys: %i[name email password photo bio])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Just as the previous reviewer recommended, please remove commented code in order to have a cleaner and less cluttered code base 👍

Copy link

@prolajumokeoni prolajumokeoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Team

Your project is complete! There is nothing else to say other than... it's time to merge it :shipit:
Congratulations! 🎉

Highlights

  • All changes requested have been implemented 🚀

Optional suggestions

Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.

You can also consider:

  • N/A

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification @prolajumokeoni.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants