workarea-admin 3.5.18 → 3.5.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/workarea/admin/modules/new_navigation_taxons.js +2 -1
  3. data/app/assets/stylesheets/workarea/admin/components/_toggle_button.scss +4 -0
  4. data/app/controllers/workarea/admin/impersonations_controller.rb +2 -1
  5. data/app/helpers/workarea/admin/application_helper.rb +4 -0
  6. data/app/view_models/workarea/admin/product_view_model.rb +6 -9
  7. data/app/view_models/workarea/admin/variant_view_model.rb +1 -1
  8. data/app/views/workarea/admin/bulk_action_sequential_product_edits/product.html.haml +1 -1
  9. data/app/views/workarea/admin/catalog_categories/edit.html.haml +3 -0
  10. data/app/views/workarea/admin/catalog_product_images/edit.html.haml +1 -1
  11. data/app/views/workarea/admin/catalog_products/_cards.html.haml +1 -1
  12. data/app/views/workarea/admin/catalog_variants/edit.html.haml +0 -5
  13. data/app/views/workarea/admin/catalog_variants/new.html.haml +0 -5
  14. data/app/views/workarea/admin/inventory_skus/_cards.html.haml +3 -0
  15. data/app/views/workarea/admin/inventory_skus/index.html.haml +2 -0
  16. data/app/views/workarea/admin/navigation_menus/_summary.html.haml +1 -1
  17. data/app/views/workarea/admin/navigation_redirects/index.html.haml +5 -0
  18. data/app/views/workarea/admin/pricing_discounts/properties/_product_attribute.html.haml +1 -1
  19. data/app/views/workarea/admin/shared/_toggle_button.html.haml +1 -1
  20. data/app/views/workarea/admin/tax_categories/_cards.html.haml +1 -1
  21. data/app/views/workarea/admin/tax_rates/edit.html.haml +3 -3
  22. data/app/views/workarea/admin/tax_rates/index.html.haml +3 -3
  23. data/app/views/workarea/admin/tax_rates/new.html.haml +3 -3
  24. data/app/views/workarea/admin/toolbar/show.html.haml +1 -0
  25. data/app/views/workarea/admin/users/insights.html.haml +12 -0
  26. data/config/locales/en.yml +20 -11
  27. data/test/integration/workarea/admin/impersonations_integration_test.rb +24 -1
  28. data/test/integration/workarea/admin/jump_to_integration_test.rb +4 -1
  29. data/test/javascripts/fixtures/existing_navigation_taxon.html.haml +10 -0
  30. data/test/javascripts/new_navigation_taxons_spec.js +12 -1
  31. data/test/system/workarea/admin/assets_system_test.rb +1 -1
  32. data/test/system/workarea/admin/bookmarks_system_test.rb +2 -2
  33. data/test/system/workarea/admin/bulk_actions_system_test.rb +5 -5
  34. data/test/system/workarea/admin/comments_system_test.rb +1 -1
  35. data/test/system/workarea/admin/content_system_test.rb +1 -1
  36. data/test/system/workarea/admin/dashboard_system_test.rb +1 -1
  37. data/test/system/workarea/admin/impersonation_system_test.rb +2 -5
  38. data/test/system/workarea/admin/inventory_skus_system_test.rb +1 -1
  39. data/test/system/workarea/admin/menus_system_test.rb +1 -1
  40. data/test/system/workarea/admin/pricing_sku_prices_system_test.rb +3 -3
  41. data/test/system/workarea/admin/recommendations_system_test.rb +2 -2
  42. data/test/system/workarea/admin/releases_system_test.rb +6 -6
  43. data/test/system/workarea/admin/tax_categories_system_test.rb +6 -5
  44. data/test/system/workarea/admin/taxonomy_system_test.rb +2 -2
  45. data/test/system/workarea/admin/trash_system_test.rb +1 -1
  46. data/test/view_models/workarea/admin/product_view_model_test.rb +2 -2
  47. metadata +7 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6b46068c998bbe814822add9ab5e2cc9036905b1fff4051093c2d8312f2d959
4
- data.tar.gz: 586a0e6ec7cc56a6fec6bb5bedcb5a1f3472f687b62c8185b585b264bb5ea6a6
3
+ metadata.gz: e3383b5c3dcd1133b0dd3d1db3e5f7f88accd4ed03091558be38e7cfe789742c
4
+ data.tar.gz: 7c0eded18d5111109507f5b60f1abab417f78225382d5585c5d76175212e5393
5
5
  SHA512:
6
- metadata.gz: f12e56f8d1f0013c1f63da5aa37880f28da03fa746a9f8926574b1889ebbd8910e76dd7a6f63aeeaf41a1831ea388df9aacc74833a7b0e7f21423d6ec4d3f5e4
7
- data.tar.gz: 518be2e9744c165d0dcbc31eaba2e4f31f531dba8adc977b11fab3c64cce694e4c36a8e1f2e8ab473fb5b48ff104cbb6dfb73bdefcd387d190b5fb0a39831379
6
+ metadata.gz: 72363af418b41e0b20cecc252d6aec6826f0becc25472e591008f1a29042acf90ac3210ced12041d79b09b3b3b8296346e9e58857454226a4276abfe6a172e57
7
+ data.tar.gz: ad2a62d784e93e6c74b266b833637777eb6c6630dffdf02992d4a7a3f7a5deafe9671e5855040dcd4f0fa30b552cb349d1ba9f2508c3f2b1290b9f6e120053d5
@@ -23,8 +23,9 @@ WORKAREA.registerModule('newNavigationTaxons', (function () {
23
23
  createRemoteSelect = function (event) {
24
24
  var $typeSelect = $(event.currentTarget),
25
25
  $idSelect = $('[name=navigable_id]', event.delegateTarget),
26
+ $section = $typeSelect.closest('[data-new-navigation-taxon]'),
26
27
  settings = getConfig($typeSelect),
27
- selected = $typeSelect.data('newNavigationTaxon');
28
+ selected = $section.data('newNavigationTaxon');
28
29
 
29
30
  if ($idSelect.is('.select2-hidden-accessible') && _.isUndefined(selected)) {
30
31
  destroyRemoteSelect($idSelect);
@@ -20,6 +20,10 @@ $toggle-button-status-negative-color: $red !default;
20
20
  display: inline-block;
21
21
  }
22
22
 
23
+ .toggle-button--disabled {
24
+ opacity: 0.5;
25
+ }
26
+
23
27
  /**
24
28
  * 1. provides positiioning context for `.toggle-button__label`
25
29
  * 2. height + vertical margin = `.text-box` height
@@ -27,7 +27,8 @@ module Workarea
27
27
  clear_current_order
28
28
 
29
29
  flash[:success] = t('workarea.admin.users.flash_messages.stopped')
30
- redirect_to user_path(previous_user_id)
30
+ referrer = URI.parse(request.referrer).request_uri rescue nil
31
+ redirect_back_or(referrer.presence || user_path(previous_user_id))
31
32
  end
32
33
  end
33
34
  end
@@ -175,6 +175,10 @@ module Workarea
175
175
  .map { |unit, val| t("workarea.duration.#{unit}", count: val) }
176
176
  .to_sentence
177
177
  end
178
+
179
+ def navigation_redirects_enabled?
180
+ !Rails.application.config.consider_all_requests_local
181
+ end
178
182
  end
179
183
  end
180
184
  end
@@ -42,7 +42,7 @@ module Workarea
42
42
  def storefront_view_model
43
43
  @storefront_view_model ||= Storefront::ProductViewModel.wrap(
44
44
  model,
45
- @options
45
+ options
46
46
  )
47
47
  end
48
48
 
@@ -75,7 +75,7 @@ module Workarea
75
75
  end
76
76
 
77
77
  def available_inventory
78
- @available_inventory ||= Inventory.total_available(*model.skus)
78
+ @available_inventory ||= Inventory::Collection.new(model.skus).available_to_sell
79
79
  end
80
80
 
81
81
  def ignore_inventory?
@@ -93,16 +93,13 @@ module Workarea
93
93
  end
94
94
  end
95
95
 
96
- def options
97
- variants.reduce({}) do |memo, variant|
96
+ def variant_details
97
+ variants.each_with_object({}) do |variant, memo|
98
98
  variant.details.each do |name, value|
99
99
  memo[name] ||= []
100
- memo[name] << value
101
- memo[name].flatten!
100
+ memo[name] += Array.wrap(value)
102
101
  memo[name].uniq!
103
102
  end
104
-
105
- memo
106
103
  end
107
104
  end
108
105
 
@@ -125,7 +122,7 @@ module Workarea
125
122
  end
126
123
 
127
124
  def insights
128
- @insights ||= Insights::ProductViewModel.wrap(model, @options)
125
+ @insights ||= Insights::ProductViewModel.wrap(model, options)
129
126
  end
130
127
 
131
128
  def inventory
@@ -12,7 +12,7 @@ module Workarea
12
12
  end
13
13
 
14
14
  def available_inventory
15
- inventory.available
15
+ inventory.available_to_sell
16
16
  end
17
17
 
18
18
  def available_to_sell_inventory
@@ -206,7 +206,7 @@
206
206
  %td
207
207
  = text_field_tag 'variants[][tax_code]', variant.tax_code, placeholder: 'Tax Code', class: 'text-box text-box--small', autocomplete: 'off', id: dom_id(variant, 'variant_tax_code')
208
208
  %td
209
- = number_field_tag 'variants[][inventory]', variant.available_inventory, placeholder: '0', class: 'text-box text-box--small', id: dom_id(variant, 'variant_inventory')
209
+ = number_field_tag 'variants[][inventory]', variant.inventory.available, placeholder: '0', class: 'text-box text-box--small', id: dom_id(variant, 'variant_inventory')
210
210
 
211
211
  %tr{ data: { cloneable_row: '' } }
212
212
  %td
@@ -60,6 +60,9 @@
60
60
  .property
61
61
  = label_tag 'category_default_sort', t('workarea.admin.fields.default_sort'), class: 'property__name'
62
62
  = select_tag 'category[default_sort]', options_for_select(@category.sort_options, selected: @category.default_sort)
63
+ - if @category.featured_products?
64
+ %span.property__note
65
+ = t('workarea.admin.catalog_categories.edit.default_sort_note')
63
66
 
64
67
  .property
65
68
  = label_tag 'category_terms_facets_list', t('workarea.admin.fields.terms_facets_list'), class: 'property__name'
@@ -25,7 +25,7 @@
25
25
  .product-images__image-group
26
26
  .product-images__image
27
27
  .product-images__image-summary
28
- .product-images__image-summary-container= image_tag product_image_url(@image, :small), alt: "#{@image.option} #{t('workarea.admin.catalog_product_images.edit.image')}", id: @image.option.parameterize, class: 'product-images__image-summary-image'
28
+ .product-images__image-summary-container= image_tag product_image_url(@image, :small), alt: "#{@image.option} #{t('workarea.admin.catalog_product_images.edit.image')}", class: 'product-images__image-summary-image'
29
29
 
30
30
  .section
31
31
  %h2= t('workarea.admin.catalog_product_images.edit.edit_image')
@@ -108,7 +108,7 @@
108
108
  %p.align-center= t('workarea.admin.fields.inventory')
109
109
 
110
110
  %span.heading.heading--3.heading--no-margin.align-center
111
- = model.options.keys.to_sentence
111
+ = model.variant_details.keys.to_sentence
112
112
  %p.align-center= t('workarea.admin.fields.options')
113
113
 
114
114
  = link_to catalog_product_variants_path(model), class: 'card__button' do
@@ -63,11 +63,6 @@
63
63
  .property
64
64
  = text_field_tag 'new_details[]', nil, id: nil, class: 'text-box text-box--i18n', title: t('workarea.admin.catalog_variants.edit.options.new_attribute_value'), placeholder: t('workarea.admin.catalog_variants.edit.options.new_attribute_value_placeholder')
65
65
  %span.property__note= t('workarea.admin.catalog_variants.edit.options.new_attribute_value_note')
66
- %span.property__note
67
- = t('workarea.admin.catalog_variants.edit.options.new_attribute_value_csv')
68
- = link_to '#csv-help', data: { tooltip: '' } do
69
- = inline_svg('workarea/admin/icons/help.svg', class: 'svg-icon svg-icon--small svg-icon--blue', title: t('workarea.admin.catalog_variants.edit.options.learn_more'))
70
- = render 'workarea/admin/shared/csv_formatting_tooltip'
71
66
  %td.align-center -
72
67
 
73
68
  = append_partials('admin.additional_variant_information_fields', variant: @variant)
@@ -55,11 +55,6 @@
55
55
  .property
56
56
  = text_field_tag 'new_details[]', nil, id: nil, class: 'text-box text-box--i18n', title: t('workarea.admin.catalog_variants.new.options.new_attribute_value'), placeholder: t('workarea.admin.catalog_variants.new.options.new_attribute_value_placeholder')
57
57
  %span.property__note= t('workarea.admin.catalog_variants.new.options.new_attribute_value_note')
58
- %span.property__note
59
- = t('workarea.admin.catalog_variants.new.options.new_attribute_value_csv')
60
- = link_to '#csv-help', data: { tooltip: '' } do
61
- = inline_svg('workarea/admin/icons/help.svg', class: 'svg-icon svg-icon--small svg-icon--blue', title: t('workarea.admin.catalog_variants.new.options.learn_more'))
62
- = render 'workarea/admin/shared/csv_formatting_tooltip'
63
58
  %td.align-center -
64
59
 
65
60
  = append_partials('admin.additional_variant_information_fields', variant: @variant)
@@ -11,6 +11,9 @@
11
11
  %li
12
12
  %strong= t('workarea.admin.fields.policy')
13
13
  = model.policy.titleize.presence
14
+ %li
15
+ %strong= t('workarea.admin.fields.sellable')
16
+ = model.sellable
14
17
  %li
15
18
  %strong= t('workarea.admin.fields.available')
16
19
  = model.available
@@ -46,6 +46,7 @@
46
46
  = check_box_tag 'select_all', nil, false, id: 'select_all', class: 'checkbox__input', data: { bulk_action_select_all: '' }
47
47
  = label_tag 'select_all', t('workarea.admin.bulk_actions.select_all'), class: 'checkbox__label'
48
48
  %th= t('workarea.admin.fields.sku')
49
+ %th.align-center= t('workarea.admin.fields.sellable')
49
50
  %th.align-center= t('workarea.admin.fields.available')
50
51
  %th.align-center= t('workarea.admin.fields.sold')
51
52
  %th.align-center= t('workarea.admin.fields.backordered_units')
@@ -62,6 +63,7 @@
62
63
  %td
63
64
  = link_to result.id, inventory_sku_path(result)
64
65
  = upcoming_changesets_icon_for(result)
66
+ %td.align-center= result.sellable
65
67
  %td.align-center= result.available
66
68
  %td.align-center= result.purchased
67
69
  %td.align-center= result.backordered
@@ -6,5 +6,5 @@
6
6
  #{local_time_ago(model.updated_at)}
7
7
  - else
8
8
  %span.summary__info-text-inactive= t('workarea.admin.navigation_menus.summary.inactive')
9
- %span.summary__info= t('workarea.admin.navigation_menus.summary.content_block', count: model.content.try(:blocks).size)
9
+ %span.summary__info= t('workarea.admin.navigation_menus.summary.content_block', count: model.content&.blocks&.size.to_i)
10
10
  %span.summary__type{ title: t('workarea.admin.navigation_menus.summary.type') }= t('workarea.admin.navigation_menus.summary.type')
@@ -5,6 +5,11 @@
5
5
  .view__heading
6
6
  = link_to "↑ #{t('workarea.admin.navigation_redirects.index.dashboard_link')}", settings_dashboards_path, class: 'view__dashboard-button'
7
7
  %h1= t('workarea.admin.navigation_redirects.index.title')
8
+ - unless navigation_redirects_enabled?
9
+ .grid.grid--center
10
+ .grid__cell.grid__cell--50
11
+ = render_message 'warning' do
12
+ = t('workarea.admin.navigation_redirects.index.disabled')
8
13
 
9
14
  .view__container
10
15
 
@@ -5,7 +5,7 @@
5
5
  %span.discount__node
6
6
  %span.property.property--inline
7
7
  = text_field_tag 'discount[amount]', @discount.amount, class: 'text-box text-box--small', title: 'Amount of Discount', placeholder: '10', required: true
8
- %span.discount__node off products
8
+ %span.discount__node off the item's unit price
9
9
 
10
10
  .discount__node-line
11
11
  %p.discount__node-group
@@ -1,4 +1,4 @@
1
- .toggle-button{ data: data }
1
+ .toggle-button{ data: data, class: disabled ? 'toggle-button--disabled' : nil }
2
2
  .toggle-button__switch
3
3
  = radio_button_tag input_name, true, condition, disabled: disabled, class: 'toggle-button__input toggle-button__input--positive', title: title_true, id: "#{dom_id}_true"
4
4
  = label_tag "#{dom_id}_false", label_true, class: 'toggle-button__label toggle-button__label--positive', id: "#{dom_id}_false_label"
@@ -37,7 +37,7 @@
37
37
  %ul.list-reset
38
38
  - model.newest_rates.each do |rate|
39
39
  %li
40
- %strong= number_to_percentage(rate.percentage * 100, precision: 1)
40
+ %strong= number_to_percentage(rate.percentage * 100, strip_insignificant_zeros: true)
41
41
 
42
42
  - if rate.tier_min.present? && rate.tier_max.present?
43
43
  #{number_to_currency(rate.tier_min)} - #{number_to_currency(rate.tier_max)},
@@ -21,7 +21,7 @@
21
21
  .grid__cell.grid__cell--50
22
22
  .property
23
23
  = label_tag 'rate_country_percentage', t('workarea.admin.tax_rates.index.table.country_percentage'), class: 'property__name'
24
- = number_field_tag 'rate[country_percentage]', @rate.country_percentage * 100, min: 0, max: 100, step: 0.01, class: 'text-box text-box--i18n'
24
+ = number_field_tag 'rate[country_percentage]', @rate.country_percentage.to_f * 100, min: 0, max: 100, step: '0.001', class: 'text-box text-box--i18n'
25
25
 
26
26
  .grid__cell.grid__cell--50
27
27
  .property
@@ -31,7 +31,7 @@
31
31
  .grid__cell.grid__cell--50
32
32
  .property
33
33
  = label_tag 'rate_region_percentage', t('workarea.admin.tax_rates.index.table.region_percentage'), class: 'property__name'
34
- = number_field_tag 'rate[region_percentage]', @rate.region_percentage * 100, min: 0, max: 100, step: 0.01, class: 'text-box text-box--i18n'
34
+ = number_field_tag 'rate[region_percentage]', @rate.region_percentage.to_f * 100, min: 0, max: 100, step: '0.001', class: 'text-box text-box--i18n'
35
35
 
36
36
  .grid__cell.grid__cell--50
37
37
  .property
@@ -41,7 +41,7 @@
41
41
  .grid__cell.grid__cell--50
42
42
  .property
43
43
  = label_tag 'rate_postal_code_percentage', t('workarea.admin.tax_rates.index.table.postal_code_percentage'), class: 'property__name'
44
- = number_field_tag 'rate[postal_code_percentage]', @rate.postal_code_percentage * 100, min: 0, max: 100, step: 0.01, class: 'text-box text-box--i18n'
44
+ = number_field_tag 'rate[postal_code_percentage]', @rate.postal_code_percentage.to_f * 100, min: 0, max: 100, step: '0.001', class: 'text-box text-box--i18n'
45
45
 
46
46
  .grid__cell.grid__cell--33
47
47
  .property
@@ -56,9 +56,9 @@
56
56
  %td.align-center= rate.country.try(&:alpha2) || '-'
57
57
  %td.align-center= rate.region || '-'
58
58
  %td.align-center= rate.postal_code.presence || '-'
59
- %td.align-center= number_to_percentage(rate.country_percentage * 100, precision: 1)
60
- %td.align-center= number_to_percentage(rate.region_percentage * 100, precision: 1)
61
- %td.align-center= number_to_percentage(rate.postal_code_percentage * 100, precision: 1)
59
+ %td.align-center= number_to_percentage(rate.country_percentage.to_f * 100, strip_insignificant_zeros: true)
60
+ %td.align-center= number_to_percentage(rate.region_percentage.to_f * 100, strip_insignificant_zeros: true)
61
+ %td.align-center= number_to_percentage(rate.postal_code_percentage.to_f * 100, strip_insignificant_zeros: true)
62
62
  %td.align-center= rate.tier_min.present? ? number_to_currency(rate.tier_min) : t('workarea.admin.tax_rates.index.not_applicable')
63
63
  %td.align-center= rate.tier_max.present? ? number_to_currency(rate.tier_max) : t('workarea.admin.tax_rates.index.not_applicable')
64
64
  %td.align-center= rate.charge_on_shipping ? t('workarea.admin.true') : t('workarea.admin.false')
@@ -19,7 +19,7 @@
19
19
  .grid__cell.grid__cell--50
20
20
  .property
21
21
  = label_tag 'rate_country_percentage', t('workarea.admin.tax_rates.index.table.country_percentage'), class: 'property__name'
22
- = number_field_tag 'rate[country_percentage]', @rate.country_percentage * 100, min: 0, max: 100, step: 0.01, class: 'text-box'
22
+ = number_field_tag 'rate[country_percentage]', @rate.country_percentage.to_f * 100, min: 0, max: 100, step: '0.001', class: 'text-box'
23
23
 
24
24
  .grid__cell.grid__cell--50
25
25
  .property
@@ -29,7 +29,7 @@
29
29
  .grid__cell.grid__cell--50
30
30
  .property
31
31
  = label_tag 'rate_region_percentage', t('workarea.admin.tax_rates.index.table.region_percentage'), class: 'property__name'
32
- = number_field_tag 'rate[region_percentage]', @rate.region_percentage * 100, min: 0, max: 100, step: 0.01, class: 'text-box'
32
+ = number_field_tag 'rate[region_percentage]', @rate.region_percentage.to_f * 100, min: 0, max: 100, step: '0.001', class: 'text-box'
33
33
 
34
34
  .grid__cell.grid__cell--50
35
35
  .property
@@ -39,7 +39,7 @@
39
39
  .grid__cell.grid__cell--50
40
40
  .property
41
41
  = label_tag 'rate_postal_code_percentage', t('workarea.admin.tax_rates.index.table.postal_code_percentage'), class: 'property__name'
42
- = number_field_tag 'rate[postal_code_percentage]', @rate.postal_code_percentage * 100, min: 0, max: 100, step: 0.01, class: 'text-box'
42
+ = number_field_tag 'rate[postal_code_percentage]', @rate.postal_code_percentage.to_f * 100, min: 0, max: 100, step: '0.001', class: 'text-box'
43
43
 
44
44
  .grid__cell.grid__cell--33
45
45
  .property
@@ -81,6 +81,7 @@
81
81
  = link_to current_impersonation.email, user_path(current_impersonation)
82
82
  %br
83
83
  = form_tag impersonations_path, method: 'delete', data: { disable_delete_confirmation: '' } do
84
+ = hidden_field_tag :return_to, return_to
84
85
  = button_tag t('workarea.admin.toolbar.stop_impersonation'), class: 'text-button text-button--destroy'
85
86
 
86
87
  - if allow_pricing_override?
@@ -106,6 +106,18 @@
106
106
  = @user.insights.average_order_value_percentile.ordinalize
107
107
  = t('workarea.admin.users.insights.percentile')
108
108
 
109
+ .align-center
110
+ = link_to '#customer-insights-info', data: { tooltip: { side: 'bottom', interactive: true } } do
111
+ = t('workarea.admin.users.insights.customer_insights')
112
+ #customer-insights-info.tooltip-content.align-center
113
+ = t( |
114
+ 'workarea.admin.users.insights.customer_insights_info_html', |
115
+ best_customers_path: insights_report_path(type: Workarea::Insights::BestCustomers), |
116
+ customers_at_risk_path: insights_report_path(type: Workarea::Insights::CustomersAtRisk), |
117
+ repeat_purchase_rate_path: insights_report_path(type: Workarea::Insights::RepeatPurchaseRate), |
118
+ orders_path: orders_user_path(@user) |
119
+ ) |
120
+
109
121
  .section
110
122
  %h2.align-center= t('workarea.admin.users.insights.recently_viewed.title')
111
123
  .grid.grid--center
@@ -303,6 +303,7 @@ en:
303
303
  views: views
304
304
  edit:
305
305
  client_id_note: Identifies the category for product import
306
+ default_sort_note: 'Since this category has featured products, this sort controls the products listed after the selected featured products.'
306
307
  filters_note_html: 'Comma separated: just, like, this. If these fields are blank, the global values will be used from %{search_settings_link}.'
307
308
  page_title: Attributes for %{category}
308
309
  search_settings: search settings
@@ -502,7 +503,6 @@ en:
502
503
  new_attribute_name_note: 'Example: Material'
503
504
  new_attribute_name_placeholder: New Attribute Name
504
505
  new_attribute_value: New Attribute Value
505
- new_attribute_value_csv: 'Comma separated: just, like, this'
506
506
  new_attribute_value_note: 'Example: Cotton'
507
507
  new_attribute_value_placeholder: New Attribute Value
508
508
  remove: Remove
@@ -541,7 +541,6 @@ en:
541
541
  new_attribute_name_note: 'Example: Material'
542
542
  new_attribute_name_placeholder: New Attribute Name
543
543
  new_attribute_value: New Attribute Value
544
- new_attribute_value_csv: 'Comma separated: just, like, this'
545
544
  new_attribute_value_note: 'Example: Cotton'
546
545
  new_attribute_value_placeholder: New Attribute Value
547
546
  remove: Remove
@@ -1773,6 +1772,7 @@ en:
1773
1772
  searches: Searches
1774
1773
  segments: Segments
1775
1774
  sell_price: Sell Price
1775
+ sellable: Sellable Units
1776
1776
  send_account_creation_email: Notify Them by Email
1777
1777
  service: Service
1778
1778
  service_code: Service Code
@@ -2281,12 +2281,6 @@ en:
2281
2281
  aux_navigation:
2282
2282
  view_pricing: View Pricing
2283
2283
  view_product: View Product
2284
- cards:
2285
- available: 'Available:'
2286
- backordered: 'Backordered:'
2287
- policy: 'Policy:'
2288
- purchased: 'Purchased:'
2289
- reserve: 'Reserve:'
2290
2284
  edit:
2291
2285
  available_quantity: Available Quantity
2292
2286
  backordered_quantity: Backordered Quantity
@@ -2496,6 +2490,10 @@ en:
2496
2490
  destination_label: Redirect To
2497
2491
  destination_note: Can be any URL
2498
2492
  destination_placeholder: "/new/path.html"
2493
+ disabled: >
2494
+ This application is configured to consider requests to be local, so the Workarea exception handling isn't used.
2495
+ This is most likely because it's running the development environment, where you want exceptions to be seen in responses.
2496
+ These redirects won't work without this.
2499
2497
  from: From
2500
2498
  import: Import Redirects
2501
2499
  modified: Modified
@@ -3513,10 +3511,10 @@ en:
3513
3511
  description: Define what filters should be shown on search results and categories.
3514
3512
  title: Filters
3515
3513
  synonyms:
3516
- description: Define groups of search terms that should return the same result.
3514
+ description: Define groups of search terms that mean the same thing. Keep in mind this is not the same as "return the same results". For that task, use search customizations.
3517
3515
  phrase_example: united states,u s a,united states of america => usa
3518
3516
  phrase_example_description: 'You can create synonym functionality out of a phrase like so:'
3519
- simple_example: "tshirt, t-shirt, tee-shirt \nskirt, skort"
3517
+ simple_example: "denim, jeans, dungarees \nshirt, pullover, blouse"
3520
3518
  simple_example_description: 'Enter one synonym group per line, for example:'
3521
3519
  title: Synonyms
3522
3520
  title: Search Settings
@@ -4031,7 +4029,7 @@ en:
4031
4029
  changes_saved: Your changes have been saved
4032
4030
  saved: Your changes have been saved
4033
4031
  started: You are now browsing as %{email}
4034
- stopped: Impersonation for this user has been stopped.
4032
+ stopped: Impersonation has been stopped, you are now browsing as your account.
4035
4033
  created: This account has been created
4036
4034
  error: There was an error saving this account
4037
4035
  password_reset: Password reset created. User will receive an email shortly.
@@ -4074,6 +4072,17 @@ en:
4074
4072
  aov: AOV
4075
4073
  insights_for_this_customer: Insights for this Customer
4076
4074
  percentile: percentile
4075
+ customer_insights: Wondering about how Workarea customer insights work?
4076
+ customer_insights_info_html: >
4077
+ <strong>How are customer metrics tracked?</strong>
4078
+ <p>Workarea's metrics engine saves reporting and insights data based on the customer's email address.
4079
+ This allows for the best tracking of customers for generating helpful insights like
4080
+ <a href="%{best_customers_path}">Best Customers</a>, <a href="%{customers_at_risk_path}">Customers at Risk</a>,
4081
+ and <a href="%{repeat_purchase_rate_path}">Repeat Purchase Rate</a> as accurately as possible across both
4082
+ guest and account checkouts.</p>
4083
+ <strong>Wondering why some numbers don't line up?</strong>
4084
+ <p>Because reporting is tracked by email address, changes in email address and/or having an account
4085
+ can cause mismatch between the <a href="%{orders_path}">Orders</a> card and these insights.</p>
4077
4086
  login:
4078
4087
  never: Never logged in
4079
4088
  time_ago: "%{period} ago"
@@ -50,11 +50,34 @@ module Workarea
50
50
 
51
51
  post admin.impersonations_path, params: { user_id: @user.id }
52
52
  delete admin.impersonations_path
53
+ assert_equal(previous_user_id, session[:user_id])
54
+ assert(session[:admin_id].blank?)
53
55
 
54
- assert(response.redirect?)
56
+ post admin.impersonations_path, params: { user_id: @user.id }
57
+ delete admin.impersonations_path
55
58
  assert_equal(previous_user_id, session[:user_id])
56
59
  assert(session[:admin_id].blank?)
57
60
  end
61
+
62
+ def test_redirection_after_destroy
63
+ post admin.impersonations_path, params: { user_id: @user.id }
64
+ delete admin.impersonations_path
65
+ assert_redirected_to(admin.user_path(@user.id))
66
+
67
+ post admin.impersonations_path, params: { user_id: @user.id }
68
+ delete admin.impersonations_path(return_to: '/foo')
69
+ assert_redirected_to('/foo')
70
+
71
+ post admin.impersonations_path, params: { user_id: @user.id }
72
+ delete admin.impersonations_path(return_to: '/foo'),
73
+ headers: { 'HTTP_REFERER' => admin.catalog_products_path }
74
+ assert_redirected_to('/foo')
75
+
76
+ post admin.impersonations_path, params: { user_id: @user.id }
77
+ delete admin.impersonations_path,
78
+ headers: { 'HTTP_REFERER' => admin.catalog_products_url(host: 'foo.com') }
79
+ assert_redirected_to(admin.catalog_products_path)
80
+ end
58
81
  end
59
82
  end
60
83
  end
@@ -110,7 +110,10 @@ module Workarea
110
110
 
111
111
  results = JSON.parse(response.body)['results']
112
112
  assert_equal(1, results.length)
113
- assert_equal('SKU123 (4 available)', results.first['label'])
113
+ assert_equal(
114
+ t('workarea.inventory_sku.jump_to_text', id: 'SKU123', count: 4),
115
+ results.first['label']
116
+ )
114
117
  assert_equal('Inventory Skus', results.first['type'])
115
118
  assert_equal(admin.inventory_sku_path(inventory), results.first['url'])
116
119
 
@@ -0,0 +1,10 @@
1
+ .new-navigation-link__section{ data: { new_navigation_taxon: 'bar' } }
2
+ %fieldset
3
+ %legend
4
+ %span.heading.heading--2 Existing
5
+ .property
6
+ = label_tag 'navigable_type', 'Type', class: 'property__name'
7
+ = select_tag 'navigable_type', options_for_select([['Foo', 'foo', { data: { new_navigation_taxon_endpoint: 'http://foo.com' } }], ['Bar', 'bar', { data: { new_navigation_taxon_endpoint: 'http://bar.com' } }]])
8
+ .property
9
+ = label_tag 'navigable_id', 'Name', class: 'property__name'
10
+ = select_tag 'navigable_id', options_for_select([['Bar', 'bar']], 'bar'), include_blank: true
@@ -6,7 +6,6 @@
6
6
  it('initializes select2 on navigable id select', function () {
7
7
  var markup = 'new_navigation_taxon.html',
8
8
  $fixture = $(fixture.load(markup, true)),
9
-
10
9
  $select = $('[name=navigable_id]', $fixture);
11
10
 
12
11
  expect($select.is('.select2-hidden-accessible')).to.not.be.ok;
@@ -14,6 +13,18 @@
14
13
  WORKAREA.newNavigationTaxons.init($fixture);
15
14
 
16
15
  expect($select.is('.select2-hidden-accessible')).to.be.ok;
16
+ expect($select.val()).to.equal('');
17
+ });
18
+
19
+ it('saves with the existing data', function () {
20
+ var markup = 'existing_navigation_taxon.html',
21
+ $fixture = $(fixture.load(markup, true)),
22
+ $select = $('[name=navigable_id]', $fixture);
23
+
24
+ WORKAREA.newNavigationTaxons.init($fixture);
25
+
26
+ expect($select.is('.select2-hidden-accessible')).to.be.ok;
27
+ expect($select.val()).to.equal('bar');
17
28
  });
18
29
  });
19
30
  });
@@ -27,7 +27,7 @@ module Workarea
27
27
 
28
28
  assert_current_path(admin.content_assets_path)
29
29
  assert(page.has_content?('Success'))
30
- refute(page.has_content?('Edited Asset'))
30
+ refute_text('Edited Asset')
31
31
  end
32
32
 
33
33
  def test_insertion
@@ -16,7 +16,7 @@ module Workarea
16
16
 
17
17
  find('.message__dismiss-button').click
18
18
  find('#shortcuts_menu').hover
19
- refute(page.has_content?('Current Page'))
19
+ refute_text('Current Page')
20
20
 
21
21
  find('#shortcuts_menu').hover
22
22
  menu_item = all('.menu__item').last
@@ -24,7 +24,7 @@ module Workarea
24
24
  find('.menu__delete-link').click
25
25
  assert_current_path(admin.root_path)
26
26
  assert(page.has_content?('Success'))
27
- refute(page.has_content?('Current Page'))
27
+ refute_text('Current Page')
28
28
  end
29
29
  end
30
30
  end
@@ -60,7 +60,7 @@ module Workarea
60
60
  click_link t('workarea.admin.catalog.dashboard_link')
61
61
 
62
62
  visit admin.catalog_products_path
63
- refute(page.has_content?('1 selected'))
63
+ refute_text('1 selected')
64
64
  end
65
65
 
66
66
  def test_persistence
@@ -85,7 +85,7 @@ module Workarea
85
85
  click_button t('workarea.admin.catalog_products.index.edit')
86
86
  click_link t('workarea.admin.form.cancel')
87
87
 
88
- refute(page.has_content?('3 selected'))
88
+ refute_text('3 selected')
89
89
  end
90
90
 
91
91
  def test_select_all
@@ -95,7 +95,7 @@ module Workarea
95
95
  assert(page.has_content?("5 #{t('workarea.admin.shared.bulk_actions.selected')}"))
96
96
 
97
97
  uncheck 'select_all'
98
- refute(page.has_content?(t('workarea.admin.shared.bulk_actions.selected')))
98
+ refute_text(t('workarea.admin.shared.bulk_actions.selected'))
99
99
 
100
100
  check 'select_all'
101
101
  uncheck "catalog_product_#{@products.fifth.id}"
@@ -103,14 +103,14 @@ module Workarea
103
103
  assert(page.has_content?("3 #{t('workarea.admin.shared.bulk_actions.selected')}"))
104
104
 
105
105
  check 'select_all'
106
- refute(page.has_content?(t('workarea.admin.shared.bulk_actions.selected')))
106
+ refute_text(t('workarea.admin.shared.bulk_actions.selected'))
107
107
 
108
108
  check "catalog_product_#{@products.fifth.id}"
109
109
  check "catalog_product_#{@products.fourth.id}"
110
110
  assert(page.has_content?("2 #{t('workarea.admin.shared.bulk_actions.selected')}"))
111
111
 
112
112
  check 'select_all'
113
- refute(page.has_content?(t('workarea.admin.shared.bulk_actions.selected')))
113
+ refute_text(t('workarea.admin.shared.bulk_actions.selected'))
114
114
  end
115
115
 
116
116
  def test_bulk_editing
@@ -39,7 +39,7 @@ module Workarea
39
39
 
40
40
  find_field('comment[body]').send_keys(['@'])
41
41
 
42
- refute(page.has_content?('Bar Baby'))
42
+ refute_text('Bar Baby')
43
43
  assert(page.has_content?('Baz Bat'))
44
44
 
45
45
  find('.tribute-container li', text: 'Baz Bat (baz@workarea.com)').click
@@ -35,7 +35,7 @@ module Workarea
35
35
 
36
36
  find('.content-block').click
37
37
  click_link t('workarea.admin.actions.delete')
38
- refute(page.has_selector?('.content-block'))
38
+ refute_selector('.content-block')
39
39
  end
40
40
 
41
41
  def test_reordering_content_blocks
@@ -64,7 +64,7 @@ module Workarea
64
64
  Workarea.config.hide_from_settings = %i(fooconfig)
65
65
 
66
66
  visit admin.settings_dashboards_path
67
- refute(page.has_content?('Fooconfig'))
67
+ refute_text('Fooconfig')
68
68
  end
69
69
  end
70
70
  end
@@ -34,12 +34,9 @@ module Workarea
34
34
  click_button 'Stop Impersonation'
35
35
  end
36
36
 
37
- assert_equal(admin.user_path(user), current_path)
37
+ assert_equal(storefront.root_path, current_path)
38
38
  assert(page.has_content?('Success'))
39
39
 
40
- find('.view').hover # Ensure tooltipster menu isn't open
41
- assert(page.has_content?('bcrouse@workarea.com'))
42
-
43
40
  visit storefront.users_account_path
44
41
  assert(page.has_no_content?('impersonated@workarea.com'))
45
42
 
@@ -52,7 +49,7 @@ module Workarea
52
49
  click_button 'Stop Impersonation'
53
50
  end
54
51
 
55
- assert_equal(admin.user_path(user), current_path)
52
+ assert_equal(admin.root_path, current_path)
56
53
  assert(page.has_content?('Success'))
57
54
  end
58
55
  end
@@ -28,7 +28,7 @@ module Workarea
28
28
 
29
29
  assert_current_path(admin.inventory_skus_path)
30
30
  assert(page.has_content?('Success'))
31
- refute(page.has_content?('SKU1'))
31
+ refute_text('SKU1')
32
32
  end
33
33
 
34
34
  def test_editing_a_non_existent_sku
@@ -39,7 +39,7 @@ module Workarea
39
39
  within('.navigation-builder__actions') { click_link 'Delete' }
40
40
 
41
41
  assert(page.has_content?('Success'))
42
- refute(page.has_content?('Foo'))
42
+ refute_text('Foo')
43
43
  end
44
44
 
45
45
  def test_managing_content_redirects_back
@@ -71,9 +71,9 @@ module Workarea
71
71
 
72
72
  row = find_all("table tr")[1]
73
73
  within(row) do
74
- refute(page.has_content?('$11.00'))
75
- refute(page.has_content?('$9.99'))
76
- refute(page.has_content?('1'))
74
+ refute_text('$11.00')
75
+ refute_text('$9.99')
76
+ refute_text('1')
77
77
  end
78
78
  end
79
79
  end
@@ -65,8 +65,8 @@ module Workarea
65
65
  assert(page.has_content?('Success'))
66
66
 
67
67
  click_link 'Recommendations'
68
- refute(page.has_selector?("option[value='#{product_2.id}']"))
69
- refute(page.has_selector?("option[value='#{product_3.id}']"))
68
+ refute_selector("option[value='#{product_2.id}']")
69
+ refute_selector("option[value='#{product_3.id}']")
70
70
  assert(page.has_ordered_text?('Custom', 'Similar Products', 'Also Purchased'))
71
71
 
72
72
  #
@@ -49,8 +49,8 @@ module Workarea
49
49
  click_link 'Published (1)'
50
50
  end
51
51
 
52
- refute(page.has_content?('Scheduled Release'))
53
- refute(page.has_content?('Unscheduled Release'))
52
+ refute_text('Scheduled Release')
53
+ refute_text('Unscheduled Release')
54
54
  assert(page.has_content?('Published Release'))
55
55
  end
56
56
 
@@ -277,7 +277,7 @@ module Workarea
277
277
 
278
278
  click_link t('workarea.admin.releases.calendar.next_week')
279
279
  wait_for_xhr
280
- refute(find('.calendar').has_content?('Foo Release'))
280
+ refute_text('Foo Release')
281
281
 
282
282
  click_link t('workarea.admin.releases.calendar.previous_week')
283
283
  wait_for_xhr
@@ -285,7 +285,7 @@ module Workarea
285
285
 
286
286
  click_link t('workarea.admin.releases.calendar.next_week')
287
287
  wait_for_xhr
288
- refute(find('.calendar').has_content?('Foo Release'))
288
+ refute_text('Foo Release')
289
289
 
290
290
  click_button t('workarea.admin.releases.calendar.today')
291
291
  wait_for_xhr
@@ -321,8 +321,8 @@ module Workarea
321
321
 
322
322
  visit admin.releases_path
323
323
 
324
- refute(page.has_content?('Release Five'))
325
- refute(page.has_content?('Release Six'))
324
+ refute_text('Release Five')
325
+ refute_text('Release Six')
326
326
 
327
327
  assert(
328
328
  page.has_content?(
@@ -74,9 +74,9 @@ module Workarea
74
74
  assert(page.has_content?('PA'))
75
75
  assert(page.has_content?('19106'))
76
76
 
77
- assert(page.has_content?('6.0%'))
78
- assert(page.has_content?('4.0%'))
79
- assert(page.has_content?('2.0%'))
77
+ assert(page.has_content?('6%'))
78
+ assert(page.has_content?('4%'))
79
+ assert(page.has_content?('2%'))
80
80
 
81
81
  assert(page.has_content?("#{Money.default_currency.symbol}5.00"))
82
82
  assert(page.has_content?("#{Money.default_currency.symbol}500.00"))
@@ -91,7 +91,7 @@ module Workarea
91
91
  click_link t('workarea.admin.actions.edit')
92
92
  end
93
93
 
94
- fill_in 'rate[country_percentage]', with: 0
94
+ fill_in 'rate[country_percentage]', with: 0.005
95
95
  fill_in 'rate[region_percentage]', with: 10
96
96
  fill_in 'rate[postal_code_percentage]', with: 20.5
97
97
 
@@ -100,7 +100,8 @@ module Workarea
100
100
  assert(page.has_content?('Success'))
101
101
 
102
102
  within '.index-table__row' do
103
- assert(page.has_content?('10.0%'))
103
+ assert(page.has_content?('0.005%'))
104
+ assert(page.has_content?('10%'))
104
105
  assert(page.has_content?('20.5%'))
105
106
  end
106
107
 
@@ -33,8 +33,8 @@ module Workarea
33
33
  click_button 'remove_taxon', match: :first
34
34
 
35
35
  assert(page.has_content?('Success'))
36
- refute(page.has_content?('First Taxon'))
37
- refute(page.has_content?('Second Taxon'))
36
+ refute_text('First Taxon')
37
+ refute_text('Second Taxon')
38
38
  end
39
39
  end
40
40
  end
@@ -20,7 +20,7 @@ module Workarea
20
20
  assert(page.has_content?('My Category'))
21
21
 
22
22
  visit admin.trash_index_path
23
- refute(page.has_content?('My Category'))
23
+ refute_text('My Category')
24
24
  end
25
25
 
26
26
  def test_restore_permission
@@ -21,7 +21,7 @@ module Workarea
21
21
  )
22
22
  end
23
23
 
24
- def test_options
24
+ def test_variant_details
25
25
  @view_model.variants.build(
26
26
  sku: 'SKU1',
27
27
  name: 'name',
@@ -40,7 +40,7 @@ module Workarea
40
40
 
41
41
  assert_equal(
42
42
  { 'Color' => ['Red', 'Black', 'White'], 'Size' => ['S', 'M', 'L'] },
43
- @view_model.options
43
+ @view_model.variant_details
44
44
  )
45
45
  end
46
46
 
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.18
4
+ version: 3.5.23
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-09-01 00:00:00.000000000 Z
11
+ date: 2020-11-25 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.18
19
+ version: 3.5.23
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.18
26
+ version: 3.5.23
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.18
33
+ version: 3.5.23
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.18
40
+ version: 3.5.23
41
41
  description: Provides site administration functionality for the Workarea Commerce
42
42
  Platform.
43
43
  email:
@@ -1390,6 +1390,7 @@ files:
1390
1390
  - test/javascripts/fixtures/datepicker_fields.html.haml
1391
1391
  - test/javascripts/fixtures/datetimepicker_fields.html.haml
1392
1392
  - test/javascripts/fixtures/direct_upload.html.haml
1393
+ - test/javascripts/fixtures/existing_navigation_taxon.html.haml
1393
1394
  - test/javascripts/fixtures/help_lookup_button.haml
1394
1395
  - test/javascripts/fixtures/menu_editor_menu_list_sortable.html.haml
1395
1396
  - test/javascripts/fixtures/new_navigation_taxon.html.haml