spree_frontend 4.1.2 → 4.1.7

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: 575b2f83c0a8cb36cf82451a19bf2fb51177a863d345182aac560734c3a49854
4
- data.tar.gz: a00e080d764fef9d902486b2548a6038b31f7233815f37b2699f666963c285bc
3
+ metadata.gz: abeb5be8e52c16a43557e80432a4b557fd3b124aa11a1785092e7ea427230ba4
4
+ data.tar.gz: 1ce85a68e7844356ab07f5ed83266510ce743281f73c50a76718a7128eb60686
5
5
  SHA512:
6
- metadata.gz: 27fc8567b1da5591a9c4246c7955a8b0063aeba243c429e51a590dff3596a7208e672c6b226d78d6854373a9f5499c861f8309ee73050ce68f9e2f3c98e78e0d
7
- data.tar.gz: 78bff050019366d9b949fbc7c8eb495e25273eafe25c0735f1ca8ba4af0fa2e54a2494366ac13be419dcf721ea1d74e8bb41725848e3f1a49cd88ac2dcd05d05
6
+ metadata.gz: a941265f5cef8292aa3c7e239e0ce8ac79d0b4c0d93fe2d1ed6062bbd6639d3a20602fedb7f2dbdcf547ccb7edfabf516fb0917b8a7a261ea06c3be1c27400dc
7
+ data.tar.gz: 954fd27ccf2e62760b932385f619c3844b557147bf7f8a9d52bbe5a8e0ab52f252fb01c7ac8535887c86fcc1104c9b1141a28138f1a57869cbc3334467b2c0b4
@@ -149,7 +149,7 @@
149
149
  }
150
150
  hr {
151
151
  margin: 0;
152
- width: 33%;
152
+ flex: 1;
153
153
  border: 1px solid theme-color('info');
154
154
  }
155
155
  }
@@ -42,7 +42,7 @@
42
42
  }
43
43
  }
44
44
  &-continue-link {
45
- margin-top: 234px;
45
+ margin-top: 100px;
46
46
  margin-bottom: 30px;
47
47
  @include media-breakpoint-up(sm) {
48
48
  padding: 20px 12px;
@@ -1,6 +1,6 @@
1
1
  .plp {
2
2
  &-not-found-header {
3
- color: theme-color("dark-text");
3
+ color: $font-color;
4
4
  font-size: font-px-to-rem(18px);
5
5
  font-weight: 500;
6
6
  letter-spacing: 0.45px;
@@ -30,7 +30,7 @@
30
30
  }
31
31
 
32
32
  &-not-found-text {
33
- color: theme-color("dark-text");
33
+ color: $font-color;
34
34
  margin-bottom: 350px;
35
35
  font-size: font-px-to-rem(14px);
36
36
  font-weight: 500;
@@ -50,7 +50,7 @@
50
50
  height: 60px;
51
51
  display: flex;
52
52
  align-items: center;
53
- color: theme-color("dark-text");
53
+ color: $font-color;
54
54
  @include media-breakpoint-up("md") {
55
55
  font-size: font-px-to-rem(32px);
56
56
  }
@@ -68,7 +68,7 @@
68
68
  }
69
69
 
70
70
  &-buttons {
71
- color: theme-color("dark-text");
71
+ color: $font-color;
72
72
  display: flex;
73
73
  align-items: center;
74
74
  justify-content: space-between;
@@ -92,7 +92,7 @@
92
92
  top: $spree-plp-filter-desktop-position;
93
93
  left: 0;
94
94
  &-card {
95
- background-color: theme-color("light-background");
95
+ background-color: $primary-background;
96
96
  border: none;
97
97
  a:hover {
98
98
  text-decoration: none;
@@ -104,7 +104,7 @@
104
104
  }
105
105
  }
106
106
  &-header {
107
- background-color: theme-color("light-background");
107
+ background-color: $primary-background;
108
108
  border-color: $global-border-style;
109
109
  cursor: pointer;
110
110
  font-size: font-px-to-rem(17px);
@@ -125,7 +125,7 @@
125
125
  }
126
126
  &-item {
127
127
  border: solid 1px $second-global-border;
128
- color: theme-color("dark-text");
128
+ color: $font-color;
129
129
  font-size: font-px-to-rem(16px);
130
130
  font-weight: 500;
131
131
  &--selected {
@@ -154,7 +154,7 @@
154
154
  &-li--active {
155
155
  list-style: none;
156
156
  a {
157
- color: theme-color("dark-text");
157
+ color: $font-color;
158
158
  }
159
159
  }
160
160
  &-li--active {
@@ -186,7 +186,7 @@
186
186
  }
187
187
  }
188
188
  a {
189
- color: theme-color("dark-text");
189
+ color: $font-color;
190
190
  border-color: $global-border-style !important;
191
191
  padding: 5px 13px;
192
192
  min-width: 37px;
@@ -207,7 +207,7 @@
207
207
  }
208
208
 
209
209
  &-overlay {
210
- color: theme-color("dark-text");
210
+ color: $font-color;
211
211
  position: fixed;
212
212
  width: 100%;
213
213
  height: 100%;
@@ -216,7 +216,7 @@
216
216
  right: 0;
217
217
  bottom: 0;
218
218
  z-index: 999;
219
- background-color: theme-color("light-background");
219
+ background-color: $primary-background;
220
220
 
221
221
  &-header {
222
222
  height: 60px;
@@ -243,13 +243,13 @@
243
243
  height: 12px;
244
244
  margin-top: 2px;
245
245
  margin-left: 2px;
246
- background-color: theme-color("secondary");
247
- border: solid 1px theme-color("secondary");
246
+ background-color: $secondary-color;
247
+ border: solid 1px $secondary-color;
248
248
  border-radius: 50%;
249
249
  }
250
250
  }
251
251
  a {
252
- color: theme-color("dark-text");
252
+ color: $font-color;
253
253
  &:hover {
254
254
  text-decoration: none;
255
255
  }
@@ -263,25 +263,25 @@
263
263
  &-card {
264
264
  border: none;
265
265
  border-top: solid 1px $global-border-style;
266
- background-color: theme-color("light-background");
266
+ background-color: $primary-background;
267
267
  &-header.collapsed {
268
268
  .arrow {
269
269
  transform: rotate(90deg);
270
270
  }
271
271
  }
272
272
  &-header {
273
- background-color: theme-color("light-background");
273
+ background-color: $primary-background;
274
274
  border-bottom: none;
275
275
  cursor: pointer;
276
276
  &-arrow {
277
- color: theme-color("dark-test");
277
+ color: $font-color;
278
278
  transform: rotate(-90deg);
279
279
  }
280
280
  }
281
281
 
282
282
  &-item {
283
283
  border: solid 1px $second-global-border;
284
- color: theme-color("dark-text");
284
+ color: $font-color;
285
285
  font-size: font-px-to-rem(13px);
286
286
  &--selected {
287
287
  border: solid 2px $secondary-color;
@@ -295,19 +295,24 @@
295
295
  }
296
296
  }
297
297
  &-buttons {
298
- bottom: 30px;
298
+ background-color: $primary-background;
299
+ padding-bottom: 30px;
300
+ bottom: 0px;
299
301
  }
300
302
  }
301
303
 
302
304
  &-scroll {
303
305
  max-height: 100%;
304
306
  overflow-y: auto;
305
- padding-bottom: 140px;
307
+ padding-bottom: 150px;
308
+ @include media-breakpoint-up('sm') {
309
+ padding-bottom: 220px;
310
+ }
306
311
  }
307
312
 
308
313
  &-empty-dot {
309
- background-color: theme-color("light-background");
310
- border: solid 1px theme-color("secondary");
314
+ background-color: $primary-background;
315
+ border: solid 1px $secondary-color;
311
316
  border-radius: 50%;
312
317
  display: inline-block;
313
318
  margin-right: 16px;
@@ -101,7 +101,8 @@ module Spree
101
101
  end
102
102
  end
103
103
  content = content_tag('ul', raw(items.join("\n")), class: 'nav justify-content-between checkout-progress-steps', id: "checkout-step-#{@order.state}")
104
- content << content_tag('div', raw('<hr /><hr /><hr />'), class: "checkout-progress-steps-line state-#{@order.state}")
104
+ hrs = '<hr />' * (states.length - 1)
105
+ content << content_tag('div', raw(hrs), class: "checkout-progress-steps-line state-#{@order.state}")
105
106
  end
106
107
 
107
108
  def flash_messages(opts = {})
@@ -230,14 +231,16 @@ module Spree
230
231
  ]
231
232
  end
232
233
 
233
- def filtering_params
234
- static_filters = %w(keywords price sort_by)
234
+ def static_filters
235
+ @static_filters ||= Spree::Frontend::Config[:products_filters]
236
+ end
235
237
 
236
- available_option_types.map(&:filter_param).concat(static_filters)
238
+ def filtering_params
239
+ @filtering_params ||= available_option_types.map(&:filter_param).concat(static_filters)
237
240
  end
238
241
 
239
242
  def filtering_params_cache_key
240
- params.permit(*filtering_params)&.reject { |_, v| v.blank? }&.to_s
243
+ @filtering_params_cache_key ||= params.permit(*filtering_params)&.reject { |_, v| v.blank? }&.to_param
241
244
  end
242
245
 
243
246
  def available_option_types_cache_key
@@ -22,10 +22,10 @@ module Spree
22
22
  name: product.name,
23
23
  image: structured_images(product),
24
24
  description: product.description,
25
- sku: product.sku,
25
+ sku: structured_sku(product),
26
26
  offers: {
27
27
  '@type': 'Offer',
28
- price: product.price_in(current_currency).amount,
28
+ price: product.default_variant.price_in(current_currency).amount,
29
29
  priceCurrency: current_currency,
30
30
  availability: product.in_stock? ? 'InStock' : 'OutOfStock',
31
31
  url: spree.product_url(product),
@@ -35,6 +35,10 @@ module Spree
35
35
  end
36
36
  end
37
37
 
38
+ def structured_sku(product)
39
+ product.default_variant.sku? ? product.default_variant.sku : product.sku
40
+ end
41
+
38
42
  def structured_images(product)
39
43
  image = default_image_for_product_or_variant(product)
40
44
 
@@ -2,6 +2,7 @@ module Spree
2
2
  class FrontendConfiguration < Preferences::Configuration
3
3
  preference :coupon_codes_enabled, :boolean, default: true # Determines if we show coupon code form at cart and checkout
4
4
  preference :locale, :string, default: Rails.application.config.i18n.default_locale
5
+ preference :products_filters, :array, default: %w(keywords price sort_by)
5
6
  preference :remember_me_enabled, :boolean, default: true
6
7
  end
7
8
  end
@@ -1,5 +1,25 @@
1
1
  <% @body_id = 'checkout-page' %>
2
2
 
3
+ <%
4
+ content_for :head do
5
+ agent = request.env['HTTP_USER_AGENT']
6
+ if agent =~ /Safari/ && !(agent =~ /Chrome/)
7
+ %>
8
+ <script>
9
+ if (!!window.performance && window.performance.navigation.type === 2) {
10
+ window.location.reload();
11
+ }
12
+ window.onpageshow = function(event) {
13
+ if (event.persisted) {
14
+ window.location.reload()
15
+ }
16
+ }
17
+ </script>
18
+ <%
19
+ end
20
+ end
21
+ %>
22
+
3
23
  <div id="checkout" class="container checkout" data-hook>
4
24
  <%= render partial: 'spree/shared/error_messages', locals: { target: @order } %>
5
25
 
@@ -1,4 +1,4 @@
1
- <% cache base_cache_key + [available_option_types, permitted_params, @taxon&.id] do %>
1
+ <% cache base_cache_key + [available_option_types_cache_key, filtering_params_cache_key, @taxon&.id] do %>
2
2
  <div id="plp-filters-accordion" class="d-none d-lg-block col-lg-3 pr-5 position-sticky h-100 plp-filters" data-hook="taxon_sidebar_navigation">
3
3
  <% @available_option_types.each do |option_type| %>
4
4
  <div class="w-100 card plp-filters-card">
@@ -1,7 +1,7 @@
1
1
  <% is_visible = params[:menu_open] ? 'block' : 'none' %>
2
2
 
3
3
  <div id="filter-by-overlay" class="d-lg-none plp-overlay" style="display: <%= is_visible %>;">
4
- <% cache base_cache_key + [available_option_types, permitted_params, @taxon&.id] do %>
4
+ <% cache base_cache_key + [available_option_types_cache_key, filtering_params_cache_key, @taxon&.id] do %>
5
5
  <div class="plp-scroll">
6
6
  <div class="container">
7
7
  <div class="plp-overlay-header">
@@ -55,7 +55,7 @@
55
55
  </div>
56
56
  <% end %>
57
57
 
58
- <div class="container position-absolute text-center mb-2 plp-overlay-buttons pt-3">
58
+ <div class="container position-absolute text-center plp-overlay-buttons pt-3">
59
59
  <%= link_to Spree.t('plp.clear_all'), permitted_params.select { |key, value| key == "sort_by"}, class: 'btn spree-btn btn-outline-primary w-100 mb-4' %>
60
60
  <%= link_to Spree.t('plp.done'), permitted_params, class: 'btn btn-primary spree-btn w-100' %>
61
61
  </div>
@@ -1,7 +1,8 @@
1
1
  <% permitted_params = params.permit(*filtering_params) %>
2
+ <% products_empty = @products.empty? %>
2
3
 
3
4
  <div data-hook="search_results">
4
- <% if @products.empty? %>
5
+ <% if products_empty %>
5
6
  <% if permitted_params[:keywords].present? && permitted_params.to_h.one? %>
6
7
  <%= render 'spree/products/no_results' %>
7
8
  <% else %>
@@ -40,6 +41,8 @@
40
41
  <%= render 'spree/products/filters_mobile', permitted_params: permitted_params %>
41
42
  <%= render 'spree/products/sort_mobile', permitted_params: permitted_params %>
42
43
 
43
- <% cache cache_key_for_products(@products, 'json-ld') do %>
44
- <%= products_structured_data(@products) %>
44
+ <% unless products_empty %>
45
+ <% cache cache_key_for_products(@products, 'json-ld') do %>
46
+ <%= products_structured_data(@products) %>
47
+ <% end %>
45
48
  <% end %>
@@ -1,4 +1,4 @@
1
- <% cache base_cache_key + [ot_downcase_name, params_ot_downcase_name, permitted_params, @taxon&.id] do %>
1
+ <% cache base_cache_key + [ot_downcase_name, params_ot_downcase_name, filtering_params_cache_key, @taxon&.id] do %>
2
2
  <% selected_option_values = params_ot_downcase_name&.split(',')&.map(&:to_i) || [] %>
3
3
  <% option_type.option_values.each do |option_value| %>
4
4
  <% id = option_value.id %>
@@ -1,6 +1,6 @@
1
1
  <%# TODO: Use in cart %>
2
2
  <div class="d-flex quantity-select mx-auto mx-md-0">
3
3
  <%= button_tag '-', type: 'button', class: "border-right-0 flex-grow-0 flex-shrink-0 py-0 px-3 quantity-select-decrease" %>
4
- <%= number_field_tag input_name, 1, min: 1, class: "p-0 flex-grow-1 flex-shrink-1 text-center form-control border-left-0 border-right-0 quantity-select-value", 'aria-label': Spree.t('pdp.quantity') %>
4
+ <%= number_field_tag input_name, 1, min: 1, max: maximum_quantity, class: "p-0 flex-grow-1 flex-shrink-1 text-center form-control border-left-0 border-right-0 quantity-select-value", 'aria-label': Spree.t('pdp.quantity') %>
5
5
  <%= button_tag '+', type: 'button', class: "border-left-0 flex-grow-0 flex-shrink-0 py-0 px-3 quantity-select-increase" %>
6
6
  </div>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.2
4
+ version: 4.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-27 00:00:00.000000000 Z
11
+ date: 2020-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_api
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.2
19
+ version: 4.1.7
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: 4.1.2
26
+ version: 4.1.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 4.1.2
33
+ version: 4.1.7
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 4.1.2
40
+ version: 4.1.7
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bootstrap
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -515,7 +515,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
515
515
  version: '0'
516
516
  requirements:
517
517
  - none
518
- rubygems_version: 3.0.6
518
+ rubygems_version: 3.1.2
519
519
  signing_key:
520
520
  specification_version: 4
521
521
  summary: Frontend e-commerce functionality for the Spree project.