-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
🌸🥗🥔✨ Marketplace
: Orders
expose their Events
#1712
🌸🥗🥔✨ Marketplace
: Orders
expose their Events
#1712
Conversation
f4a9de2
to
edc109f
Compare
- #1710 Next steps: - Tidy the UI! It gross - Add Specs! It needs them! - ???
6bbf68b
to
920f716
Compare
Marketplace
: Orders
expose their Events
Marketplace
: Orders
expose their Events
@@ -1,6 +1,6 @@ | |||
class Marketplace | |||
class OrdersController < Controller | |||
expose :order, scope: -> { orders }, model: Order | |||
expose :order, scope: -> { orders.includes(:events, ordered_products: [:products]) }, model: Order |
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 am writing N+1 queries 😢. This gets rid of them.
- #1331 Adds a UI for exposing `Events` recorded for an `Order`. This is visible to everyone who can see the `Order`, which may be a bit of an over-exposure; but hey! The Pizza Tracker exists and people love that so maybe it's not TMI!
920f716
to
727fa04
Compare
@@ -26,4 +26,18 @@ | |||
<hr class="col-span-6 mb-2" /> | |||
<div class="col-span-4">Total</div> | |||
<div class="col-span-2 text-right"><%= humanized_money_with_symbol(order.price_total) %></div> | |||
|
|||
<%- if policy(order.events).index? %> |
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.
Do we even need this?
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.
Because the user is already authorized at the Order level?
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.
More that Policy#index?
returns "true" by default, so it feels kind of extraneous....
@@ -1,6 +1,6 @@ | |||
class Marketplace | |||
class OrdersController < Controller | |||
expose :order, scope: -> { orders }, model: Order | |||
expose :order, scope: -> { orders.includes(:events, ordered_products: [:product]) }, model: Order |
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.
Lilliputian Zee would do events
independently as part of this PR, and then the ordered_products
after; but Gulliver Zee is just stomp stomp stomping on the orders
<hr class="col-span-6 my-4" /> | ||
<div class="col-span-6 text-xs"> | ||
|
||
<h3 class="mb-2 text-sm font-bold">Events</h3> |
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.
Is "Events" a friendly term? What about "Timeline"?
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!
- #1331 - #1712 (comment) While either `History` or `Timeline` are way better than `Events`; `Timeline` felt better than `History`; since `Order History` feels like the history of all `Orders`; and `Order Timeline` feels like the `Timeline` for a single `Order`.
- #1331 - #1712 (comment) While either `History` or `Timeline` are way better than `Events`; `Timeline` felt better than `History`; since `Order History` feels like the history of all `Orders`; and `Order Timeline` feels like the `Timeline` for a single `Order`.
Marketplace
:Order
Notification
s andTimeline
#1331Next steps:
After?