spree_backend 3.2.0.rc2 → 3.2.0.rc3

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
  SHA1:
3
- metadata.gz: e8fb294832daffce21e70c27bc12b834957be005
4
- data.tar.gz: de6c2e47bd64bafa45164025bc2fa7b8d67de16c
3
+ metadata.gz: 4c9c06ab26c459b2291545459a189f147a563053
4
+ data.tar.gz: f41457c74b12afaaa40fd67c1c673ca29a9a664b
5
5
  SHA512:
6
- metadata.gz: af578629a32a95bbebda8d4058545258c453186d586b2a8ff67f67098f6abc1449687461e24d1d2f13c9e95952e8fc44164b95a8923082556199e75db493bc6c
7
- data.tar.gz: 3480bae6bcb82f2d136bfaeaa346679f94428eea38240b5b5de3a6b7c03ee7071a25ede2cb3e1865ecfaa55492f8ac7084cceb276ec7420bbed04c2f33db17f8
6
+ metadata.gz: 72c551570df059276c8c00860a5df5ac331fe9e296dfe376e6c45e96cc64e3efff2312f3cefd40b6c411fe1aa28775012bf397ff84bd6fda9e5503ef7b583328
7
+ data.tar.gz: 90f76e7ba5c97b34c63d8273f685121bde35357ca473e8dfeb06cdca72585a67917eff15aea2001465e26df07c3918aa2bd7e18afc3d8a8621e353c9a1445e7a
@@ -32,8 +32,7 @@ module Spree
32
32
  @payment_method = PaymentMethod.find(params[:id])
33
33
  end
34
34
 
35
- update_params = params[ActiveModel::Naming.param_key(@payment_method)] || {}
36
- attributes = payment_method_params.merge(update_params)
35
+ attributes = payment_method_params.merge(preferences_params)
37
36
  attributes.each do |k,v|
38
37
  if k.include?("password") && attributes[k].blank?
39
38
  attributes.delete(k)
@@ -55,7 +54,7 @@ module Spree
55
54
  def collection
56
55
  @collection = super.order(position: :asc)
57
56
  end
58
-
57
+
59
58
  def load_data
60
59
  @providers = Gateway.providers.sort{|p1, p2| p1.name <=> p2.name }
61
60
  end
@@ -71,6 +70,12 @@ module Spree
71
70
  def payment_method_params
72
71
  params.require(:payment_method).permit!
73
72
  end
73
+
74
+ def preferences_params
75
+ key = ActiveModel::Naming.param_key(@payment_method)
76
+ return {} unless params.key? key
77
+ params.require(key).permit!
78
+ end
74
79
  end
75
80
  end
76
81
  end
@@ -4,7 +4,7 @@ module Spree
4
4
  before_action :load_order, only: [:index]
5
5
 
6
6
  def index
7
- @state_changes = @order.state_changes.includes(:user)
7
+ @state_changes = @order.state_changes.includes(:user).order(created_at: :desc)
8
8
  end
9
9
 
10
10
  private
@@ -28,9 +28,9 @@
28
28
  <%= variant.sku_and_options_text %>
29
29
  <%= form_tag admin_product_variants_including_master_path(@product, variant, format: :js), method: :put, class: 'toggle_variant_track_inventory' do %>
30
30
  <div class="checkbox">
31
- <%= label_tag :track_inventory do %>
31
+ <%= label_tag "track_inventory_#{ variant.id }" do %>
32
32
  <%= check_box_tag 'track_inventory', 1, variant.track_inventory?,
33
- class: 'track_inventory_checkbox' %>
33
+ class: 'track_inventory_checkbox', id: "track_inventory_#{ variant.id }" %>
34
34
  <%= Spree.t(:track_inventory) %>
35
35
  <%= hidden_field_tag 'variant[track_inventory]', variant.track_inventory?,
36
36
  class: 'variant_track_inventory',
@@ -54,7 +54,7 @@
54
54
  <th><%= Spree.t(:usage_limit) %></th>
55
55
  <th><%= Spree.t(:promotion_uses) %></th>
56
56
  <th><%= Spree.t(:expiration) %></th>
57
- <th class="actions"></th>
57
+ <th data-hook="admin_promotions_index_header_actions" class="actions"></th>
58
58
  </tr>
59
59
  </thead>
60
60
  <tbody>
@@ -66,7 +66,7 @@
66
66
  <td><%= promotion.usage_limit.nil? ? "∞" : promotion.usage_limit %></td>
67
67
  <td><%= Spree.t(:current_promotion_usage, count: promotion.credits_count) %></td>
68
68
  <td><%= promotion.expires_at.to_date.to_s(:short_date) if promotion.expires_at %></td>
69
- <td class="actions actions-2">
69
+ <td class="actions actions-2" data-hook="admin_promotions_index_row_actions">
70
70
  <%= link_to_edit promotion, no_text: true %>
71
71
  <%= link_to_delete promotion, no_text: true %>
72
72
  </td>
@@ -52,7 +52,7 @@
52
52
  </span>
53
53
  </div>
54
54
 
55
- <div class="form-group <%= "#{type}-row" %>">
55
+ <%= field_container f.object, :state, class: ["form-group", "#{type}-row"] do %>
56
56
  <%= f.label :state_id, Spree.t(:state) %>
57
57
  <span id="<%= s_or_b %>state">
58
58
  <%= f.text_field :state_name,
@@ -60,7 +60,8 @@
60
60
  disabled: !f.object.country.states.empty?, class: 'form-control state_name' %>
61
61
  <%= f.collection_select :state_id, f.object.country.states.sort, :id, :name, { include_blank: true }, { class: 'select2', style: "display: #{f.object.country.states.empty? ? 'none' : 'block' };", disabled: f.object.country.states.empty? } %>
62
62
  </span>
63
- </div>
63
+ <%= error_message_on f.object, :state_id %>
64
+ <% end %>
64
65
 
65
66
  <%= field_container f.object, :phone, class: ["form-group", "#{type}-row"] do %>
66
67
  <%= f.label :phone, Spree.t(:phone) %>
@@ -1,7 +1,8 @@
1
1
  <%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :state_changes } %>
2
2
 
3
- <% content_for :page_title do %>
4
- <%= plural_resource_name(Spree::StateChange) %>
3
+ <% content_for :page_title do %>
4
+ / <%= plural_resource_name(Spree::StateChange) %>
5
+ / <%= Spree::StateChange.human_attribute_name(:state_changes) %>
5
6
  <% end %>
6
7
 
7
8
  <% if @state_changes.any? %>
@@ -23,7 +24,10 @@
23
24
  <td><%= state_change.previous_state ? Spree.t(state_change.previous_state) : Spree.t(:previous_state_missing) %></td>
24
25
  <td><%= Spree.t(state_change.next_state) %></td>
25
26
  <td>
26
- <%= link_to state_change.user.login, spree.admin_user_path(state_change.user) if state_change.user %>
27
+ <% if state_change.user %>
28
+ <% user_login = state_change.user.try(:login) || state_change.user.try(:email) %>
29
+ <%= link_to user_login, spree.admin_user_path(state_change.user) %>
30
+ <% end %>
27
31
  </td>
28
32
  <td>
29
33
  <%= pretty_time(state_change.created_at) %>
@@ -20,6 +20,21 @@ module Spree
20
20
  expect(payment_method.preferred_password).to eq("haxme")
21
21
  end
22
22
 
23
+ it 'saves payment method preferences on update' do
24
+ spree_put :update,
25
+ id: payment_method.id,
26
+ payment_method: {
27
+ type: payment_method.class.to_s,
28
+ name: 'Bogus'
29
+ },
30
+ gateway_with_password: {
31
+ preferred_password: "abc"
32
+ }
33
+
34
+ payment_method.reload
35
+ expect(payment_method.preferred_password).to eq("abc")
36
+ end
37
+
23
38
  context "tries to save invalid payment" do
24
39
  it "doesn't break, responds nicely" do
25
40
  expect {
@@ -123,6 +123,7 @@ describe "Adjustments", type: :feature do
123
123
  end
124
124
  end
125
125
 
126
+ wait_for_ajax
126
127
  expect(page).to have_content(/Total: ?\$170\.00/)
127
128
  end
128
129
  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.2.0.rc2
4
+ version: 3.2.0.rc3
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-12-20 00:00:00.000000000 Z
11
+ date: 2017-02-22 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.2.0.rc2
19
+ version: 3.2.0.rc3
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.2.0.rc2
26
+ version: 3.2.0.rc3
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.2.0.rc2
33
+ version: 3.2.0.rc3
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.2.0.rc2
40
+ version: 3.2.0.rc3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bootstrap-sass
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -638,7 +638,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
638
638
  requirements:
639
639
  - none
640
640
  rubyforge_project:
641
- rubygems_version: 2.5.1
641
+ rubygems_version: 2.6.10
642
642
  signing_key:
643
643
  specification_version: 4
644
644
  summary: backend e-commerce functionality for the Spree project.