workarea-admin 3.5.7 → 3.5.12
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 +4 -4
- data/app/assets/javascripts/workarea/admin/modules/categorized_autocomplete_fields.js +1 -1
- 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/helpers/workarea/admin/navigation_helper.rb +3 -0
- data/app/view_models/workarea/admin/pricing_sku_view_model.rb +2 -0
- data/app/views/workarea/admin/comments/index.html.haml +14 -13
- data/app/views/workarea/admin/create_catalog_products/content.html.haml +1 -1
- data/app/views/workarea/admin/data_file_mailer/import.html.haml +10 -5
- data/app/views/workarea/admin/insights/_most_discounted_products.html.haml +4 -4
- data/app/views/workarea/admin/pricing_skus/index.html.haml +1 -1
- data/app/views/workarea/admin/users/index.html.haml +1 -1
- data/config/locales/en.yml +5 -4
- data/test/helpers/workarea/admin/navigation_helper_test.rb +16 -0
- data/test/integration/workarea/admin/jump_to_integration_test.rb +11 -0
- data/test/integration/workarea/admin/products_integration_test.rb +13 -0
- data/test/system/workarea/admin/comments_system_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: fe1f232d46f475f09894f0127f8f8995bf5bfa4ef38f0041d5258f995860b7da
|
|
4
|
+
data.tar.gz: a7cb09eaab5a17df1faf5270f6cfc2c720f84823071765326019416eb4443106
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7bbda6fefd1b7212742dfe6fdb1516165302725d29dad9de5f11e75fdb07fc98c679388f1f9543a39a46e0c38dac738f6bd4f7f15701726bcc5b10c8ac2f1d81
|
|
7
|
+
data.tar.gz: 7bfdf3b873d3126c88c176c826667adde296ae7118bb40474455dc482fb4d59d38822de59b7843146d4d8ad6e7c6a4d69ba1c3d0e60e610891674752831ec600
|
|
@@ -5,7 +5,7 @@ WORKAREA.registerModule('categorizedAutocompleteFields', (function () {
|
|
|
5
5
|
'use strict';
|
|
6
6
|
|
|
7
7
|
var getSource = function (request, response) {
|
|
8
|
-
$.getJSON(
|
|
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
|
-
).
|
|
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')
|
|
@@ -41,17 +41,6 @@
|
|
|
41
41
|
.comments__comment-body
|
|
42
42
|
%p= comment.body
|
|
43
43
|
|
|
44
|
-
.section
|
|
45
|
-
- if @commentable.subscribed_user_ids.include?(current_user.id.to_s)
|
|
46
|
-
= form_tag unsubscribe_commentable_comments_path(@commentable.to_global_id), method: :put, id: 'comment_unsubscribe_form' do
|
|
47
|
-
= button_tag t('workarea.admin.comments.index.unsubscribe'), value: 'comments_unsubscribe', class: 'button button--small'
|
|
48
|
-
%span= t('workarea.admin.comments.index.subscribe_message')
|
|
49
|
-
- else
|
|
50
|
-
= form_tag subscribe_commentable_comments_path(@commentable.to_global_id), method: :put, id: 'comment_unsubscribe_form' do
|
|
51
|
-
= button_tag t('workarea.admin.comments.index.subscribe'), value: 'comments_subscribe', class: 'button button--small'
|
|
52
|
-
%span= t('workarea.admin.comments.index.unsubscribe_message')
|
|
53
|
-
|
|
54
|
-
|
|
55
44
|
.section
|
|
56
45
|
.comments__new-comment
|
|
57
46
|
%h2= t('workarea.admin.comments.index.new')
|
|
@@ -66,5 +55,17 @@
|
|
|
66
55
|
%span.property__note= t('workarea.admin.comments.index.mention_note')
|
|
67
56
|
|
|
68
57
|
.workflow-bar
|
|
69
|
-
.grid.grid--
|
|
70
|
-
.grid__cell
|
|
58
|
+
.grid.grid--middle
|
|
59
|
+
.grid__cell.grid__cell--80
|
|
60
|
+
- if @commentable.subscribed_user_ids.include?(current_user.id.to_s)
|
|
61
|
+
= link_to t('workarea.admin.comments.index.unsubscribe'), unsubscribe_commentable_comments_path(@commentable.to_global_id), data: { method: 'put', tooltip: { content_id: '#unsubscribe-info' } }, class: 'workflow-bar__button'
|
|
62
|
+
#unsubscribe-info.tooltip-content
|
|
63
|
+
%p= t('workarea.admin.comments.index.unsubscribe_message')
|
|
64
|
+
|
|
65
|
+
- else
|
|
66
|
+
= link_to t('workarea.admin.comments.index.subscribe'), subscribe_commentable_comments_path(@commentable.to_global_id), data: { method: 'put', tooltip: { content_id: '#subscribe-info' } }, class: 'workflow-bar__button'
|
|
67
|
+
#subscribe-info.tooltip-content
|
|
68
|
+
%p= t('workarea.admin.comments.index.subscribe_message')
|
|
69
|
+
|
|
70
|
+
.grid__cell.grid__cell--20
|
|
71
|
+
.align-right= button_tag t('workarea.admin.comments.index.create'), value: 'create_comment', class: 'workflow-bar__button workflow-bar__button--create'
|
|
@@ -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.
|
|
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
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
=
|
|
1
|
+
- index_url = index_url_for(@import.model_class, only_path: false)
|
|
2
|
+
|
|
3
|
+
- if index_url.present?
|
|
4
|
+
= render_schema_org(email_action_schema(index_url, t('workarea.admin.data_file_mailer.import.email_action.name'), t('workarea.admin.data_file_mailer.import.email_action.description')))
|
|
2
5
|
|
|
3
6
|
%tr
|
|
4
7
|
%td
|
|
@@ -7,7 +10,9 @@
|
|
|
7
10
|
%td
|
|
8
11
|
%p
|
|
9
12
|
= t('workarea.admin.data_file_mailer.import.success', count: pluralize(@import.succeeded, @import.format.unit.downcase))
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
- if index_url.present?
|
|
15
|
+
%tr
|
|
16
|
+
%td
|
|
17
|
+
%p
|
|
18
|
+
= link_to t('workarea.admin.data_file_mailer.import.link_text', name: @import.name.pluralize), index_url
|
|
@@ -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)
|
data/config/locales/en.yml
CHANGED
|
@@ -631,8 +631,8 @@ en:
|
|
|
631
631
|
removed: Your comment has been removed
|
|
632
632
|
saved: Your comment has been saved
|
|
633
633
|
saved_error: There was a problem saving your comment
|
|
634
|
-
comment_subscribed:
|
|
635
|
-
comment_unsubscribed: You have been unsubscribed from
|
|
634
|
+
comment_subscribed: You have been subscribed to comment notifications.
|
|
635
|
+
comment_unsubscribed: You have been unsubscribed from comment notifications.
|
|
636
636
|
index:
|
|
637
637
|
body: Comment Body
|
|
638
638
|
create: Create Comment
|
|
@@ -642,10 +642,10 @@ en:
|
|
|
642
642
|
new: New Comment
|
|
643
643
|
notify: Notify Admins
|
|
644
644
|
subscribe: Subscribe
|
|
645
|
-
subscribe_message:
|
|
645
|
+
subscribe_message: You'll be emailed when a new comment is posted on this.
|
|
646
646
|
title: Comments on %{name}
|
|
647
647
|
unsubscribe: Unsubscribe
|
|
648
|
-
unsubscribe_message: to stop receiving
|
|
648
|
+
unsubscribe_message: Click this to stop receiving email about future comments.
|
|
649
649
|
icon:
|
|
650
650
|
viewed: Comments
|
|
651
651
|
unviewed: Unread Comments
|
|
@@ -975,6 +975,7 @@ en:
|
|
|
975
975
|
browser_title: Browser Title
|
|
976
976
|
cancel: Cancel
|
|
977
977
|
defaults_to_a_truncated_description: "(defaults to a truncated description)"
|
|
978
|
+
defaults_to_description: "(defaults to description)"
|
|
978
979
|
description: Description
|
|
979
980
|
meta_description: Meta Description
|
|
980
981
|
or_skip_this: or skip this
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
module Workarea
|
|
4
|
+
module Admin
|
|
5
|
+
class NavigationHelperTest < ViewTest
|
|
6
|
+
include Engine.routes.url_helpers
|
|
7
|
+
|
|
8
|
+
def test_index_url_for
|
|
9
|
+
assert_equal(admin.catalog_products_path, index_url_for(Catalog::Product))
|
|
10
|
+
assert_equal(admin.catalog_products_path, index_url_for(create_product))
|
|
11
|
+
assert_nil(index_url_for(Fulfillment))
|
|
12
|
+
assert_raises { index_url_for('foo') }
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -250,6 +250,17 @@ module Workarea
|
|
|
250
250
|
results.map { |r| r['type'] }
|
|
251
251
|
)
|
|
252
252
|
end
|
|
253
|
+
|
|
254
|
+
def test_sorting_by_recency
|
|
255
|
+
create_user(email: 'foo-one@workarea.com', updated_at: 1.day.ago)
|
|
256
|
+
create_user(email: 'foo-two@workarea.com', updated_at: 1.hour.ago)
|
|
257
|
+
get admin.jump_to_path(q: 'foo')
|
|
258
|
+
|
|
259
|
+
results = JSON.parse(response.body)['results']
|
|
260
|
+
assert_equal(2, results.length)
|
|
261
|
+
assert_match('foo-two@workarea.com', results.first['label'])
|
|
262
|
+
assert_match('foo-one@workarea.com', results.second['label'])
|
|
263
|
+
end
|
|
253
264
|
end
|
|
254
265
|
end
|
|
255
266
|
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
|
|
|
@@ -53,10 +53,10 @@ module Workarea
|
|
|
53
53
|
visit admin.user_path(user)
|
|
54
54
|
|
|
55
55
|
click_link 'Comments'
|
|
56
|
-
|
|
56
|
+
click_link t('workarea.admin.comments.index.subscribe')
|
|
57
57
|
assert(page.has_content?('Success'))
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
click_link t('workarea.admin.comments.index.unsubscribe')
|
|
60
60
|
assert(page.has_content?('Success'))
|
|
61
61
|
end
|
|
62
62
|
end
|
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.
|
|
4
|
+
version: 3.5.12
|
|
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-05-26 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.
|
|
19
|
+
version: 3.5.12
|
|
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.
|
|
26
|
+
version: 3.5.12
|
|
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.
|
|
33
|
+
version: 3.5.12
|
|
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.
|
|
40
|
+
version: 3.5.12
|
|
41
41
|
description: Provides site administration functionality for the Workarea Commerce
|
|
42
42
|
Platform.
|
|
43
43
|
email:
|
|
@@ -1293,6 +1293,7 @@ files:
|
|
|
1293
1293
|
- test/helpers/workarea/admin/icons_helper_test.rb
|
|
1294
1294
|
- test/helpers/workarea/admin/imports_helper_test.rb
|
|
1295
1295
|
- test/helpers/workarea/admin/insights_helper_test.rb
|
|
1296
|
+
- test/helpers/workarea/admin/navigation_helper_test.rb
|
|
1296
1297
|
- test/helpers/workarea/admin/products_helper_test.rb
|
|
1297
1298
|
- test/helpers/workarea/admin/releases_helper_test.rb
|
|
1298
1299
|
- test/helpers/workarea/admin/settings_helper_test.rb
|
|
@@ -1525,7 +1526,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1525
1526
|
- !ruby/object:Gem::Version
|
|
1526
1527
|
version: '0'
|
|
1527
1528
|
requirements: []
|
|
1528
|
-
rubygems_version: 3.0.
|
|
1529
|
+
rubygems_version: 3.0.3
|
|
1529
1530
|
signing_key:
|
|
1530
1531
|
specification_version: 4
|
|
1531
1532
|
summary: Admin for the Workarea Commerce Platform
|