spree_backend 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spree/backend/admin.js +3 -3
- data/app/controllers/spree/admin/variants_controller.rb +23 -18
- data/app/helpers/spree/admin/navigation_helper.rb +6 -4
- data/app/views/spree/admin/shared/sub_menu/_product.html.erb +4 -4
- data/spec/controllers/spree/admin/resource_controller_spec.rb +5 -3
- data/spec/features/admin/products/products_spec.rb +3 -1
- data/spec/features/admin/products/properties_spec.rb +10 -4
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2576b7e7409bd237d0a969011b99430430bd2fe4
|
4
|
+
data.tar.gz: 080fb92f9d02a049ad453e76d017970d5eb1ecb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5fc4c72e6f3b9aac105215c86fdca50160d1046e50aea638095eaef9da9448eb200a6e829b38ec6add206fe4deccfba66b8a0f333f1f28de8d9e14c241501db
|
7
|
+
data.tar.gz: dc838a7b4114c56e63ed83c29e1a6049e0f2fae92fa15d29d08a338011cc8b0a0c5847900bc5c0a3fc8435f678e229a33bb963c065c78f5cca9de45ddd8ee114
|
@@ -81,9 +81,9 @@ jQuery(function($) {
|
|
81
81
|
});
|
82
82
|
|
83
83
|
// Main menu active item submenu show
|
84
|
-
var active_item = $('#sidebar').find('.selected');
|
85
|
-
active_item.
|
86
|
-
active_item.
|
84
|
+
var active_item = $('#main-sidebar').find('.selected');
|
85
|
+
active_item.closest('.nav-pills').addClass('in');
|
86
|
+
active_item.closest('.nav-sidebar')
|
87
87
|
.find('.icon-chevron-left')
|
88
88
|
.removeClass('icon-chevron-left')
|
89
89
|
.addClass('icon-chevron-down');
|
@@ -22,31 +22,36 @@ module Spree
|
|
22
22
|
end
|
23
23
|
|
24
24
|
protected
|
25
|
-
def new_before
|
26
|
-
master = @object.product.master
|
27
|
-
@object.attributes = master.attributes.except('id', 'created_at', 'deleted_at',
|
28
|
-
'sku', 'is_master')
|
29
|
-
if master.default_price.present?
|
30
|
-
# Shallow Clone of the default price to populate the price field.
|
31
|
-
@object.default_price = master.default_price.clone
|
32
|
-
end
|
33
|
-
end
|
34
25
|
|
35
|
-
|
36
|
-
|
26
|
+
def new_before
|
27
|
+
master = @object.product.master
|
28
|
+
@object.attributes = master.attributes.except(
|
29
|
+
'id', 'created_at', 'deleted_at', 'sku', 'is_master'
|
30
|
+
)
|
31
|
+
# Shallow Clone of the default price to populate the price field.
|
32
|
+
@object.default_price = master.default_price.clone if master.default_price.present?
|
33
|
+
end
|
34
|
+
|
35
|
+
def parent
|
36
|
+
@product = Product.with_deleted.friendly.find(params[:product_id])
|
37
|
+
end
|
37
38
|
|
39
|
+
def collection
|
40
|
+
@deleted = (params.key?(:deleted) && params[:deleted] == "on") ? "checked" : ""
|
41
|
+
@collection ||=
|
38
42
|
if @deleted.blank?
|
39
|
-
|
43
|
+
super.includes(:default_price, option_values: :option_type)
|
40
44
|
else
|
41
|
-
|
45
|
+
Variant.only_deleted.where(product_id: parent.id)
|
42
46
|
end
|
43
|
-
|
44
|
-
|
47
|
+
@collection
|
48
|
+
end
|
45
49
|
|
46
50
|
private
|
47
|
-
|
48
|
-
|
49
|
-
|
51
|
+
|
52
|
+
def load_data
|
53
|
+
@tax_categories = TaxCategory.order(:name)
|
54
|
+
end
|
50
55
|
end
|
51
56
|
end
|
52
57
|
end
|
@@ -219,10 +219,12 @@ module Spree
|
|
219
219
|
end
|
220
220
|
|
221
221
|
def configurations_sidebar_menu_item(link_text, url, options = {})
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
222
|
+
is_selected = url.ends_with?(controller.controller_name) ||
|
223
|
+
url.ends_with?("#{controller.controller_name}/edit") ||
|
224
|
+
url.ends_with?("#{controller.controller_name.singularize}/edit")
|
225
|
+
|
226
|
+
options[:class] = 'sidebar-menu-item'
|
227
|
+
options[:class] << ' selected' if is_selected
|
226
228
|
content_tag(:li, options) do
|
227
229
|
link_to(link_text, url)
|
228
230
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<ul id="sidebar-product" class="collapse nav nav-pills nav-stacked" data-hook="admin_product_sub_tabs">
|
2
|
-
<%= tab :products %>
|
3
|
-
<%= tab :option_types, :
|
2
|
+
<%= tab :products, match_path: '/products' %>
|
3
|
+
<%= tab :option_types, match_path: '/option_types' %>
|
4
4
|
<%= tab :properties %>
|
5
5
|
<%= tab :prototypes %>
|
6
|
-
<%= tab :taxonomies %>
|
7
|
-
<%= tab :taxons %>
|
6
|
+
<%= tab :taxonomies, match_path: '/taxonomies' %>
|
7
|
+
<%= tab :taxons, match_path: '/taxons' %>
|
8
8
|
</ul>
|
@@ -20,7 +20,7 @@ describe Spree::Admin::WidgetsController, :type => :controller do
|
|
20
20
|
Rails.application.reload_routes!
|
21
21
|
end
|
22
22
|
|
23
|
-
with_model 'Widget' do
|
23
|
+
with_model 'Widget', scope: :all do
|
24
24
|
table do |t|
|
25
25
|
t.string :name
|
26
26
|
t.integer :position
|
@@ -140,7 +140,9 @@ describe Spree::Admin::WidgetsController, :type => :controller do
|
|
140
140
|
end
|
141
141
|
|
142
142
|
it 'touches updated_at' do
|
143
|
-
|
143
|
+
Timecop.scale(3600) do
|
144
|
+
expect { subject }.to change { widget_1.reload.updated_at }
|
145
|
+
end
|
144
146
|
end
|
145
147
|
end
|
146
148
|
end
|
@@ -171,7 +173,7 @@ describe Spree::Admin::Submodule::PostsController, type: :controller do
|
|
171
173
|
Rails.application.reload_routes!
|
172
174
|
end
|
173
175
|
|
174
|
-
with_table 'spree_posts' do |t|
|
176
|
+
with_table 'spree_posts', scope: :all do |t|
|
175
177
|
t.string :name
|
176
178
|
t.integer :position
|
177
179
|
t.timestamps null: false
|
@@ -320,7 +320,9 @@ describe "Products", type: :feature do
|
|
320
320
|
|
321
321
|
it 'should add option_types when selecting a prototype', js: true do
|
322
322
|
visit spree.admin_product_path(product)
|
323
|
-
|
323
|
+
within('#sidebar') do
|
324
|
+
click_link 'Properties'
|
325
|
+
end
|
324
326
|
click_link "Select From Prototype"
|
325
327
|
|
326
328
|
within("#prototypes tr#row_#{prototype.id}") do
|
@@ -34,7 +34,7 @@ describe "Properties", type: :feature, js: true do
|
|
34
34
|
click_on "Filter"
|
35
35
|
fill_in "q_name_cont", with: "size"
|
36
36
|
click_on 'Search'
|
37
|
-
|
37
|
+
|
38
38
|
expect(page).to have_content("shirt size")
|
39
39
|
expect(page).not_to have_content("shirt fit")
|
40
40
|
end
|
@@ -82,7 +82,9 @@ describe "Properties", type: :feature, js: true do
|
|
82
82
|
create(:product)
|
83
83
|
visit spree.admin_products_path
|
84
84
|
click_icon :edit
|
85
|
-
|
85
|
+
within('#sidebar') do
|
86
|
+
click_link "Properties"
|
87
|
+
end
|
86
88
|
end
|
87
89
|
|
88
90
|
# Regression test for #2279
|
@@ -122,7 +124,9 @@ describe "Properties", type: :feature, js: true do
|
|
122
124
|
fill_in "product_product_properties_attributes_0_property_name", with: "A Property"
|
123
125
|
fill_in "product_product_properties_attributes_0_value", with: "A Value"
|
124
126
|
click_button "Update"
|
125
|
-
|
127
|
+
within('#sidebar') do
|
128
|
+
click_link "Properties"
|
129
|
+
end
|
126
130
|
end
|
127
131
|
|
128
132
|
def delete_product_property
|
@@ -133,7 +137,9 @@ describe "Properties", type: :feature, js: true do
|
|
133
137
|
end
|
134
138
|
|
135
139
|
def check_property_row_count(expected_row_count)
|
136
|
-
|
140
|
+
within('#sidebar') do
|
141
|
+
click_link "Properties"
|
142
|
+
end
|
137
143
|
expect(page).to have_css("tbody#product_properties")
|
138
144
|
expect(all("tbody#product_properties tr").count).to eq(expected_row_count)
|
139
145
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_api
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.1.
|
19
|
+
version: 3.1.1
|
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.1.
|
26
|
+
version: 3.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: spree_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.1.
|
33
|
+
version: 3.1.1
|
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.1.
|
40
|
+
version: 3.1.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bootstrap-sass
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -649,7 +649,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
649
649
|
requirements:
|
650
650
|
- none
|
651
651
|
rubyforge_project: spree_backend
|
652
|
-
rubygems_version: 2.
|
652
|
+
rubygems_version: 2.5.1
|
653
653
|
signing_key:
|
654
654
|
specification_version: 4
|
655
655
|
summary: backend e-commerce functionality for the Spree project.
|