workarea-admin 3.4.16 → 3.4.17

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: 4cce609edcf971788a59719ccfb1171d7ef327d026ac5e3716d8797fafa92ee0
4
- data.tar.gz: fdf786229d275c0fdf4c5336e68bf1f13aa02269250f7afd349f284fb1db3e28
3
+ metadata.gz: b792e2fb892f9f6346fb83828742729c28c60cea0e77e3e99769e2b4a9e43419
4
+ data.tar.gz: e16e030553bd0aad3b18888924ebb9dfc92aa20b4b57b4e00c49a6cf1d72dff9
5
5
  SHA512:
6
- metadata.gz: 2aa925d5553043a9790e4f65d72a834f66e70a73cc4440deb205b8a096351b164a3eb198b8486f407a8a662adf6d10ab2b9f811cf108f6a281bf087c7d3b6e36
7
- data.tar.gz: 1db3d1891a1ed12ba737d07be4f97a18bb8dc15b2cc42b0dce4e35f9b1af7582b19e14e22a8549c7898cb599c8637bdcd572daa05f4eadddd84f24fdfd469059
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
- CategoryViewModel.wrap(categorization.default_model)
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
- .grid
18
- .grid__cell.grid__cell--25
19
- %h2= t('workarea.admin.orders.attributes.checkout.title')
20
- %ul.list-reset
21
- - if @order.user.present? || @order.email.present?
22
- %li
23
- %strong= t('workarea.admin.orders.attributes.checkout.customer')
24
- - if @order.user.present?
25
- = link_to @order.user.name, user_path(@order.user)
26
- - else
27
- = @order.email
28
- - if @order.checkout_by.present? && @order.checkout_by != @order.user
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
- = t('workarea.admin.orders.attributes.checkout.placed_by')
32
- = link_to @order.checkout_by.name, user_path(@order.checkout_by)
33
- - if @order.source.present?
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
- = t('workarea.admin.orders.attributes.checkout.source')
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
- = t('workarea.admin.fields.copied_from_id')
42
- = link_to @order.copied_from.name, order_path(@order.copied_from)
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
- .grid__cell.grid__cell--75
71
- %h2= t('workarea.admin.orders.attributes.items.title')
72
- %table
73
- %thead
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
- %td
82
- .grid.grid--auto
83
- .grid__cell
84
- = link_to image_tag(product_image_url(item.image, :small), alt: item.product.name), catalog_product_url(item.product, sku: item.sku)
85
- .grid__cell
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
- %strong= number_to_currency @order.total_price
120
- %tr
121
- %th
122
- %span.data-pairs__name= t('workarea.admin.orders.attributes.totals.total_value')
123
- %td= number_to_currency @order.total_value
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
@@ -2376,6 +2376,8 @@ en:
2376
2376
  status: 'Status:'
2377
2377
  traffic_referrer: 'Traffic Referrer:'
2378
2378
  traffic_referrer_url: 'Referrer URL:'
2379
+ view: View
2380
+ copy_url: Copy URL
2379
2381
  items:
2380
2382
  pricing: Pricing
2381
2383
  product: Product
@@ -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.16
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-09-17 00:00:00.000000000 Z
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.16
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.16
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.16
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.16
40
+ version: 3.4.17
41
41
  description: Provides site administration functionality for the Workarea Commerce
42
42
  Platform.
43
43
  email: