workarea-admin 3.4.40 → 3.4.45
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/workarea/admin/modules/new_navigation_taxons.js +2 -1
- data/app/controllers/workarea/admin/impersonations_controller.rb +2 -1
- data/app/helpers/workarea/admin/application_helper.rb +4 -0
- data/app/view_models/workarea/admin/product_view_model.rb +5 -8
- data/app/views/workarea/admin/catalog_categories/edit.html.haml +3 -0
- data/app/views/workarea/admin/catalog_products/_cards.html.haml +1 -1
- data/app/views/workarea/admin/navigation_menus/_summary.html.haml +1 -1
- data/app/views/workarea/admin/navigation_redirects/index.html.haml +5 -0
- data/app/views/workarea/admin/pricing_discounts/properties/_product_attribute.html.haml +1 -1
- data/app/views/workarea/admin/toolbar/show.html.haml +1 -0
- data/app/views/workarea/admin/users/insights.html.haml +12 -0
- data/config/locales/en.yml +19 -3
- data/test/integration/workarea/admin/impersonations_integration_test.rb +26 -1
- data/test/javascripts/fixtures/existing_navigation_taxon.html.haml +10 -0
- data/test/javascripts/new_navigation_taxons_spec.js +12 -1
- data/test/system/workarea/admin/impersonation_system_test.rb +2 -5
- data/test/view_models/workarea/admin/product_view_model_test.rb +2 -2
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c84756944dc5f44d22e54a2aa4005e30d9781b6d469e82e5514f3850c252569
|
4
|
+
data.tar.gz: ae603e360abc2b179fe563b97cc1507a17314f5a2f4f383143e44fa72e29473e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6937f139d1cd3f7ce9b9e470223f41dc9e7abfe6b14e8766e4b9e68ab37101a45f93bb877f74f786a92208a13d13300b3ec39cb116772eb6004ca71e087893bd
|
7
|
+
data.tar.gz: 720b5c953ac40eab32674a0ddf27e750bb283c3adc9bcde77da1c892f989d169b557c14d5c73c6dd0e312f26bc72d9872ccf75f2c7edf171a00663f041a61d6f
|
@@ -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 = $
|
28
|
+
selected = $section.data('newNavigationTaxon');
|
28
29
|
|
29
30
|
if ($idSelect.is('.select2-hidden-accessible') && _.isUndefined(selected)) {
|
30
31
|
destroyRemoteSelect($idSelect);
|
@@ -27,7 +27,8 @@ module Workarea
|
|
27
27
|
self.current_order = nil
|
28
28
|
|
29
29
|
flash[:success] = t('workarea.admin.users.flash_messages.stopped')
|
30
|
-
|
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
|
@@ -42,7 +42,7 @@ module Workarea
|
|
42
42
|
def storefront_view_model
|
43
43
|
@storefront_view_model ||= Storefront::ProductViewModel.wrap(
|
44
44
|
model,
|
45
|
-
|
45
|
+
options
|
46
46
|
)
|
47
47
|
end
|
48
48
|
|
@@ -93,16 +93,13 @@ module Workarea
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
-
def
|
97
|
-
variants.
|
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]
|
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,
|
125
|
+
@insights ||= Insights::ProductViewModel.wrap(model, options)
|
129
126
|
end
|
130
127
|
|
131
128
|
def inventory
|
@@ -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'
|
@@ -110,7 +110,7 @@
|
|
110
110
|
%p.align-center= t('workarea.admin.fields.inventory')
|
111
111
|
|
112
112
|
%span.heading.heading--3.heading--no-margin.align-center
|
113
|
-
= model.
|
113
|
+
= model.variant_details.keys.to_sentence
|
114
114
|
%p.align-center= t('workarea.admin.fields.options')
|
115
115
|
|
116
116
|
= link_to catalog_product_variants_path(model), class: 'card__button' do
|
@@ -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
|
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
|
8
|
+
%span.discount__node off the item's unit price
|
9
9
|
|
10
10
|
.discount__node-line
|
11
11
|
%p.discount__node-group
|
@@ -67,6 +67,7 @@
|
|
67
67
|
= link_to current_impersonation.email, user_path(current_impersonation)
|
68
68
|
%br
|
69
69
|
= form_tag impersonations_path, method: 'delete', data: { disable_delete_confirmation: '' } do
|
70
|
+
= hidden_field_tag :return_to, return_to
|
70
71
|
= button_tag t('workarea.admin.toolbar.stop_impersonation'), class: 'text-button text-button--destroy'
|
71
72
|
|
72
73
|
- if allow_pricing_override?
|
@@ -90,6 +90,18 @@
|
|
90
90
|
= @user.insights.average_order_value_percentile.ordinalize
|
91
91
|
= t('workarea.admin.users.insights.percentile')
|
92
92
|
|
93
|
+
.align-center
|
94
|
+
= link_to '#customer-insights-info', data: { tooltip: { side: 'bottom', interactive: true } } do
|
95
|
+
= t('workarea.admin.users.insights.customer_insights')
|
96
|
+
#customer-insights-info.tooltip-content.align-center
|
97
|
+
= t( |
|
98
|
+
'workarea.admin.users.insights.customer_insights_info_html', |
|
99
|
+
best_customers_path: insights_report_path(type: Workarea::Insights::BestCustomers), |
|
100
|
+
customers_at_risk_path: insights_report_path(type: Workarea::Insights::CustomersAtRisk), |
|
101
|
+
repeat_purchase_rate_path: insights_report_path(type: Workarea::Insights::RepeatPurchaseRate), |
|
102
|
+
orders_path: orders_user_path(@user) |
|
103
|
+
) |
|
104
|
+
|
93
105
|
.section
|
94
106
|
%h2.align-center= t('workarea.admin.users.insights.recently_viewed.title')
|
95
107
|
.grid.grid--center
|
data/config/locales/en.yml
CHANGED
@@ -286,6 +286,7 @@ en:
|
|
286
286
|
views: views
|
287
287
|
edit:
|
288
288
|
client_id_note: Identifies the category for product import
|
289
|
+
default_sort_note: 'Since this category has featured products, this sort controls the products listed after the selected featured products.'
|
289
290
|
filters_note_html: 'Comma separated: just, like, this. If these fields are blank, the global values will be used from %{search_settings_link}.'
|
290
291
|
page_title: Attributes for %{category}
|
291
292
|
search_settings: search settings
|
@@ -2287,6 +2288,10 @@ en:
|
|
2287
2288
|
destination_label: Redirect To
|
2288
2289
|
destination_note: Can be any URL
|
2289
2290
|
destination_placeholder: "/new/path.html"
|
2291
|
+
disabled: >
|
2292
|
+
This application is configured to consider requests to be local, so the Workarea exception handling isn't used.
|
2293
|
+
This is most likely because it's running the development environment, where you want exceptions to be seen in responses.
|
2294
|
+
These redirects won't work without this.
|
2290
2295
|
from: From
|
2291
2296
|
import: Import Redirects
|
2292
2297
|
modified: Modified
|
@@ -3189,10 +3194,10 @@ en:
|
|
3189
3194
|
description: Define what filters should be shown on search results and categories.
|
3190
3195
|
title: Filters
|
3191
3196
|
synonyms:
|
3192
|
-
description: Define groups of search terms that
|
3197
|
+
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.
|
3193
3198
|
phrase_example: united states,u s a,united states of america => usa
|
3194
3199
|
phrase_example_description: 'You can create synonym functionality out of a phrase like so:'
|
3195
|
-
simple_example: "
|
3200
|
+
simple_example: "denim, jeans, dungarees \nshirt, pullover, blouse"
|
3196
3201
|
simple_example_description: 'Enter one synonym group per line, for example:'
|
3197
3202
|
title: Synonyms
|
3198
3203
|
title: Search Settings
|
@@ -3512,7 +3517,7 @@ en:
|
|
3512
3517
|
changes_saved: Your changes have been saved
|
3513
3518
|
saved: Your changes have been saved
|
3514
3519
|
started: You are now browsing as %{email}
|
3515
|
-
stopped: Impersonation
|
3520
|
+
stopped: Impersonation has been stopped, you are now browsing as your account.
|
3516
3521
|
created: This account has been created
|
3517
3522
|
error: There was an error saving this account
|
3518
3523
|
index:
|
@@ -3553,6 +3558,17 @@ en:
|
|
3553
3558
|
aov: AOV
|
3554
3559
|
insights_for_this_customer: Insights for this Customer
|
3555
3560
|
percentile: percentile
|
3561
|
+
customer_insights: Wondering about how Workarea customer insights work?
|
3562
|
+
customer_insights_info_html: >
|
3563
|
+
<strong>How are customer metrics tracked?</strong>
|
3564
|
+
<p>Workarea's metrics engine saves reporting and insights data based on the customer's email address.
|
3565
|
+
This allows for the best tracking of customers for generating helpful insights like
|
3566
|
+
<a href="%{best_customers_path}">Best Customers</a>, <a href="%{customers_at_risk_path}">Customers at Risk</a>,
|
3567
|
+
and <a href="%{repeat_purchase_rate_path}">Repeat Purchase Rate</a> as accurately as possible across both
|
3568
|
+
guest and account checkouts.</p>
|
3569
|
+
<strong>Wondering why some numbers don't line up?</strong>
|
3570
|
+
<p>Because reporting is tracked by email address, changes in email address and/or having an account
|
3571
|
+
can cause mismatch between the <a href="%{orders_path}">Orders</a> card and these insights.</p>
|
3556
3572
|
login:
|
3557
3573
|
never: Never logged in
|
3558
3574
|
time_ago: "%{period} ago"
|
@@ -70,9 +70,34 @@ module Workarea
|
|
70
70
|
post admin.impersonations_path, params: { user_id: @user.id }
|
71
71
|
delete admin.impersonations_path
|
72
72
|
|
73
|
-
assert(response.redirect?)
|
74
73
|
assert_equal(previous_user_id, response_cookies['user_id'])
|
75
74
|
assert(session['admin_id'].blank?)
|
75
|
+
|
76
|
+
post admin.impersonations_path, params: { user_id: @user.id }
|
77
|
+
delete admin.impersonations_path
|
78
|
+
|
79
|
+
assert_equal(previous_user_id, response_cookies['user_id'])
|
80
|
+
assert(session['admin_id'].blank?)
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_redirection_after_destroy
|
84
|
+
post admin.impersonations_path, params: { user_id: @user.id }
|
85
|
+
delete admin.impersonations_path
|
86
|
+
assert_redirected_to(admin.user_path(@user.id))
|
87
|
+
|
88
|
+
post admin.impersonations_path, params: { user_id: @user.id }
|
89
|
+
delete admin.impersonations_path(return_to: '/foo')
|
90
|
+
assert_redirected_to('/foo')
|
91
|
+
|
92
|
+
post admin.impersonations_path, params: { user_id: @user.id }
|
93
|
+
delete admin.impersonations_path(return_to: '/foo'),
|
94
|
+
headers: { 'HTTP_REFERER' => admin.catalog_products_path }
|
95
|
+
assert_redirected_to('/foo')
|
96
|
+
|
97
|
+
post admin.impersonations_path, params: { user_id: @user.id }
|
98
|
+
delete admin.impersonations_path,
|
99
|
+
headers: { 'HTTP_REFERER' => admin.catalog_products_url(host: 'foo.com') }
|
100
|
+
assert_redirected_to(admin.catalog_products_path)
|
76
101
|
end
|
77
102
|
end
|
78
103
|
end
|
@@ -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
|
});
|
@@ -34,12 +34,9 @@ module Workarea
|
|
34
34
|
click_button 'Stop Impersonation'
|
35
35
|
end
|
36
36
|
|
37
|
-
assert_equal(
|
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.
|
52
|
+
assert_equal(admin.root_path, current_path)
|
56
53
|
assert(page.has_content?('Success'))
|
57
54
|
end
|
58
55
|
end
|
@@ -23,7 +23,7 @@ module Workarea
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
def
|
26
|
+
def test_variant_details
|
27
27
|
@view_model.variants.build(
|
28
28
|
sku: 'SKU1',
|
29
29
|
name: 'name',
|
@@ -42,7 +42,7 @@ module Workarea
|
|
42
42
|
|
43
43
|
assert_equal(
|
44
44
|
{ 'Color' => ['Red', 'Black', 'White'], 'Size' => ['S', 'M', 'L'] },
|
45
|
-
@view_model.
|
45
|
+
@view_model.variant_details
|
46
46
|
)
|
47
47
|
end
|
48
48
|
|
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.45
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Crouse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-20 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.45
|
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.45
|
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.45
|
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.45
|
41
41
|
description: Provides site administration functionality for the Workarea Commerce
|
42
42
|
Platform.
|
43
43
|
email:
|
@@ -1270,6 +1270,7 @@ files:
|
|
1270
1270
|
- test/javascripts/fixtures/datepicker_fields.html.haml
|
1271
1271
|
- test/javascripts/fixtures/datetimepicker_fields.html.haml
|
1272
1272
|
- test/javascripts/fixtures/direct_upload.html.haml
|
1273
|
+
- test/javascripts/fixtures/existing_navigation_taxon.html.haml
|
1273
1274
|
- test/javascripts/fixtures/help_lookup_button.haml
|
1274
1275
|
- test/javascripts/fixtures/menu_editor_menu_list_sortable.html.haml
|
1275
1276
|
- test/javascripts/fixtures/new_navigation_taxon.html.haml
|
@@ -1401,7 +1402,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1401
1402
|
- !ruby/object:Gem::Version
|
1402
1403
|
version: '0'
|
1403
1404
|
requirements: []
|
1404
|
-
rubygems_version: 3.
|
1405
|
+
rubygems_version: 3.2.3
|
1405
1406
|
signing_key:
|
1406
1407
|
specification_version: 4
|
1407
1408
|
summary: Admin for the Workarea Commerce Platform
|