-
Notifications
You must be signed in to change notification settings - Fork 13
vivejest - Vicki, Vera, Jessica and Stephanie (momasy) #32
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
base: master
Are you sure you want to change the base?
Conversation
added category to merch dashboard and max width css
This reverts commit d38cb56.
…y_change All button styles add new category change
Merchant dashboard status filter
…e class added to pages without
Merchants index styling
Order items testing
bEtsyFunctional Requirements: Manual Testing
Major Learning Goals/Code Review
Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
Overall FeedbackGreat work overall! You've built a fully functional web store from top to bottom. This represents a huge amount of work, and you should be proud of yourselves!. I am particularly impressed by the way that you styled your site and your (super high!) test coverage. I do see some room for improvement around manual testing of edge cases and moving functionality into models. bEtsy is a huge project on a very short timeline, and this feedback should not at all diminish the magnitude of what you've accomplished. Keep up the hard work! Overall Feedback: Meets or Exceeds Standard Only the person who submitted the PR will get an email about this feedback. Please let the rest of your team know about it. |
| color: #444444; | ||
| } | ||
|
|
||
| @media screen and (max-width: 600px) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh, responsive design!
| if current_item | ||
| # params[:quantity].to_i to add up the quantity | ||
| if (current_item[:quantity] + params[:quantity].to_i) > @product.inventory | ||
| flash[:error] = "You cannot add more items than are in stock." | ||
| redirect_to product_path(@product.id) | ||
| else | ||
| current_item[:quantity] += params[:quantity].to_i | ||
| current_item.save | ||
| flash[:success] = "Successfully updated order item" | ||
| redirect_to order_path(@order_id) | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic should probably live in the model.
| # Method to create a new order Item. | ||
| def create_new_orderItem | ||
| order_item = OrderItem.new({ | ||
| product_id: params[:product_id], | ||
| quantity: params[:quantity].to_i, | ||
| order_id: session[:order_id], | ||
| }) | ||
|
|
||
| if order_item.save | ||
| flash[:success] = "Item added to order" | ||
| redirect_to order_path(@order_id) | ||
| else | ||
| flash[:error] = "Could not add item to order" | ||
| redirect_to order_path(@order_id) | ||
| end | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a factory method on OrderItem.
| inventory_errors = 0 | ||
| order_items.each do |order_item| | ||
| if order_item.quantity > order_item.product.inventory | ||
| if order_item.product.inventory == 0 | ||
| order_item.destroy | ||
| else | ||
| order_item.quantity = order_item.product.inventory | ||
| order_item.save | ||
| end | ||
| inventory_errors += 1 | ||
| end | ||
| end | ||
|
|
||
| if inventory_errors > 0 | ||
| flash[:error] = "Some of the items in your cart are no longer in stock. We have updated your cart to reflect the current quantity." | ||
| redirect_to order_path(params[:id]) | ||
| return | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic should have been in a method on Order.
Assignment Submission: bEtsy
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions. These should be answered by all members of your team, not by a single teammate.
Reflection