workarea-admin 3.5.9 → 3.5.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82da557f0cac42433c14244bf15d473a83c15a3c1523ca9234e469f351da6c8e
4
- data.tar.gz: 6ce1a8026a486d0963ca10751c5ffbfeefa803b112705afdd92cfa6cc2311108
3
+ metadata.gz: 1e1c6efc45b20cb32df207cbcb07a914752f4196d61b792ef01198641c50ef2f
4
+ data.tar.gz: 60408041549bd4b362f89dea3b8f2bea0f41254fcb83a576a847b8c15092778a
5
5
  SHA512:
6
- metadata.gz: 900e003e4c2e4fbf4eb72a3c1d6b8ab43b519de48d6630fe07dbde60f89336414551d5852a6fed4afdec81b23f6f1ef1e2cf2336aafd0854b0509823a120c70e
7
- data.tar.gz: f69248afa53d26063e1dc98a538953427b777c1ae641db178720a4c75e82a5ea53909a4e31351a0280a6c9f11ed3c8af4cc94cb635993d710007833538c6bba2
6
+ metadata.gz: 736af63a13d6eea04361dd06639c66f8fb9f9562472e8e3d5393bed6fe206e35c0f9eef55620bf43604958118fc50a6fcda73435969c50fd31c4a913bfda8132
7
+ data.tar.gz: 5a04cbdfcab0622d3cef5b110bd804e977a8dff4e484d7c452a0bf02f99a5e48fa89872c8cfcbe995b1bcbfbe3ea8eaef4df5e251757382c263b0be5e4a4c064
@@ -64,19 +64,21 @@ module Workarea
64
64
  end
65
65
 
66
66
  def set_details
67
- HashUpdate.new(
67
+ @product.details = HashUpdate.new(
68
+ original: @product.details,
68
69
  adds: params[:new_details],
69
70
  updates: params[:details],
70
71
  removes: params[:details_to_remove]
71
- ).apply(@product.details)
72
+ ).result
72
73
  end
73
74
 
74
75
  def set_filters
75
- HashUpdate.new(
76
+ @product.filters = HashUpdate.new(
77
+ original: @product.filters,
76
78
  adds: params[:new_filters],
77
79
  updates: params[:filters],
78
80
  removes: params[:filters_to_remove]
79
- ).apply(@product.filters)
81
+ ).result
80
82
  end
81
83
 
82
84
  def set_images
@@ -64,19 +64,21 @@ module Workarea
64
64
  end
65
65
 
66
66
  def set_details
67
- HashUpdate.new(
67
+ @product.details = HashUpdate.new(
68
+ original: @product.details,
68
69
  adds: params[:new_details],
69
70
  updates: params[:details],
70
71
  removes: params[:details_to_remove]
71
- ).apply(@product.details)
72
+ ).result
72
73
  end
73
74
 
74
75
  def set_filters
75
- HashUpdate.new(
76
+ @product.filters = HashUpdate.new(
77
+ original: @product.filters,
76
78
  adds: params[:new_filters],
77
79
  updates: params[:filters],
78
80
  removes: params[:filters_to_remove]
79
- ).apply(@product.filters)
81
+ ).result
80
82
  end
81
83
  end
82
84
  end
@@ -83,11 +83,12 @@ module Workarea
83
83
  end
84
84
 
85
85
  def set_details
86
- HashUpdate.new(
86
+ @variant.details = HashUpdate.new(
87
+ original: @variant.details,
87
88
  adds: params[:new_details],
88
89
  updates: params[:details],
89
90
  removes: params[:details_to_remove]
90
- ).apply(@variant.details)
91
+ ).result
91
92
  end
92
93
  end
93
94
  end
@@ -74,8 +74,14 @@ module Workarea
74
74
  end
75
75
 
76
76
  def save_details
77
- HashUpdate.new(updates: params[:filters]).apply(@product.filters)
78
- HashUpdate.new(updates: params[:details]).apply(@product.details)
77
+ @product.filters = HashUpdate
78
+ .new(original: @product.filters, updates: params[:filters])
79
+ .result
80
+
81
+ @product.details = HashUpdate
82
+ .new(original: @product.details, updates: params[:details])
83
+ .result
84
+
79
85
  @product.save!
80
86
 
81
87
  flash[:success] = t('workarea.admin.create_catalog_products.flash_messages.saved')
@@ -18,15 +18,15 @@
18
18
  = result.product_id
19
19
  - else
20
20
  = link_to result.product.name, catalog_product_path(result.product)
21
- .insight__product-info
21
+ .insight__product-info.align-center
22
22
  %strong= insights_number_to_percentage(result.average_discount)
23
23
  = t('workarea.admin.insights.most_discounted_products.average_discount')
24
- .insight__product-info
24
+ .insight__product-info.align-center
25
25
  %strong= insights_number_to_percentage(result.discount_rate)
26
26
  = t('workarea.admin.insights.most_discounted_products.discount_rate')
27
- .insight__product-info
27
+ .insight__product-info.align-center
28
28
  %strong= number_with_delimiter(result.units_sold)
29
29
  = t('workarea.admin.insights.most_discounted_products.units_sold')
30
- .insight__product-info
30
+ .insight__product-info.align-center
31
31
  %strong= insights_number_to_percentage(result.conversion_rate)
32
32
  = t('workarea.admin.insights.most_discounted_products.conversion_rate')
@@ -16,6 +16,19 @@ module Workarea
16
16
  assert(product.active)
17
17
  end
18
18
 
19
+ def test_updating_hash_fields_in_locales
20
+ set_locales(available: [:en, :es], default: :en, current: :en)
21
+ product = create_product(filters_translations: { 'en' => { 'Size' => ['Large'] } })
22
+
23
+ patch admin.catalog_product_path(product, locale: 'es'),
24
+ params: { new_filters: %w(Color Roja) }
25
+
26
+ assert_equal(
27
+ { 'en' => { 'Size' => ['Large'] }, 'es' => { 'Color' => ['Roja'] } },
28
+ product.reload.filters_translations
29
+ )
30
+ end
31
+
19
32
  def test_returns_a_list_of_filters
20
33
  create_product(filters: { 'Color' => 'Blue' })
21
34
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workarea-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.9
4
+ version: 3.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Crouse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-15 00:00:00.000000000 Z
11
+ date: 2020-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: workarea-core
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.5.9
19
+ version: 3.5.10
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: 3.5.9
26
+ version: 3.5.10
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: workarea-storefront
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.5.9
33
+ version: 3.5.10
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: 3.5.9
40
+ version: 3.5.10
41
41
  description: Provides site administration functionality for the Workarea Commerce
42
42
  Platform.
43
43
  email: