Skip to content

Commit

Permalink
Merge pull request #89 from AdamFrey/master
Browse files Browse the repository at this point in the history
Upgrade to Spree 2-3-stable
  • Loading branch information
huoxito committed Jul 2, 2014
2 parents 5378f89 + d995c1c commit 5a03904
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Gemfile
@@ -1,6 +1,6 @@
source "https://rubygems.org"

gem 'spree', github: 'spree/spree', branch: 'master'
gem 'spree', github: 'spree/spree', branch: '2-3-stable'
gem 'pry-rails'

gemspec
8 changes: 4 additions & 4 deletions app/views/spree/admin/orders/_assemblies.html.erb
Expand Up @@ -48,13 +48,13 @@
<td class="cart-item-delete actions" data-hook="cart_item_delete">
<% unless item.any_units_shipped? %>
<% if can? :update, item %>
<%= link_to '', [:admin, @order, item], :class => 'save-line-item icon_link icon-ok no-text with-tip',
<%= link_to '', [:admin, @order, item], :class => 'save-line-item fa fa-ok no-text with-tip',
:title => Spree.t('actions.save'), :style => 'display: none' %>
<%= link_to '', '#', :class => 'cancel-line-item icon_link icon-cancel no-text with-tip',
<%= link_to '', '#', :class => 'cancel-line-item fa fa-cancel no-text with-tip',
:title => Spree.t('actions.cancel'), :style => 'display: none' %>
<%= link_to '', '#', :class => 'edit-line-item icon_link icon-edit no-text with-tip',
<%= link_to '', '#', :class => 'edit-line-item fa fa-edit no-text with-tip',
:title => Spree.t('edit') %>
<%= link_to '', [:admin, @order, item], :class => 'delete-line-item icon-trash no-text with-tip',
<%= link_to '', [:admin, @order, item], :class => 'delete-line-item fa fa-trash no-text with-tip',
data: { confirm: Spree.t(:are_you_sure) }, :title => Spree.t('delete') %>
<% end %>
<% end %>
Expand Down
12 changes: 6 additions & 6 deletions app/views/spree/admin/orders/_stock_contents.html.erb
Expand Up @@ -12,9 +12,9 @@
</td>
<td class="actions">
<% if can? :update, shipment %>
<%= link_to '', '#', :class => 'save-method icon_link icon-ok no-text with-tip',
<%= link_to '', '#', :class => 'save-method fa fa-ok no-text with-tip',
:data => {'shipment-number' => shipment.number, :action => 'save'}, title: Spree.t('actions.save') %>
<%= link_to '', '#', :class => 'cancel-method icon_link icon-cancel no-text with-tip',
<%= link_to '', '#', :class => 'cancel-method fa fa-cancel no-text with-tip',
:data => {:action => 'cancel'}, :title => Spree.t('actions.cancel') %>
<% end %>
</td>
Expand All @@ -35,7 +35,7 @@

