solidus_backend 2.11.4 → 2.11.5

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: f154797f26add4a007c753f802918666a17c1c8e22ca45ec121387f26ae6dc58
4
- data.tar.gz: 2d6574a272cf0ae1667f9bdb5bab5a7058ac9f6050f955cf98b6e778818c78c4
3
+ metadata.gz: 9fcb2fe3e45e4eca63c7d7d0b835aae74460929b257265ec96117d93a42aa6de
4
+ data.tar.gz: 18157fc502f07af5c6de175802f2ca11e4c4bb79876dfeb72b49e8a3c75c0fcd
5
5
  SHA512:
6
- metadata.gz: a1fdd05a1bbda7bf56ba8855d73d7dfe02a664b44529a5e098228784745d40c21b36e1c40a40407d56650a1e0c774b066bb4e90fab48d53dbe932f0b1654a87c
7
- data.tar.gz: ff314cb4ffcdb0a9dce6d0981656e4ecc96909b409486b73c467867510090de7b84bf46b8982da76488c8be0bf9e8a6c8dbb8e6e099b980c745cfa04a319efc3
6
+ metadata.gz: a7fe9549edf90b52e830b456ee873c2e954f98a4956a67f6a39d36c967c70432c2f04b2548b8362fd70bdf188069dcaee369cd691ab56e4b917767090eb6023a
7
+ data.tar.gz: 55c01642e6f79cd86ed05e60e5c6b54980b379fc5c3907a0ffd4e862f5983971f35c005e8f65ba53bf15d6c252d81d06e602061e4a3e296dadf77eb97b2d593c
@@ -4,6 +4,11 @@ Spree.Views.Tables.ReturnItems = Backbone.View.extend({
4
4
  var tfoot = document.createElement('tfoot')
5
5
  new Spree.Views.Tables.SelectableTable.SumReturnItemAmount({el: tfoot, model: this.model});
6
6
  this.$el.append(tfoot);
7
+
8
+ this.$el.find('input, select').not('.add-item').on('change', function(e) {
9
+ $(this).closest('tr').find('input.add-item').prop('checked', true)
10
+ .change();
11
+ });
7
12
  }
8
13
  },
9
14
  })
@@ -15,8 +15,11 @@ Spree.Views.Tables.SelectableTable.SumReturnItemAmount = Backbone.View.extend({
15
15
  },
16
16
 
17
17
  totalSelectedReturnItemAmount: function () {
18
- var totalAmount = 0.00;
18
+ var totalAmount = 0;
19
19
  var selectedItems = [];
20
+ var decimals = 0;
21
+ var separator = Spree.t('currency_separator');
22
+ var amount, decimalAmount;
20
23
 
21
24
  if(this.model.get('allSelected')) {
22
25
  selectedItems = $('.selectable');
@@ -24,9 +27,13 @@ Spree.Views.Tables.SelectableTable.SumReturnItemAmount = Backbone.View.extend({
24
27
  selectedItems = $(this.model.attributes.selectedItems);
25
28
  }
26
29
  selectedItems.each(function(_, selectedItem){
27
- totalAmount += $(selectedItem).data('price');
30
+ amount = $(selectedItem).data('price');
31
+ decimalAmount = amount.toString().split(separator)[1] || '';
32
+ decimals = Math.max(decimals, decimalAmount.length);
33
+
34
+ totalAmount += parseFloat(amount);
28
35
  })
29
36
 
30
- return totalAmount;
37
+ return accounting.formatNumber(totalAmount, decimals, Spree.t('currency_delimiter'), separator);
31
38
  },
32
39
  });
@@ -10,6 +10,7 @@ module Spree
10
10
  helper_method :clone_object_url
11
11
  before_action :split_params, only: [:create, :update]
12
12
  before_action :normalize_variant_property_rules, only: [:update]
13
+ before_action :set_default_tax_category, only: [:new, :edit]
13
14
 
14
15
  def show
15
16
  redirect_to action: :edit
@@ -46,6 +47,10 @@ module Spree
46
47
 
47
48
  private
48
49
 
50
+ def set_default_tax_category
51
+ @product.tax_category_id ||= @default_tax_category&.id
52
+ end
53
+
49
54
  def split_params
50
55
  if params[:product][:taxon_ids].present?
51
56
  params[:product][:taxon_ids] = params[:product][:taxon_ids].split(',')
@@ -12,7 +12,7 @@
12
12
  <section>
13
13
  <%= content_tag :h4, t('spree.account') %>
14
14
  <%= t('spree.email') %>: <%= @order.email %><br>
15
- <%= t('spree.guest_checkout') %>: <%= @order.user ? t('spree.yes') : t('spree.no') %>
15
+ <%= t('spree.guest_checkout') %>: <%= @order.user.nil? ? t('spree.yes') : t('spree.no') %>
16
16
  </section>
17
17
 
18
18
  <section>
@@ -158,7 +158,7 @@
158
158
  <%= f.field_container :tax_category do %>
159
159
  <%= f.label :tax_category_id, Spree::TaxCategory.model_name.human %>
160
160
  <%= f.field_hint :tax_category, default_tax_category: @default_tax_category&.name %>
161
- <%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { include_blank: t('spree.match_choices.none'), selected: @default_tax_category&.id }, { class: 'custom-select' }) %>
161
+ <%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { include_blank: t('spree.match_choices.none') }, { class: 'custom-select' }) %>
162
162
  <%= f.error_message_on :tax_category %>
163
163
  <% end %>
164
164
  </div>
@@ -20,7 +20,24 @@
20
20
  </div>
21
21
  <% end %>
22
22
 
23
- <%= render "spree/admin/taxons/attachment_forms/#{f.object.attachment_partial_name}", f: f %>
23
+ <% if f.object.class.attachment_definitions.size > 1 %>
24
+ <%= render "spree/admin/taxons/attachment_forms/#{f.object.attachment_partial_name}", f: f %>
25
+ <% else %>
26
+ <%= f.field_container :icon do %>
27
+ <%= f.label :icon %><br>
28
+ <%= f.file_field :icon %>
29
+ <% if f.object.icon_present? %>
30
+ <%= image_tag f.object.icon(:mini) %>
31
+ <%= link_to t('spree.actions.remove'),
32
+ admin_taxonomy_taxon_attachment_path(@taxonomy,
33
+ @taxon.id,
34
+ attachment_definition: :icon,
35
+ authenticity_token: form_authenticity_token),
36
+ method: :delete,
37
+ class: 'btn btn-sm btn-danger' %>
38
+ <% end %>
39
+ <% end %>
40
+ <% end %>
24
41
  </div>
25
42
 
26
43
  <div class="col-5">
@@ -1,8 +1,15 @@
1
+ <%
2
+ Spree::Deprecation.warn(
3
+ "This partial with its support for multiple Spree::Taxon attachments is deprecated and will be removed in a future " \
4
+ "version of Solidus, please overwrite the standard view if you need to support custom attachments."
5
+ )
6
+ %>
7
+
1
8
  <% f.object.class.attachment_definitions.each do |attachment, definition| %>
2
9
  <%= f.field_container attachment do %>
3
10
  <%= f.label attachment %><br>
4
11
  <%= f.file_field attachment %>
5
- <% if f.object.send(attachment).present? %>
12
+ <% if f.object.send(:"#{attachment}_present?") %>
6
13
  <%= image_tag f.object.send(attachment, definition[:default_style]) %>
7
14
  <%= link_to t('spree.actions.remove'),
8
15
  admin_taxonomy_taxon_attachment_path(@taxonomy,
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Select2 English Australian translations
3
+ */
4
+ (function ($) {
5
+ "use strict";
6
+
7
+ $.fn.select2.locales['en-AU'] = {};
8
+
9
+ $.extend($.fn.select2.defaults, $.fn.select2.locales['en-AU']);
10
+ })(jQuery);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Select2 English GB translations
3
+ */
4
+ (function ($) {
5
+ "use strict";
6
+
7
+ $.fn.select2.locales['en-GB'] = {};
8
+
9
+ $.extend($.fn.select2.defaults, $.fn.select2.locales['en-GB']);
10
+ })(jQuery);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Select2 English IN translations
3
+ */
4
+ (function ($) {
5
+ "use strict";
6
+
7
+ $.fn.select2.locales['en-IN'] = {};
8
+
9
+ $.extend($.fn.select2.defaults, $.fn.select2.locales['en-IN']);
10
+ })(jQuery);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Select2 English NZ translations
3
+ */
4
+ (function ($) {
5
+ "use strict";
6
+
7
+ $.fn.select2.locales['en-NZ'] = {};
8
+
9
+ $.extend($.fn.select2.defaults, $.fn.select2.locales['en-NZ']);
10
+ })(jQuery);
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.11.4
4
+ version: 2.11.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-19 00:00:00.000000000 Z
11
+ date: 2021-03-10 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.11.4
19
+ version: 2.11.5
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.11.4
26
+ version: 2.11.5
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.11.4
33
+ version: 2.11.5
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.11.4
40
+ version: 2.11.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: coffee-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -770,6 +770,10 @@ files:
770
770
  - vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_da.js
771
771
  - vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_de.js
772
772
  - vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_el.js
773
+ - vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-AU.js
774
+ - vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-GB.js
775
+ - vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-IN.js
776
+ - vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-NZ.js
773
777
  - vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-US.js
774
778
  - vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_es-MX.js
775
779
  - vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_es.js