workarea-admin 3.4.16 → 3.4.17
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/application.js.erb +2 -1
- data/app/view_models/workarea/admin/product_view_model.rb +4 -1
- data/app/views/workarea/admin/orders/attributes.html.haml +108 -100
- data/config/locales/en.yml +2 -0
- data/test/system/workarea/admin/orders_system_test.rb +11 -1
- data/test/view_models/workarea/admin/product_view_model_test.rb +8 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b792e2fb892f9f6346fb83828742729c28c60cea0e77e3e99769e2b4a9e43419
|
4
|
+
data.tar.gz: e16e030553bd0aad3b18888924ebb9dfc92aa20b4b57b4e00c49a6cf1d72dff9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c1ceb737763ffb4c34fc97d987e5a7db0850d9b7302874246e2ae4bca1b6c88c4f5c6126e48b5e1b50c45def8cd8646606019e22ec3edb15f29be8efd695f2e
|
7
|
+
data.tar.gz: 86767dd56b8e9fe7962025d16f75d43c4764d7449cb1795836981cbed54ae1b878d320fdda3c22f585927da768036c8197a4916b9c008146b88251648b6656b6
|
@@ -131,8 +131,9 @@ window.feature.testAll();
|
|
131
131
|
workarea/core/modules/style_guide_accordions
|
132
132
|
workarea/core/modules/reveal_password
|
133
133
|
workarea/core/modules/local_time
|
134
|
-
workarea/admin/modules/categorized_autocomplete_fields
|
135
134
|
workarea/core/modules/date
|
135
|
+
workarea/core/modules/copy_to_clipboard
|
136
|
+
workarea/admin/modules/categorized_autocomplete_fields
|
136
137
|
workarea/admin/modules/messages
|
137
138
|
workarea/admin/modules/takeover
|
138
139
|
workarea/admin/modules/autocomplete_fields
|
@@ -33,7 +33,10 @@ module Workarea
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def default_category
|
36
|
-
|
36
|
+
return @default_category if defined? @default_category
|
37
|
+
@default_category = if categorization.default_model.present?
|
38
|
+
CategoryViewModel.wrap(categorization.default_model)
|
39
|
+
end
|
37
40
|
end
|
38
41
|
|
39
42
|
def storefront_view_model
|
@@ -14,110 +14,118 @@
|
|
14
14
|
= render_cards_for(@order, :attributes)
|
15
15
|
|
16
16
|
.view__container.view__container--narrow
|
17
|
-
.
|
18
|
-
.
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
%
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
17
|
+
.section
|
18
|
+
.grid
|
19
|
+
.grid__cell.grid__cell--25
|
20
|
+
%h2= t('workarea.admin.orders.attributes.checkout.title')
|
21
|
+
%ul.list-reset
|
22
|
+
- if @order.user.present? || @order.email.present?
|
23
|
+
%li
|
24
|
+
%strong= t('workarea.admin.orders.attributes.checkout.customer')
|
25
|
+
- if @order.user.present?
|
26
|
+
= link_to @order.user.name, user_path(@order.user)
|
27
|
+
- else
|
28
|
+
= @order.email
|
29
|
+
- if @order.checkout_by.present? && @order.checkout_by != @order.user
|
30
|
+
%li
|
31
|
+
%strong
|
32
|
+
= t('workarea.admin.orders.attributes.checkout.placed_by')
|
33
|
+
= link_to @order.checkout_by.name, user_path(@order.checkout_by)
|
34
|
+
- if @order.source.present?
|
35
|
+
%li
|
36
|
+
%strong
|
37
|
+
= t('workarea.admin.orders.attributes.checkout.source')
|
38
|
+
= @order.source.titleize
|
39
|
+
- if @order.copied_from.present?
|
40
|
+
%li
|
41
|
+
%strong
|
42
|
+
= t('workarea.admin.fields.copied_from_id')
|
43
|
+
= link_to @order.copied_from.name, order_path(@order.copied_from)
|
44
|
+
%li
|
45
|
+
%strong= t('workarea.admin.orders.attributes.checkout.status')
|
46
|
+
= @order.model.status.to_s.titleize
|
47
|
+
%li
|
48
|
+
%strong= t('workarea.admin.orders.attributes.checkout.promo_codes')
|
49
|
+
= @order.promo_codes.join(', ').presence || t('workarea.admin.orders.attributes.checkout.none')
|
50
|
+
%li
|
51
|
+
%strong= t('workarea.admin.orders.attributes.checkout.placed')
|
52
|
+
- if @order.placed?
|
53
|
+
= local_time_ago(@order.placed_at)
|
54
|
+
%li
|
55
|
+
%strong= t('workarea.admin.orders.attributes.checkout.ip_address')
|
56
|
+
= @order.ip_address.presence || t('workarea.admin.orders.attributes.checkout.none')
|
57
|
+
%li
|
58
|
+
%strong= t('workarea.admin.orders.attributes.checkout.traffic_referrer')
|
59
|
+
= @order.traffic_referrer&.medium.presence || t('workarea.admin.orders.attributes.checkout.none')
|
29
60
|
%li
|
30
|
-
%strong
|
31
|
-
|
32
|
-
|
33
|
-
|
61
|
+
%strong= t('workarea.admin.orders.attributes.checkout.traffic_referrer_url')
|
62
|
+
- if @order.traffic_referrer&.uri.present?
|
63
|
+
= link_to t('workarea.admin.orders.attributes.checkout.view'), '#traffic_referrer_url_tooltip', data: { tooltip: { interactive: true, trigger: 'click' }.to_json }
|
64
|
+
#traffic_referrer_url_tooltip.tooltip-content
|
65
|
+
.align-center
|
66
|
+
%p= text_field_tag nil, @order.traffic_referrer.uri, id: 'traffic_referrer_url', class: 'text-box'
|
67
|
+
= button_tag t('workarea.admin.orders.attributes.checkout.copy_url'), data: { copy_to_clipboard: '#traffic_referrer_url' }, class: 'button button--small'
|
68
|
+
- else
|
69
|
+
= t('workarea.admin.orders.attributes.checkout.none')
|
34
70
|
%li
|
35
|
-
%strong
|
36
|
-
|
37
|
-
= @order.source.titleize
|
38
|
-
- if @order.copied_from.present?
|
71
|
+
%strong= t('workarea.admin.fields.updated_at')
|
72
|
+
#{local_time_ago(@order.updated_at)}
|
39
73
|
%li
|
40
|
-
%strong
|
41
|
-
|
42
|
-
|
43
|
-
%li
|
44
|
-
%strong= t('workarea.admin.orders.attributes.checkout.status')
|
45
|
-
= @order.model.status.to_s.titleize
|
46
|
-
%li
|
47
|
-
%strong= t('workarea.admin.orders.attributes.checkout.promo_codes')
|
48
|
-
= @order.promo_codes.join(', ').presence || t('workarea.admin.orders.attributes.checkout.none')
|
49
|
-
%li
|
50
|
-
%strong= t('workarea.admin.orders.attributes.checkout.placed')
|
51
|
-
- if @order.placed?
|
52
|
-
= local_time_ago(@order.placed_at)
|
53
|
-
%li
|
54
|
-
%strong= t('workarea.admin.orders.attributes.checkout.ip_address')
|
55
|
-
= @order.ip_address.presence || t('workarea.admin.orders.attributes.checkout.none')
|
56
|
-
%li
|
57
|
-
%strong= t('workarea.admin.orders.attributes.checkout.traffic_referrer')
|
58
|
-
= @order.traffic_referrer&.medium.presence || t('workarea.admin.orders.attributes.checkout.none')
|
59
|
-
%li
|
60
|
-
%strong= t('workarea.admin.orders.attributes.checkout.traffic_referrer_url')
|
61
|
-
= @order.traffic_referrer&.uri.presence || t('workarea.admin.orders.attributes.checkout.none')
|
62
|
-
%li
|
63
|
-
%strong= t('workarea.admin.fields.updated_at')
|
64
|
-
#{local_time_ago(@order.updated_at)}
|
65
|
-
%li
|
66
|
-
%strong= t('workarea.admin.fields.created_at')
|
67
|
-
#{local_time_ago(@order.created_at)}
|
68
|
-
= append_partials('admin.order_attributes', order: @order)
|
74
|
+
%strong= t('workarea.admin.fields.created_at')
|
75
|
+
#{local_time_ago(@order.created_at)}
|
76
|
+
= append_partials('admin.order_attributes', order: @order)
|
69
77
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
%tr
|
75
|
-
%th= t('workarea.admin.orders.attributes.items.product')
|
76
|
-
%th.align-center= t('workarea.admin.orders.attributes.items.quantity')
|
77
|
-
%th.align-right= t('workarea.admin.orders.attributes.items.pricing')
|
78
|
-
%tbody
|
79
|
-
- @order.items.each do |item|
|
78
|
+
.grid__cell.grid__cell--75
|
79
|
+
%h2= t('workarea.admin.orders.attributes.items.title')
|
80
|
+
%table
|
81
|
+
%thead
|
80
82
|
%tr
|
81
|
-
%
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
%p= link_to item.product.name, catalog_product_path(item.product, sku: item.sku)
|
87
|
-
%p= item.sku
|
88
|
-
- if item.customizations.any?
|
89
|
-
- item.customizations.each do |name, value|
|
90
|
-
%p #{name.titleize}: #{value}
|
91
|
-
= append_partials('admin.order_attributes_item_details', item: item)
|
92
|
-
%td.align-center= item.quantity
|
93
|
-
%td.align-right
|
94
|
-
- item.price_adjustments.each do |adjustment|
|
95
|
-
%p
|
96
|
-
%strong= price_adjustment_description_for(adjustment)
|
97
|
-
%span= number_to_currency(adjustment.amount)
|
98
|
-
|
99
|
-
.grid.grid--right
|
100
|
-
.grid__cell.grid__cell--50
|
101
|
-
%table.data-pairs
|
102
|
-
%tbody
|
103
|
-
%tr
|
104
|
-
%th
|
105
|
-
%span.data-pairs__name= t('workarea.admin.orders.attributes.totals.subtotal')
|
106
|
-
%td= number_to_currency @order.subtotal_price
|
107
|
-
%tr
|
108
|
-
%th
|
109
|
-
%span.data-pairs__name= t('workarea.admin.orders.attributes.totals.shipping')
|
110
|
-
%td= number_to_currency @order.shipping_total
|
83
|
+
%th= t('workarea.admin.orders.attributes.items.product')
|
84
|
+
%th.align-center= t('workarea.admin.orders.attributes.items.quantity')
|
85
|
+
%th.align-right= t('workarea.admin.orders.attributes.items.pricing')
|
86
|
+
%tbody
|
87
|
+
- @order.items.each do |item|
|
111
88
|
%tr
|
112
|
-
%th
|
113
|
-
%span.data-pairs__name= t('workarea.admin.orders.attributes.totals.tax')
|
114
|
-
%td= number_to_currency @order.tax_total
|
115
|
-
%tr
|
116
|
-
%th
|
117
|
-
%span.data-pairs__name= t('workarea.admin.orders.attributes.totals.total_price')
|
118
89
|
%td
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
90
|
+
.grid.grid--auto
|
91
|
+
.grid__cell
|
92
|
+
= link_to image_tag(product_image_url(item.image, :small), alt: item.product.name), catalog_product_url(item.product, sku: item.sku)
|
93
|
+
.grid__cell
|
94
|
+
%p= link_to item.product.name, catalog_product_path(item.product, sku: item.sku)
|
95
|
+
%p= item.sku
|
96
|
+
- if item.customizations.any?
|
97
|
+
- item.customizations.each do |name, value|
|
98
|
+
%p #{name.titleize}: #{value}
|
99
|
+
= append_partials('admin.order_attributes_item_details', item: item)
|
100
|
+
%td.align-center= item.quantity
|
101
|
+
%td.align-right
|
102
|
+
- item.price_adjustments.each do |adjustment|
|
103
|
+
%p
|
104
|
+
%strong= price_adjustment_description_for(adjustment)
|
105
|
+
%span= number_to_currency(adjustment.amount)
|
106
|
+
|
107
|
+
.grid.grid--right
|
108
|
+
.grid__cell.grid__cell--50
|
109
|
+
%table.data-pairs
|
110
|
+
%tbody
|
111
|
+
%tr
|
112
|
+
%th
|
113
|
+
%span.data-pairs__name= t('workarea.admin.orders.attributes.totals.subtotal')
|
114
|
+
%td= number_to_currency @order.subtotal_price
|
115
|
+
%tr
|
116
|
+
%th
|
117
|
+
%span.data-pairs__name= t('workarea.admin.orders.attributes.totals.shipping')
|
118
|
+
%td= number_to_currency @order.shipping_total
|
119
|
+
%tr
|
120
|
+
%th
|
121
|
+
%span.data-pairs__name= t('workarea.admin.orders.attributes.totals.tax')
|
122
|
+
%td= number_to_currency @order.tax_total
|
123
|
+
%tr
|
124
|
+
%th
|
125
|
+
%span.data-pairs__name= t('workarea.admin.orders.attributes.totals.total_price')
|
126
|
+
%td
|
127
|
+
%strong= number_to_currency @order.total_price
|
128
|
+
%tr
|
129
|
+
%th
|
130
|
+
%span.data-pairs__name= t('workarea.admin.orders.attributes.totals.total_value')
|
131
|
+
%td= number_to_currency @order.total_value
|
data/config/locales/en.yml
CHANGED
@@ -6,7 +6,12 @@ module Workarea
|
|
6
6
|
include Admin::IntegrationTest
|
7
7
|
|
8
8
|
def test_attributes
|
9
|
-
order = create_placed_order
|
9
|
+
order = create_placed_order(
|
10
|
+
traffic_referrer: {
|
11
|
+
uri: 'https://foo.bar'
|
12
|
+
}
|
13
|
+
)
|
14
|
+
|
10
15
|
visit admin.order_path(order)
|
11
16
|
click_link t('workarea.admin.cards.attributes.title')
|
12
17
|
|
@@ -15,6 +20,11 @@ module Workarea
|
|
15
20
|
assert(page.has_content?("#{Money.default_currency.symbol}10.00")) # Subtotal
|
16
21
|
assert(page.has_content?("#{Money.default_currency.symbol}1.00")) # Shipping
|
17
22
|
assert(page.has_content?("#{Money.default_currency.symbol}11.00")) # Total
|
23
|
+
|
24
|
+
click_link t('workarea.admin.orders.attributes.checkout.view')
|
25
|
+
within '.tooltip-content' do
|
26
|
+
page.has_content?('https://foo.bar')
|
27
|
+
end
|
18
28
|
end
|
19
29
|
|
20
30
|
def test_fulfillment
|
@@ -147,6 +147,14 @@ module Workarea
|
|
147
147
|
@view_model = ProductViewModel.new(@product)
|
148
148
|
assert(@view_model.ignore_inventory?)
|
149
149
|
end
|
150
|
+
|
151
|
+
def test_blank_categories
|
152
|
+
product = create_product
|
153
|
+
view_model = ProductViewModel.new(product)
|
154
|
+
|
155
|
+
assert_nil(view_model.default_category)
|
156
|
+
assert_empty(view_model.categories)
|
157
|
+
end
|
150
158
|
end
|
151
159
|
end
|
152
160
|
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.4.
|
4
|
+
version: 3.4.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Crouse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-01 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.17
|
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.17
|
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.17
|
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.17
|
41
41
|
description: Provides site administration functionality for the Workarea Commerce
|
42
42
|
Platform.
|
43
43
|
email:
|