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

🌸🥗🥔✨ Marketplace: Orders expose their Events #1712

Merged
merged 2 commits into from
Aug 10, 2023

Conversation

zspencer
Copy link
Member

@zspencer zspencer commented Jul 27, 2023

Next steps:

  • Tidy the UI! It gross
  • Add Specs! It needs them!

After?

Screenshot 2023-08-09 at 4 52 08 PM

@zspencer zspencer force-pushed the marketplace/expose-order-audit-log-to-space-members branch from f4a9de2 to edc109f Compare August 6, 2023 18:39
- #1710

Next steps:

- Tidy the UI! It gross
- Add Specs! It needs them!
- ???
@zspencer zspencer force-pushed the marketplace/expose-order-audit-log-to-space-members branch 2 times, most recently from 6bbf68b to 920f716 Compare August 10, 2023 00:01
@zspencer zspencer added ✨ feature Reduces Client's Burden or Grants them Benefits 🥔 Satisfices It's good enough to use, but not particularly great 🥗 test automation Adds some automated tests. V nutritious. 🌸 Polish Improves the UX! labels Aug 10, 2023
@zspencer zspencer changed the title 🚧✨ Marketplace: Orders expose their Events 🌸🥗🥔✨ Marketplace: Orders expose their Events Aug 10, 2023
@@ -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
Copy link
Member Author

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.

@zspencer zspencer marked this pull request as ready for review August 10, 2023 00:02
@zspencer zspencer requested review from a team August 10, 2023 00:03
- #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!
@zspencer zspencer force-pushed the marketplace/expose-order-audit-log-to-space-members branch from 920f716 to 727fa04 Compare August 10, 2023 00:11
@@ -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? %>
Copy link
Member Author

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?

Copy link
Contributor

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?

Copy link
Member Author

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
Copy link
Member Author

@zspencer zspencer Aug 10, 2023

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

@zspencer zspencer merged commit d4f9ae4 into main Aug 10, 2023
@zspencer zspencer deleted the marketplace/expose-order-audit-log-to-space-members branch August 10, 2023 00:18
<hr class="col-span-6 my-4" />
<div class="col-span-6 text-xs">

<h3 class="mb-2 text-sm font-bold">Events</h3>
Copy link
Contributor

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"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I like that!

zspencer added a commit that referenced this pull request Aug 16, 2023
- #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`.
zspencer added a commit that referenced this pull request Aug 16, 2023
- #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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature Reduces Client's Burden or Grants them Benefits 🌸 Polish Improves the UX! 🥔 Satisfices It's good enough to use, but not particularly great 🥗 test automation Adds some automated tests. V nutritious.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants