workarea-storefront 3.5.20 → 3.5.26

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: 0c50360a4f45c6c0829ee7946aaddb42f7750ae952a6cd34b0ed318a136081e5
4
- data.tar.gz: b674fc2b3f89fcd4d77847a49c02a897b565f8067e6c260a435d3f91d75b7b37
3
+ metadata.gz: 31dede26099911b3564b0b6d74e1ca5e41cb9562de5bc58d4032668587da68d2
4
+ data.tar.gz: f5230fd996345f72d8daf08d4ea44f9c8ecd75aba02b53aaff1028647aac946b
5
5
  SHA512:
6
- metadata.gz: 90a4da3fb29ab3d04be5561dc3879fc453225b7a386f41862c61a4e4de361ff70695e5ddff0601aa76e3c676bd881685ad32136ee901e6b97e0c30177d128507
7
- data.tar.gz: d0e50e28fb52a9149d9446ab698fd3aebcc350b8b632d66bd0c3474005f2988f8e12d317295d29039ce915c7e6bb5c885f94a09155fa297aad59367921c88e62
6
+ metadata.gz: b59fc9b9c5f4dda31be324a32bbd9bd9791388820ce77668e82008ef023266e9dcf5ec6ffa9d5aabc43d6282a13d2215b902421e394ee129bbb56be8c006f212
7
+ data.tar.gz: a2f2b72a649f0735c13976ecc9d9bf887052082c345504761f62bc6ebe1988ddcdd5e4e1f9ac44dda2c8a7f61d163a010e138ad12a9d050be99e8d98624bc761
@@ -5,7 +5,7 @@ WORKAREA.registerModule('dialogButtons', (function () {
5
5
  'use strict';
6
6
 
7
7
  var isSrc = function (fileName) {
8
- var extension = fileName.split('.')[1];
8
+ var extension = WORKAREA.url.parse(fileName).path.split('.').pop();
9
9
 
10
10
  return _.includes(WORKAREA.config.imageFileExtensions, extension);
11
11
  },
@@ -11,13 +11,14 @@ module Workarea
11
11
  after_action :check_inventory, except: :create
12
12
 
13
13
  def create
14
+ @cart = CartViewModel.new(current_order, view_model_options)
15
+
14
16
  # TODO: for v4, use AddItemToCart for this.
15
17
  if current_order.add_item(item_params.to_h.merge(item_details.to_h))
16
18
  check_inventory
17
19
 
18
20
  Pricing.perform(current_order, current_shippings)
19
21
 
20
- @cart = CartViewModel.new(current_order, view_model_options)
21
22
  @item = OrderItemViewModel.wrap(
22
23
  current_order.items.find_existing(
23
24
  item_params[:sku],
@@ -10,6 +10,8 @@ module Workarea
10
10
  else
11
11
  new(model, options)
12
12
  end
13
+ rescue NameError
14
+ new(model, options)
13
15
  end
14
16
 
15
17
  def breadcrumbs
@@ -47,6 +47,18 @@ module Workarea
47
47
  assert_equal(5.to_m, order.items.first.total_price)
48
48
  end
49
49
 
50
+ def test_fail_to_add_an_item
51
+ post storefront.cart_items_path,
52
+ params: {
53
+ product_id: @product.id,
54
+ sku: 'SKU1',
55
+ quantity: -1
56
+ }
57
+
58
+ assert_response(:success)
59
+ assert_empty(Order.all)
60
+ end
61
+
50
62
  def test_adding_product_with_shared_skus
51
63
  product_2 = Catalog::Product.create!(name: 'Product', variants: [{ sku: 'SKU1' }])
52
64
 
@@ -15,6 +15,14 @@ module Workarea
15
15
  view_model = ProductViewModel.wrap(@product, one: '1')
16
16
  assert_instance_of(ProductTemplates::OptionSelectsViewModel, view_model)
17
17
  assert_equal('1', view_model.options[:one])
18
+
19
+ Workarea.with_config do |config|
20
+ config.product_templates << :no_view_model
21
+ @product.template = 'no_view_model'
22
+ view_model = ProductViewModel.wrap(@product, one: '1')
23
+
24
+ assert_kind_of(ProductViewModel, view_model)
25
+ end
18
26
  end
19
27
 
20
28
  def test_cache_key
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workarea-storefront
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.20
4
+ version: 3.5.26
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-09-30 00:00:00.000000000 Z
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,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.5.20
19
+ version: 3.5.26
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.20
26
+ version: 3.5.26
27
27
  description: Provides user-facing ecommerce storefront functionality for the Workarea
28
28
  Commerce Platform.
29
29
  email:
@@ -734,7 +734,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
734
734
  - !ruby/object:Gem::Version
735
735
  version: '0'
736
736
  requirements: []
737
- rubygems_version: 3.0.3
737
+ rubygems_version: 3.2.3
738
738
  signing_key:
739
739
  specification_version: 4
740
740
  summary: Storefront for the Workarea Commerce Platform