solidus_backend 2.8.1 → 2.8.6
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.
Potentially problematic release.
This version of solidus_backend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spree/backend/views/stock/edit_stock_item_row.js +18 -2
- data/app/assets/stylesheets/spree/backend/globals/_functions.scss +2 -1
- data/app/views/spree/admin/products/_form.html.erb +1 -1
- data/spec/features/admin/products/edit/taxons_spec.rb +11 -1
- data/spec/features/admin/products/stock_management_spec.rb +17 -0
- data/spec/teaspoon_env.rb +8 -23
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8e4eeb8b6f2823c6e44903bc105cbfe8fb2347e2e80f854441c82163ee6f76b
|
4
|
+
data.tar.gz: 7c3e74b0baf59ef9dc2772b832ac4235f855307b522fe6600848f7b9d7a2771e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
@@ -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)
|
data/spec/teaspoon_env.rb
CHANGED
@@ -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
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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.
|
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:
|
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.
|
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.
|
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.
|
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.
|
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
|
-
|
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.
|