<td class="actions">
<% if can? :update, shipment %>
<%= link_to '', '#', :class => 'edit-method icon_link icon-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
<%= link_to '', '#', :class => 'edit-method fa fa-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
<% end %>
</td>
</tr>
Expand All @@ -47,8 +47,8 @@
</td>
<td class="actions">
<% if can? :update, shipment %>
<%= link_to '', '#', :class => 'save-tracking icon_link icon-ok no-text with-tip', :data => {'shipment-number' => shipment.number, :action => 'save'}, :title => Spree.t('actions.save') %>
<%= link_to '', '#', :class => 'cancel-tracking icon_link icon-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel') %>
<%= link_to '', '#', :class => 'save-tracking fa fa-ok no-text with-tip', :data => {'shipment-number' => shipment.number, :action => 'save'}, :title => Spree.t('actions.save') %>
<%= link_to '', '#', :class => 'cancel-tracking fa fa-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel') %>
<% end %>
</td>
</tr>
Expand All @@ -63,7 +63,7 @@
</td>
<td class="actions">
<% if can? :update, shipment %>
<%= link_to '', '#', :class => 'edit-tracking icon_link icon-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
<%= link_to '', '#', :class => 'edit-tracking fa fa-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
<% end %>
</td>
</tr>
10 changes: 5 additions & 5 deletions app/views/spree/admin/orders/_stock_item.html.erb
Expand Up @@ -34,11 +34,11 @@
<td class="cart-item-delete actions" data-hook="cart_item_delete">
<% if !shipment.shipped? && !item.part %>
<% if can? :update, item %>
<%= link_to '', '#', :class => 'save-item icon_link icon-ok no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'save'}, :title => Spree.t('actions.save'), :style => 'display: none' %>
<%= link_to '', '#', :class => 'cancel-item icon_link icon-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel'), :style => 'display: none' %>
<%= link_to '', '#', :class => 'edit-item icon_link icon-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
<%= link_to '', '#', :class => 'split-item icon_link icon-resize-horizontal no-text with-tip', :data => {:action => 'split', 'variant-id' => item.variant.id}, :title => Spree.t('split') %>
<%= link_to '', '#', :class => 'delete-item icon-trash no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'remove'}, :title => Spree.t('delete') %>
<%= link_to '', '#', :class => 'save-item fa fa-ok no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'save'}, :title => Spree.t('actions.save'), :style => 'display: none' %>
<%= link_to '', '#', :class => 'cancel-item fa fa-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel'), :style => 'display: none' %>
<%= link_to '', '#', :class => 'edit-item fa fa-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
<%= link_to '', '#', :class => 'split-item fa fa-arrows-h no-text with-tip', :data => {:action => 'split', 'variant-id' => item.variant.id}, :title => Spree.t('split') %>
<%= link_to '', '#', :class => 'delete-item fa fa-trash no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'remove'}, :title => Spree.t('delete') %>
<% end %>
<% end %>
</td>
Expand Down
6 changes: 4 additions & 2 deletions app/views/spree/admin/parts/index.html.erb
Expand Up @@ -8,6 +8,7 @@
<%= form_tag('#') do %>
<label><%= Spree.t(:search) %>:</label>
<input id="searchtext" size="25">
<button id="search_parts_button" class="fa fa-search button" name="button">Search</button>
<% end %>

<br/>
Expand Down Expand Up @@ -41,9 +42,10 @@
}
});

$("#searchtext").delayedObserver(function(element, value) {
$("#search_parts_button").click(function(e) {
e.preventDefault();
search_for_parts();
}, 0.75);
});

function subscribe_product_part_links()
{
Expand Down
4 changes: 2 additions & 2 deletions spec/features/admin/orders_spec.rb
Expand Up @@ -19,9 +19,9 @@

it "allows admin to edit product bundle", js: true do
within("table.product-bundles") do
find(".icon-edit").click
find(".edit-line-item").click
fill_in "quantity", :with => "2"
find(".icon-ok").click
find(".save-line-item").click

sleep(1) # avoid odd "cannot rollback - no transaction is active: rollback transaction"
end
Expand Down
1 change: 1 addition & 0 deletions spec/features/admin/parts_spec.rb
Expand Up @@ -16,6 +16,7 @@
visit spree.admin_product_path(tshirt)
click_on "Parts"
fill_in "searchtext", with: mug.name
click_on "Search"

within("#search_hits") { click_on "Select" }
page.should have_content(mug.sku)
Expand Down
3 changes: 3 additions & 0 deletions spec/models/spree/line_item_spec.rb
Expand Up @@ -29,6 +29,9 @@ module Spree

context "in stock" do
before do
parts.each do |part|
part.stock_items.first.set_count_on_hand(10)
end
expect(parts[0]).to be_in_stock
expect(parts[1]).to be_in_stock
end
Expand Down
2 changes: 1 addition & 1 deletion spree_product_assembly.gemspec
Expand Up @@ -15,7 +15,7 @@ Gem::Specification.new do |s|
s.require_path = 'lib'
s.requirements << 'none'

s.add_dependency 'spree_backend', '~> 2.3.0.beta'
s.add_dependency 'spree_backend', '~> 2.3.0'

s.add_development_dependency 'rspec-rails', '~> 2.14.0'
s.add_development_dependency 'sqlite3'
Expand Down

0 comments on commit 5a03904

Please sign in to comment.