-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨
Marketplace
: ask for missing delivery details to proceed to check…
…out (#1396) * Show a button asking for delivery details when checkout button can't be shown due to missing delivery details. * Update spec expectations with somewhat gross, but effective, comparisons against expected HTML.
- Loading branch information
Showing
9 changed files
with
63 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 20 additions & 7 deletions
27
app/furniture/marketplace/cart/deliveries/_delivery.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
<div id="<%=dom_id(delivery) %>" class="flex flex-wrap items-center justify-between text-sm mt-1 sm:mt-2"> | ||
<span> | ||
<span class="font-bold">Delivering to:</span> | ||
<%= render(delivery.delivery_area) if delivery.delivery_area.present? %> | ||
</span> | ||
<span> | ||
<% if delivery.details_filled_in? || delivery.delivery_area.present? %> | ||
<span class="font-bold">Delivering to:</span> | ||
<%= delivery.delivery_address if delivery.delivery_address.present? %> | ||
<%= render(delivery.delivery_area) if delivery.delivery_area.present? %> | ||
<% end %> | ||
</span> | ||
|
||
<%= render ButtonComponent.new( | ||
label: t("marketplace.cart.deliveries.edit.link_to"), | ||
<% if delivery.details_filled_in? %> | ||
<%= render ButtonComponent.new( | ||
label: t("marketplace.cart.deliveries.edit.link_to"), | ||
href: delivery.location(:edit), | ||
method: :get, | ||
turbo_stream: true, | ||
scheme: :secondary, | ||
) %> | ||
<% else %> | ||
<%= render ButtonComponent.new( | ||
label: t("marketplace.cart.deliveries.edit.details_missing"), | ||
href: delivery.location(:edit), | ||
method: :get, | ||
turbo_stream: true, | ||
scheme: :secondary, | ||
scheme: :primary, | ||
) %> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters