-
Notifications
You must be signed in to change notification settings - Fork 13
Nora, Jessica, Emily, Kate: PLANTSY #31
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
flash messages added to application
Feat: basic styling
Order + order item functions km june11
Add product
Feat links and styles
Nora clean up
simple cov order controller test 90%
Jessica misc final changes
Merchant order status
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 worked together as a team and how thorough your tests were of the things you did test. I do see some room for improvement around putting more logic in the model and attention to detail. There were some small things that slipped through the cracks (see comments). 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: 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. |
|
|
||
| #Login | ||
| get "/auth/github", as: "github_login" | ||
| get "/auth/:provider/callback", to: "merchants#create" |
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.
To of your tests fail because this isn't named.
| get "/auth/:provider/callback", to: "merchants#create" | |
| get "/auth/:provider/callback", to: "merchants#create", as: "auth_callback" |
| def index | ||
| if params[:product_id] # This is the nested route, /products/:product_id/order_items | ||
| product = Product.find_by(id: params[:product_id]) | ||
| order_items = product.order_items.as_json(only: [:id, :name, :price, :quantity]) | ||
| render json: order_items, status: :ok | ||
| else # This is the 'regular' route, /order_items | ||
| order_items = OrderItem.all.as_json(only: [:id, :name, :price, :quantity]) | ||
| render json: order_items, status: :ok | ||
| 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.
Inconsistent indentation.
|
|
||
| if @order_item.nil? | ||
| # head :not_found | ||
| redirect_to dashboard_path |
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.
Adding a flash message here would be nice.
| end | ||
|
|
||
| if @product.status == false && @product.merchant_id != session[:user_id] | ||
| flash[:error] = "Oops. That plant isn't available. Let's find you another beautiful plant." |
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.
I like this message. :)
| @@ -0,0 +1,3 @@ | |||
| class Category < ApplicationRecord | |||
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.
You should probably require a name to exist.
| <%= link_to "Merchants", merchants_path %> | ||
| </nav> | ||
|
|
||
| <section class="navigation-bar--right-side"> |
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.
You should avoid things like right-side in class names.
You might want to move this to the left side at some point and then that would be confusing or require a rename.
| <button type="button" class="btn btn-primary"><%= link_to "Add a product", new_product_path %></button> | ||
| <button type="button" class="btn btn-primary"><%= link_to "Add a category", new_category_path %></button> | ||
| </section> | ||
| <br /> |
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.
You should avoid using <br />s if you can. It's cleaner just to add a margin-bottom or margin-top to something.
| <% if @cart_items %> | ||
| <% @cart_items.each do |item| %> | ||
| <section class="cart-item"> | ||
| <%= image_tag(item.photo_url, alt: "photo of the cart item") %> |
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.
For an alt tag it would probably be better to make it a little more specific, maybe:
| <%= image_tag(item.photo_url, alt: "photo of the cart item") %> | |
| <%= image_tag(item.photo_url, alt: "photo of the #{item.name}") %> |
| <h2>Confirmation: Order placed!</h2> | ||
| <ul> | ||
| <li> | ||
| <strong>Order Placed At: </strong><%= @cart.updated_at.strftime('%a %b %d %H:%M:%S %Z %Y').in_time_zone("Pacific Time (US & Canada)") %> |
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.
I like that you specified the time zone.
| <% @products.each do |product| %> | ||
| <ul class="product-listing"> | ||
| <li> | ||
| <% if product.photo_url == nil || product.photo_url.length < 1 %> |
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.
It's clearer to use empty? instead of length < 1:
| <% if product.photo_url == nil || product.photo_url.length < 1 %> | |
| <% if product.photo_url == nil || product.photo_url.empty? %> |
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