workarea-admin 3.4.29 → 3.4.34

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: 9da8bc75f20143ab5701f535e4cce9e2b4a84f9330faab4cbd5fed620cdf6093
4
- data.tar.gz: 6e06dfa75cc2b6292032eba0cd2ca07b14b2948b582e33eeecac0a1320a8646d
3
+ metadata.gz: e5230f58914602ef18cf228a8b7cd3f02e2b1dd9c3d172b14714c7ce7c58f624
4
+ data.tar.gz: cc2a6bf7861708d6e12803b4008633192700c28cb50005b376cc59153aac3fab
5
5
  SHA512:
6
- metadata.gz: 0b679c8124fd1b8d5ebf95d68665229a27ba2c16ca6299bac8cc578181b3e14fd2bbca99fc9bc1f0c744699121aa793f39ef2c6ea934ab6d73f995423de4ba65
7
- data.tar.gz: 935c49a925308f4158eb9800bab1775ccd2e3383306126da65974436e4c59bd951f272c1730811c12cbd78bdc67f8bf79c33655fe6da07ebc5e285d416535162
6
+ metadata.gz: 2bb2e8897d7291d59a3cfd4f35eeb896cd93762ca61a4f79a14d299a280391abc0a2c41e26c0397c0e02f8f46e6f4ad4e1eb33f92500da29056ee64496f12f93
7
+ data.tar.gz: 76f1ec690b2cc56c7e36ae3ee5ed6228c41246ae6fd40111bf3459ac8394dbe0bea6dfa2d2c36a58315cca08fc02aff5454a7355f7ad587c7de929c0d4961da1
@@ -5,7 +5,7 @@ WORKAREA.registerModule('categorizedAutocompleteFields', (function () {
5
5
  'use strict';
6
6
 
7
7
  var getSource = function (request, response) {
8
- $.getJSON('/admin/jump_to', { q: request.term }, function (data) {
8
+ $.getJSON(WORKAREA.routes.admin.jumpToPath(), { q: request.term }, function (data) {
9
9
  response(data.results);
10
10
  });
11
11
  },
@@ -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')
@@ -62,7 +62,9 @@ module Workarea
62
62
  #
63
63
  # @return [String]
64
64
  def sell_price
65
+ return if min_price.blank?
65
66
  return min_price.format unless show_range?
67
+
66
68
  "#{max_price.format} – #{min_price.format}"
67
69
  end
68
70
  end
@@ -28,7 +28,7 @@
28
28
 
29
29
  .property
30
30
  = label_tag 'product[meta_description]', t('workarea.admin.create_catalog_products.content.meta_description'), class: 'property__name'
31
- = text_field_tag 'product[meta_description]', @product.meta_description, class: 'text-box text-box--i18n', placeholder: t('workarea.admin.create_catalog_products.content.defaults_to_a_truncated_description')
31
+ = text_field_tag 'product[meta_description]', @product.meta_description, class: 'text-box text-box--i18n', placeholder: t('workarea.admin.create_catalog_products.content.defaults_to_description')
32
32
  %span.property__note= t('workarea.admin.create_catalog_products.content.provides_a_summary_that_is_displayed_on_search_engine_result_pages')
33
33
 
34
34
  .workflow-bar
@@ -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')
@@ -64,7 +64,7 @@
64
64
  = upcoming_changesets_icon_for(result)
65
65
  = append_partials('admin.pricing_skus_additional_fields', result: result)
66
66
  %td.align-right= number_to_currency result.msrp
67
- %td.align-right= result.sell_price
67
+ %td.align-right= result.sell_price || '–'
68
68
  %td.align-center= t("workarea.admin.#{result.on_sale?}")
69
69
  %td.align-center= t("workarea.admin.#{result.discountable?}")
70
70
  %td= local_time_ago(result.updated_at)
@@ -2,7 +2,7 @@
2
2
 
3
3
  .view
4
4
  .view__header
5
- .grid.grid--middle.grid--right
5
+ .grid.grid--right
6
6
  .grid__cell.grid__cell--50
7
7
  .view__heading
8
8
  = link_to "↑ #{t('workarea.admin.users.index.dashboard_link')}", people_dashboards_path, class: 'view__dashboard-button'
@@ -916,6 +916,7 @@ en:
916
916
  browser_title: Browser Title
917
917
  cancel: Cancel
918
918
  defaults_to_a_truncated_description: "(defaults to a truncated description)"
919
+ defaults_to_description: "(defaults to description)"
919
920
  description: Description
920
921
  meta_description: Meta Description
921
922
  or_skip_this: or skip this
@@ -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?)
@@ -252,6 +252,17 @@ module Workarea
252
252
  )
253
253
  end
254
254
  end
255
+
256
+ def test_sorting_by_recency
257
+ create_user(email: 'foo-one@workarea.com', updated_at: 1.day.ago)
258
+ create_user(email: 'foo-two@workarea.com', updated_at: 1.hour.ago)
259
+ get admin.jump_to_path(q: 'foo')
260
+
261
+ results = JSON.parse(response.body)['results']
262
+ assert_equal(2, results.length)
263
+ assert_match('foo-two@workarea.com', results.first['label'])
264
+ assert_match('foo-one@workarea.com', results.second['label'])
265
+ end
255
266
  end
256
267
  end
257
268
  end
@@ -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(
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.29
4
+ version: 3.4.34
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-03-17 00:00:00.000000000 Z
11
+ date: 2020-06-11 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.29
19
+ version: 3.4.34
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.29
26
+ version: 3.4.34
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.29
33
+ version: 3.4.34
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.29
40
+ version: 3.4.34
41
41
  description: Provides site administration functionality for the Workarea Commerce
42
42
  Platform.
43
43
  email:
@@ -1401,7 +1401,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1401
1401
  - !ruby/object:Gem::Version
1402
1402
  version: '0'
1403
1403
  requirements: []
1404
- rubygems_version: 3.0.6
1404
+ rubygems_version: 3.0.3
1405
1405
  signing_key:
1406
1406
  specification_version: 4
1407
1407
  summary: Admin for the Workarea Commerce Platform