solidus_backend 2.8.1 → 2.8.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_backend might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51e908bac71fffa62bee7172a0eb8c636fa2b074a82765443c4c810072b5c50f
4
- data.tar.gz: 3b87a9060d1c489de3eecc37ce38ab89c63a857ddeb229a91414667891137f49
3
+ metadata.gz: e8e4eeb8b6f2823c6e44903bc105cbfe8fb2347e2e80f854441c82163ee6f76b
4
+ data.tar.gz: 7c3e74b0baf59ef9dc2772b832ac4235f855307b522fe6600848f7b9d7a2771e
5
5
  SHA512:
6
- metadata.gz: b49f147b84bca2dea2d8b7fd778a84f2b3dd851682c8bb3a5262f649ad832552145ac8f02067ec87d104cd7e22778f421b15e834b87d213ae2a574ac2101478e
7
- data.tar.gz: 9b8da34799226ee531ebdfb03353b2401241a5af9e942b60a44b9da06a4aee3f4a9cfbf9e8011514c7dbeae954d9ccaf9ee085320acc1426ec10bf72907c8601
6
+ metadata.gz: d5f54db33c3330faee68d7e6582056b9da7d15a98550866a3fc2b2b0754a4091c6ec9ec85e36a9009fdcc60821db9f7d4c6f06cda9762b17a3ce250b9239c4aa
7
+ data.tar.gz: db8770dab6b7c8d19a08e59bb94d5cb9ee73532f5e07f1a5514bb66a42dab8166b338fc876691a82c741a47ab1522054867ef23a1203575eaa3a53d31b43996b
@@ -13,7 +13,8 @@ Spree.Views.Stock.EditStockItemRow = Backbone.View.extend({
13
13
  "click .submit": "onSubmit",
14
14
  "submit form": "onSubmit",
15
15
  "click .cancel": "onCancel",
16
- 'input [name="count_on_hand"]': "countOnHandChanged"
16
+ 'input [name="count_on_hand"]': "countOnHandChanged",
17
+ 'input [name="backorderable"]': "backorderableChanged"
17
18
  },
18
19
 
19
20
  template: HandlebarsTemplates['stock_items/stock_location_stock_item'],
@@ -43,6 +44,20 @@ Spree.Views.Stock.EditStockItemRow = Backbone.View.extend({
43
44
  this.render();
44
45
  },
45
46
 
47
+ onChange: function() {
48
+ var count_on_hand_changed = this.previousAttributes.count_on_hand != this.model.attributes.count_on_hand;
49
+ var backorderable_changed = this.previousAttributes.backorderable != this.model.attributes.backorderable;
50
+ var changed = count_on_hand_changed || backorderable_changed;
51
+
52
+ this.$el.toggleClass('changed', changed);
53
+ },
54
+
55
+ backorderableChanged: function(ev) {
56
+ this.model.set("backorderable", ev.target.checked);
57
+
58
+ this.onChange();
59
+ },
60
+
46
61
  countOnHandChanged: function(ev) {
47
62
  var diff = parseInt(ev.currentTarget.value), newCount;
48
63
  if (isNaN(diff)) diff = 0;
@@ -56,7 +71,8 @@ Spree.Views.Stock.EditStockItemRow = Backbone.View.extend({
56
71
  this.model.set("count_on_hand", newCount);
57
72
  this.$count_on_hand_display.text(newCount);
58
73
  }
59
- this.$el.toggleClass('changed', diff !== 0);
74
+
75
+ this.onChange();
60
76
  },
61
77
 
62
78
  onSuccess: function() {
@@ -1,5 +1,5 @@
1
1
  // Make color very close to white
2
- @function very-light($color, $adjust: 3){
2
+ @function very-light($color, $adjust: 3){
3
3
  @if type-of($adjust) == 'number' and $adjust > 0 {
4
4
  @for $i from 0 through 100 {
5
5
  @if lighten($color, $i) == white and ($i - $adjust) > $adjust {
@@ -10,6 +10,7 @@
10
10
  @else {
11
11
  @debug "Please correct $adjust value. It should be number and larger then 0. Currently it is '#{type-of($adjust)}' with value '#{$adjust}'"
12
12
  }
13
+ @return $color;
13
14
  };
14
15
 
15
16
  // Quick fix for dynamic variables missing in SASS
@@ -109,7 +109,7 @@
109
109
  <% end %>
110
110
  </div>
111
111
  </div>
112
-
112
+ <% else %>
113
113
  <div id="shipping_specs" class="row">
114
114
  <% [:height, :width, :depth, :weight].each_with_index do |field, index| %>
115
115
  <div id="shipping_specs_<%= field %>_field" class="col-6">
@@ -26,9 +26,19 @@ describe "Product Display Order", type: :feature do
26
26
  visit spree.edit_admin_product_path(product)
27
27
 
28
28
  assert_selected_taxons([taxon_1])
29
-
30
29
  select2_search "Clothing", from: "Taxon"
30
+ assert_selected_taxons([taxon_1, taxon_2])
31
+
32
+ # Without this line we have a flaky spec probably due to select2 not
33
+ # closing its fixed overlay correctly. Clicking anywhere in the page
34
+ # before submit apparently solves the issue.
35
+ find('.edit_product', visible: true).click
36
+
31
37
  click_button "Update"
38
+
39
+ within('.flash') do
40
+ expect(page).to have_content(%(Product "#{product.name}" has been successfully updated!))
41
+ end
32
42
  assert_selected_taxons([taxon_1, taxon_2])
33
43
  end
34
44
 
@@ -57,6 +57,15 @@ describe "Product Stock", type: :feature do
57
57
  expect(stock_item.stock_movements.first.quantity).to eq(-4)
58
58
  end
59
59
 
60
+ it "can toggle backorderable", js: true do
61
+ toggle_backorderable(value: false)
62
+
63
+ click_link "Product Stock"
64
+ within("tr#spree_variant_#{variant.id}") do
65
+ expect(find(:css, "input[type='checkbox']")).not_to be_checked
66
+ end
67
+ end
68
+
60
69
  def adjust_count_on_hand(count_on_hand)
61
70
  within("tr#spree_variant_#{variant.id}") do
62
71
  find(:css, "input[type='number']").set(count_on_hand)
@@ -65,6 +74,14 @@ describe "Product Stock", type: :feature do
65
74
  expect(page).to have_content('Updated Successfully')
66
75
  end
67
76
 
77
+ def toggle_backorderable(value: true)
78
+ within("tr#spree_variant_#{variant.id}") do
79
+ find(:css, "input[type='checkbox']").set(value)
80
+ click_icon :check
81
+ end
82
+ expect(page).to have_content('Updated Successfully')
83
+ end
84
+
68
85
  context "with stock locations that don't have stock items for variant yet" do
69
86
  before do
70
87
  create(:stock_location, name: 'Other location', propagate_all_variants: false)
@@ -2,27 +2,8 @@
2
2
 
3
3
  ENV['RAILS_ENV'] = 'test'
4
4
 
5
- # Teaspoon doesn't allow you to pass client driver options to the Selenium WebDriver. This monkey patch
6
- # is a temporary fix until this PR is merged: https://github.com/jejacks0n/teaspoon/pull/519.
7
5
  require 'teaspoon/driver/selenium'
8
6
 
9
- Teaspoon::Driver::Selenium.class_eval do
10
- def run_specs(runner, url)
11
- driver = ::Selenium::WebDriver.for(driver_options[:client_driver], @options.except(:client_driver) || {})
12
- driver.navigate.to(url)
13
-
14
- ::Selenium::WebDriver::Wait.new(driver_options).until do
15
- done = driver.execute_script("return window.Teaspoon && window.Teaspoon.finished")
16
- driver.execute_script("return window.Teaspoon && window.Teaspoon.getMessages() || []").each do |line|
17
- runner.process("#{line}\n")
18
- end
19
- done
20
- end
21
- ensure
22
- driver.quit if driver
23
- end
24
- end
25
-
26
7
  # Similar to setup described in
27
8
  # https://github.com/jejacks0n/teaspoon/wiki/Micro-Applications
28
9
 
@@ -38,10 +19,14 @@ if defined?(DummyApp)
38
19
  config.fixture_paths = ["spec/javascripts/fixtures"]
39
20
 
40
21
  config.driver = :selenium
41
- capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
42
- chromeOptions: { args: %w(headless disable-gpu window-size=1920,1440) }
43
- )
44
- config.driver_options = { client_driver: :chrome, desired_capabilities: capabilities }
22
+ config.driver_options = {
23
+ client_driver: :chrome,
24
+ selenium_options: {
25
+ options: Selenium::WebDriver::Chrome::Options.new(
26
+ args: %w(headless disable-gpu window-size=1920,1440),
27
+ ),
28
+ },
29
+ }
45
30
 
46
31
  config.suite do |suite|
47
32
  suite.use_framework :mocha, "2.3.3"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-13 00:00:00.000000000 Z
11
+ date: 2020-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_api
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.8.1
19
+ version: 2.8.6
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: 2.8.1
26
+ version: 2.8.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: solidus_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.8.1
33
+ version: 2.8.6
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: 2.8.1
40
+ version: 2.8.6
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: coffee-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -984,8 +984,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
984
984
  version: 1.8.23
985
985
  requirements:
986
986
  - none
987
- rubyforge_project:
988
- rubygems_version: 2.7.3
987
+ rubygems_version: 3.0.3
989
988
  signing_key:
990
989
  specification_version: 4
991
990
  summary: Admin interface for the Solidus e-commerce framework.