spree_storefront 5.1.0.beta2 → 5.1.0.beta3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19206e7652c00c3c568c84ae06211d42a4fdabdba0fa298a18d46a0d615596eb
4
- data.tar.gz: '087dc7b697bf1d964038de67822f36c3939155f5d944995846ebdd36d95ef946'
3
+ metadata.gz: c1dbc02737b8c05caa58fafb4584ef7c49e619654a1209e2f83c72c95f596961
4
+ data.tar.gz: e070440be4bb251b30a0b6d8f3d57f12cd50bd75e564966799eef441c9a3b4aa
5
5
  SHA512:
6
- metadata.gz: 1de7ae9be59cd3bac1201867e7b4e4b056415d7c632242ba364d86b858d458e3b5e79226d0db4b83d2baa2f0208a2dbd28ba3481721f89b51982bf20124cb751
7
- data.tar.gz: 3ffa2172bc13b5632b012c0f27f22b8a0669bfdfe711bbd440042dabecefa72c1c63aa71466aff380219e8de0dcd3004111b266a9564ac05a3785ed43bf43616
6
+ metadata.gz: 487843eb1f23fc955b6bc4d45b2a89112edf2d0cb68075f8714e0a1da197b3e2692dcc434859c3e59b53d4286b1af0da65ba532e016559930dcb90e20e7d08a5
7
+ data.tar.gz: e791a45a470fe19e42d9daea9ae3b7b5152dec22f65c4bdc2eeb141a2be7bca42b1f099777588de234e44e42fc2a7fc9be6ea6be46ee4034507630897ea9fc48
@@ -1,7 +1,7 @@
1
1
  module Spree
2
2
  class AddressesController < Spree::StoreController
3
3
  helper Spree::AddressesHelper
4
- load_and_authorize_resource class: Spree::Address
4
+ before_action :load_and_authorize_address, except: [:index]
5
5
 
6
6
  def create
7
7
  order_token = params[:order_token]
@@ -98,6 +98,18 @@ module Spree
98
98
  Spree::Dependencies.address_update_service.constantize
99
99
  end
100
100
 
101
+ def load_and_authorize_address
102
+ action = params[:action].to_sym
103
+
104
+ @address ||= if [:new, :create].include?(action)
105
+ Spree::Address.new(country: current_store.default_country, user: try_spree_current_user)
106
+ else
107
+ Spree::Address.find(params[:id])
108
+ end
109
+
110
+ authorize! action, @address
111
+ end
112
+
101
113
  def address_changes_except
102
114
  []
103
115
  end
@@ -61,6 +61,9 @@
61
61
  <%= form.hidden_field :state_lock_version %>
62
62
  <%= form.hidden_field :ship_address_id, data: { 'checkout-address-book-target': 'addressId' } %>
63
63
  </div>
64
+
65
+ <%= render 'spree/checkout/special_instructions', form: form %>
66
+
64
67
  <div>
65
68
  <%= button_tag Spree.t(:save_and_continue),
66
69
  data: {
@@ -140,6 +143,8 @@
140
143
  </div>
141
144
  </div>
142
145
 
146
+ <%= render 'spree/checkout/special_instructions', form: form %>
147
+
143
148
  <%= hidden_field_tag 'save_user_address', true, data: { hook: "save_user_address" } %>
144
149
  </div>
145
150
  <div class="flex justify-end w-full">
@@ -0,0 +1,10 @@
1
+ <% if current_store.prefers_special_instructions_enabled? %>
2
+ <div class="mt-8 mb-4">
3
+ <h5 class="font-body mb-3">
4
+ <%= I18n.t('activerecord.attributes.spree/order.special_instructions') %>
5
+ </h5>
6
+ <div class="form-group">
7
+ <%= form.text_area :special_instructions, class: 'w-full text-input', rows: 2, placeholder: Spree.t('storefront.checkout.special_instructions_placeholder') %>
8
+ </div>
9
+ </div>
10
+ <% end %>
@@ -24,6 +24,17 @@
24
24
  <%= render partial: 'spree/shared/order_shipment', collection: shipments, as: :shipment, cached: spree_base_cache_scope %>
25
25
  </ul>
26
26
 
27
+ <% if order.special_instructions.present? %>
28
+ <div class="p-4 lg:p-6 text-sm border">
29
+ <div class="uppercase tracking-widest mb-1">
30
+ <%= I18n.t('activerecord.attributes.spree/order.special_instructions') %>
31
+ </div>
32
+ <div class="!leading-[1.375rem] text-neutral-800">
33
+ <%= simple_format(order.special_instructions) %>
34
+ </div>
35
+ </div>
36
+ <% end %>
37
+
27
38
  <div class="mt-6 bg-accent mb-24">
28
39
  <div class="grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-6 p-4 lg:p-6 text-sm bg-border bg-accent-100">
29
40
  <!-- billing address -->
@@ -37,6 +37,7 @@ en:
37
37
  payment_processing_message: You will receive an email confirmation when your payment is processed.
38
38
  shipping_not_available: Shipping not available
39
39
  signup_for_an_account: Create an account for faster future purchases, order tracking, and more.
40
+ special_instructions_placeholder: Here you can add any special instructions for your order
40
41
  store_credits_amount_applied: You applied a %{amount} store credit to your order.
41
42
  thanks_for_your_order: Thanks %{name} for your order!
42
43
  you_will_need_to_pay_only: You will need to pay only %{amount} with your payment method of choosing.
@@ -78,7 +78,7 @@ html {
78
78
  }
79
79
 
80
80
  textarea.text-input {
81
- height: auto;
81
+ height: auto !important;
82
82
  min-height: 3rem;
83
83
  border-radius: 0;
84
84
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_storefront
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0.beta2
4
+ version: 5.1.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vendo Connect Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-22 00:00:00.000000000 Z
11
+ date: 2025-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.1.0.beta2
19
+ version: 5.1.0.beta3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 5.1.0.beta2
26
+ version: 5.1.0.beta3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: active_link_to
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -319,6 +319,7 @@ files:
319
319
  - app/views/spree/checkout/_payment_sources.html.erb
320
320
  - app/views/spree/checkout/_quick_checkout.html.erb
321
321
  - app/views/spree/checkout/_sidebar.html.erb
322
+ - app/views/spree/checkout/_special_instructions.html.erb
322
323
  - app/views/spree/checkout/_store_credit.html.erb
323
324
  - app/views/spree/checkout/_summary.html.erb
324
325
  - app/views/spree/checkout/_user_account.html.erb
@@ -549,9 +550,9 @@ licenses:
549
550
  - AGPL-3.0-or-later
550
551
  metadata:
551
552
  bug_tracker_uri: https://github.com/spree/spree/issues
552
- changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0.beta2
553
+ changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0.beta3
553
554
  documentation_uri: https://docs.spreecommerce.org/
554
- source_code_uri: https://github.com/spree/spree/tree/v5.1.0.beta2
555
+ source_code_uri: https://github.com/spree/spree/tree/v5.1.0.beta3
555
556
  post_install_message:
556
557
  rdoc_options: []
557
558
  require_paths: