workarea-admin 3.4.34 → 3.4.39

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5230f58914602ef18cf228a8b7cd3f02e2b1dd9c3d172b14714c7ce7c58f624
4
- data.tar.gz: cc2a6bf7861708d6e12803b4008633192700c28cb50005b376cc59153aac3fab
3
+ metadata.gz: c6a212108166042aafd35198dd00a9634a40548133acd4805e50809caf14670b
4
+ data.tar.gz: da550878bda42c55340b4cd414a0e771571272fd506cc105850d31d5a7c684e4
5
5
  SHA512:
6
- metadata.gz: 2bb2e8897d7291d59a3cfd4f35eeb896cd93762ca61a4f79a14d299a280391abc0a2c41e26c0397c0e02f8f46e6f4ad4e1eb33f92500da29056ee64496f12f93
7
- data.tar.gz: 76f1ec690b2cc56c7e36ae3ee5ed6228c41246ae6fd40111bf3459ac8394dbe0bea6dfa2d2c36a58315cca08fc02aff5454a7355f7ad587c7de929c0d4961da1
6
+ metadata.gz: d36769d2327f453b76806f547d9de8d38a88e903403c7fc33d9abea0174f7d6da2239733d163097410070dab4453a95c94f271733a1810d4f4aa002d5b7c6443
7
+ data.tar.gz: 8473245d50289ce340ac32cac7127d142e4302790bf7f333b1f505a3155c5f83c05ca1eeb3f35ef9ee5f7f8430838a6bde182732c992b05d39957ad89c5289ff
@@ -21,8 +21,9 @@ module Workarea
21
21
  end
22
22
 
23
23
  if attributes[:inventory].present?
24
- inventory = Inventory::Sku.find_or_create_by(id: variant.sku)
24
+ inventory = Inventory::Sku.find_or_initialize_by(id: variant.sku)
25
25
  inventory.available = attributes[:inventory]
26
+ inventory.policy = 'standard' if inventory.new_record?
26
27
  inventory.save!
27
28
  end
28
29
  end
@@ -10,7 +10,7 @@ module Workarea
10
10
  end
11
11
 
12
12
  def used_count
13
- model.count - unused_promo_codes.count
13
+ model.promo_codes.count - unused_promo_codes.count
14
14
  end
15
15
 
16
16
  def last_used_at
@@ -7,7 +7,7 @@
7
7
  .grid.grid--middle
8
8
  .grid__cell.grid__cell--50
9
9
  - if content.show_areas?
10
- %span= content.name
10
+ %span #{t('workarea.admin.content.edit.current_area')}:
11
11
  = inline_svg('workarea/admin/icons/navigate_next.svg', class: 'svg-icon svg-icon--small svg-icon--white')
12
12
  = form_tag request.path, method: 'get', class: 'content-editor__area-select-form' do
13
13
  = select_tag 'area_id', options_for_select(content.area_options, content.current_area), data: { form_submitting_control: '' }
@@ -140,6 +140,8 @@
140
140
  = inline_svg('workarea/admin/icons/help.svg', class: 'svg-icon')
141
141
  %span= t('workarea.admin.users.permissions.help')
142
142
 
143
+ = append_partials('admin.user_permissions')
144
+
143
145
  .workflow-bar
144
146
  .grid.grid--middle
145
147
  .grid__cell.grid__cell--20
@@ -10,7 +10,7 @@
10
10
  - @search.facet_selections.each do |facet, values|
11
11
  - values.each do |value|
12
12
  %li.browsing-controls__applied-filter
13
- %span= value.titleize
13
+ %span= facet_value_display_name(facet, value)
14
14
  = link_to facet_path(facet, value), class: 'browsing-controls__applied-remove-link' do
15
15
  = inline_svg('workarea/admin/icons/close.svg', class: 'browsing-controls__applied-icon svg-icon svg-icon--small svg-icon--black', title: t('workarea.admin.facets.applied.remove_filter'))
16
16
 
@@ -45,7 +45,7 @@
45
45
  .grid
46
46
  .grid__cell.grid__cell--50
47
47
  .align-center
48
- %h2.heading.heading--no-margin= model.count
48
+ %h2.heading.heading--no-margin= model.promo_codes.count
49
49
  %p #{t('workarea.admin.pricing_discount_code_lists.cards.promo_codes.total')}
50
50
  .grid__cell.grid__cell--50
51
51
  .align-center
@@ -17,7 +17,7 @@
17
17
 
18
18
  .view__container.view__container--narrow
19
19
  = render_cards_for(@code_list, :promo_codes)
20
- %p.align-center= t('workarea.admin.pricing_discount_code_lists.promo_code', count: @code_list.count)
20
+ %p.align-center= t('workarea.admin.pricing_discount_code_lists.promo_code', count: @code_list.promo_codes.count)
21
21
 
22
22
  %table
23
23
  %thead
@@ -664,6 +664,7 @@ en:
664
664
  loading: Loading...
665
665
  preview: Preview
666
666
  title: Content for %{content}
667
+ current_area: 'Current Area'
667
668
  form:
668
669
  all_blocks: All blocks
669
670
  cancel: Cancel
@@ -21,6 +21,11 @@ module Workarea
21
21
 
22
22
  view_model = CodeListViewModel.wrap(code_list)
23
23
  assert_equal(1, view_model.used_count)
24
+
25
+ code_list.promo_codes.create!(code: "#{code_list.prefix}123")
26
+
27
+ view_model = CodeListViewModel.wrap(code_list)
28
+ assert_equal(1, view_model.used_count)
24
29
  end
25
30
 
26
31
  def test_last_used_at
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.34
4
+ version: 3.4.39
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-06-11 00:00:00.000000000 Z
11
+ date: 2020-09-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.34
19
+ version: 3.4.39
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.34
26
+ version: 3.4.39
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.34
33
+ version: 3.4.39
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.34
40
+ version: 3.4.39
41
41
  description: Provides site administration functionality for the Workarea Commerce
42
42
  Platform.
43
43
  email: