workarea-admin 3.4.31 → 3.4.36
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 +5 -5
- data/app/controllers/workarea/admin/bulk_action_sequential_product_edits_controller.rb +6 -4
- data/app/controllers/workarea/admin/catalog_products_controller.rb +6 -4
- data/app/controllers/workarea/admin/catalog_variants_controller.rb +3 -2
- data/app/controllers/workarea/admin/create_catalog_products_controller.rb +8 -2
- data/app/view_models/workarea/admin/code_list_view_model.rb +1 -1
- data/app/views/workarea/admin/create_users/admin.html.haml +2 -0
- data/app/views/workarea/admin/facets/_applied.html.haml +1 -1
- data/app/views/workarea/admin/insights/_most_discounted_products.html.haml +4 -4
- data/app/views/workarea/admin/pricing_discount_code_lists/_cards.html.haml +1 -1
- data/app/views/workarea/admin/pricing_discount_code_lists/promo_codes.html.haml +1 -1
- data/test/integration/workarea/admin/assets_integration_test.rb +1 -3
- data/test/integration/workarea/admin/products_integration_test.rb +13 -0
- data/test/system/workarea/admin/assets_system_test.rb +0 -8
- data/test/view_models/workarea/admin/code_list_view_model_test.rb +5 -0
- metadata +8 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 8d18ceffd52a8ba4e7098980428f5f3ede7e0892
|
|
4
|
+
data.tar.gz: 3b29ccc5629cb4fa9556ecf576602b18bee63b92
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d2633b07e8f39598b1ac66361bca9e4d2364555421f1ac40731c7cb471574dd67c674df3c6c7422db70b540a17d74990f40683dcea248b864759e03de2736e88
|
|
7
|
+
data.tar.gz: 5213ec59a16eca3ad97335ebf98b1b9699f7753405593ad8fb6b16104df3363baf3a96b8a9aa93502c9aa3eda5a382a8cfb0b7619a2ca44d902cb814db07778f
|
|
@@ -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
|
-
).
|
|
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
|
-
).
|
|
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
|
-
).
|
|
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
|
-
).
|
|
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
|
-
).
|
|
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
|
-
|
|
78
|
-
|
|
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')
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
- @search.facet_selections.each do |facet, values|
|
|
11
11
|
- values.each do |value|
|
|
12
12
|
%li.browsing-controls__applied-filter
|
|
13
|
-
%span= value
|
|
13
|
+
%span= facet_value_display_name(facet, value)
|
|
14
14
|
= link_to facet_path(facet, value), class: 'browsing-controls__applied-remove-link' do
|
|
15
15
|
= inline_svg('workarea/admin/icons/close.svg', class: 'browsing-controls__applied-icon svg-icon svg-icon--small svg-icon--black', title: t('workarea.admin.facets.applied.remove_filter'))
|
|
16
16
|
|
|
@@ -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')
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
.grid
|
|
46
46
|
.grid__cell.grid__cell--50
|
|
47
47
|
.align-center
|
|
48
|
-
%h2.heading.heading--no-margin= model.count
|
|
48
|
+
%h2.heading.heading--no-margin= model.promo_codes.count
|
|
49
49
|
%p #{t('workarea.admin.pricing_discount_code_lists.cards.promo_codes.total')}
|
|
50
50
|
.grid__cell.grid__cell--50
|
|
51
51
|
.align-center
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
.view__container.view__container--narrow
|
|
19
19
|
= render_cards_for(@code_list, :promo_codes)
|
|
20
|
-
%p.align-center= t('workarea.admin.pricing_discount_code_lists.promo_code', count: @code_list.count)
|
|
20
|
+
%p.align-center= t('workarea.admin.pricing_discount_code_lists.promo_code', count: @code_list.promo_codes.count)
|
|
21
21
|
|
|
22
22
|
%table
|
|
23
23
|
%thead
|
|
@@ -6,9 +6,7 @@ module Workarea
|
|
|
6
6
|
include Admin::IntegrationTest
|
|
7
7
|
|
|
8
8
|
def test_ensures_cors_policy_for_bulk_upload
|
|
9
|
-
Workarea.s3.expects(:get_bucket_cors).returns(
|
|
10
|
-
mock('Excon::Response', data: { body: { 'CORSConfiguration' => [] } })
|
|
11
|
-
)
|
|
9
|
+
Workarea.s3.expects(:get_bucket_cors).returns(mock_s3_cors_response).once
|
|
12
10
|
Workarea.s3.expects(:put_bucket_cors).once
|
|
13
11
|
get admin.content_assets_path
|
|
14
12
|
assert(response.ok?)
|
|
@@ -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
|
|
|
@@ -5,14 +5,7 @@ module Workarea
|
|
|
5
5
|
class AssetsSystemTest < SystemTest
|
|
6
6
|
include Admin::IntegrationTest
|
|
7
7
|
|
|
8
|
-
def mock_get_bucket_cors
|
|
9
|
-
Workarea.s3.expects(:get_bucket_cors).returns(
|
|
10
|
-
mock('Excon::Response', data: { body: { 'CORSConfiguration' => [] } })
|
|
11
|
-
)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
8
|
def test_management
|
|
15
|
-
mock_get_bucket_cors
|
|
16
9
|
visit admin.content_assets_path
|
|
17
10
|
click_link 'add_asset'
|
|
18
11
|
|
|
@@ -38,7 +31,6 @@ module Workarea
|
|
|
38
31
|
end
|
|
39
32
|
|
|
40
33
|
def test_insertion
|
|
41
|
-
mock_get_bucket_cors
|
|
42
34
|
asset = create_asset
|
|
43
35
|
|
|
44
36
|
content = create_content(
|
|
@@ -21,6 +21,11 @@ module Workarea
|
|
|
21
21
|
|
|
22
22
|
view_model = CodeListViewModel.wrap(code_list)
|
|
23
23
|
assert_equal(1, view_model.used_count)
|
|
24
|
+
|
|
25
|
+
code_list.promo_codes.create!(code: "#{code_list.prefix}123")
|
|
26
|
+
|
|
27
|
+
view_model = CodeListViewModel.wrap(code_list)
|
|
28
|
+
assert_equal(1, view_model.used_count)
|
|
24
29
|
end
|
|
25
30
|
|
|
26
31
|
def test_last_used_at
|
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.4.
|
|
4
|
+
version: 3.4.36
|
|
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-
|
|
11
|
+
date: 2020-07-07 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.4.
|
|
19
|
+
version: 3.4.36
|
|
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.4.
|
|
26
|
+
version: 3.4.36
|
|
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.4.
|
|
33
|
+
version: 3.4.36
|
|
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.4.
|
|
40
|
+
version: 3.4.36
|
|
41
41
|
description: Provides site administration functionality for the Workarea Commerce
|
|
42
42
|
Platform.
|
|
43
43
|
email:
|
|
@@ -1401,7 +1401,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1401
1401
|
- !ruby/object:Gem::Version
|
|
1402
1402
|
version: '0'
|
|
1403
1403
|
requirements: []
|
|
1404
|
-
|
|
1404
|
+
rubyforge_project:
|
|
1405
|
+
rubygems_version: 2.6.14.1
|
|
1405
1406
|
signing_key:
|
|
1406
1407
|
specification_version: 4
|
|
1407
1408
|
summary: Admin for the Workarea Commerce Platform
|