solidus_backend 2.11.3 → 2.11.8

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: cff51310e9c979590ce028d47a2ade2d4f5bd6d2f1e27f3caed79654d2128c98
4
- data.tar.gz: 86ad8a72ef9e123905882a3137605f80349d821bd1d15becf0f314538a6aa69f
3
+ metadata.gz: c59b6122a2c4ce01a5c11d524e331edd7a40c021aa8580d024afeeb2f491cc31
4
+ data.tar.gz: 303bf530da63cb21f75d4d0f1c80668518836dbbcdd8851677a82b8c7c09501e
5
5
  SHA512:
6
- metadata.gz: 6f256f85b420c0dc13d811db50df72ed7cd53267d4d11c730ac1099a20d939e03c1970c2017229935a023c85b03ed870d8207355f1c092017c4669fe03f2da54
7
- data.tar.gz: e9f17702ec6cfe6692ef13c8c63037137517ffc162c67b6d1d698f805e8f8271a9f3985532e8fe217d3bd2db5c6ae6734aa6e580e8cdefb32e8bce0811d7a7e8
6
+ metadata.gz: 3ae43f780eaf98974a2569821378a61ac84596f1fb984b47b65539a8605f58662dba190787d20a825c08198adad4244d8ad02b0fb2a3ba626cf3c9fb1150fd2f
7
+ data.tar.gz: eaa2051bc5b210599dd8a5e7f12a578a3146fbd574dc10db0aedb78420530dd7de04483d82f7410e87afb0076010f6e021fc1214a6aaff4f0051fb3ef72a8ff9
@@ -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
  });
@@ -13,7 +13,7 @@ $secondary: $color-dark-accent !default;
13
13
  $blue: $color-primary !default;
14
14
  $red: $color-red !default;
15
15
  $orange: $color-yellow !default;
16
- $green: $color-success !default;
16
+ $green: $color-green !default;
17
17
 
18
18
  // Body
19
19
  //
@@ -1,3 +1,65 @@
1
+ $color-action-success-bg: theme-color-level(success, -10) !default;
2
+ $color-action-success-brd: theme-color-level(success, -9) !default;
3
+ $color-action-warning-bg: theme-color-level(warning, -10) !default;
4
+ $color-action-warning-brd: theme-color-level(warning, -9) !default;
5
+ $color-action-danger-bg: theme-color-level(danger, -10) !default;
6
+ $color-action-danger-brd: theme-color-level(danger, -9) !default;
7
+
8
+ $color-action-edit-bg: $color-action-success-bg !default;
9
+ $color-action-edit-brd: $color-action-success-brd !default;
10
+ $color-action-clone-bg: $color-action-warning-bg !default;
11
+ $color-action-clone-brd: $color-action-warning-brd !default;
12
+ $color-action-remove-bg: $color-action-danger-bg !default;
13
+ $color-action-remove-brd: $color-action-danger-brd !default;
14
+ $color-action-void-bg: $color-action-danger-bg !default;
15
+ $color-action-void-brd: $color-action-danger-brd !default;
16
+ $color-action-cancel-bg: $color-action-warning-bg !default;
17
+ $color-action-cancel-brd: $color-action-warning-brd !default;
18
+ $color-action-capture-bg: $color-action-success-bg !default;
19
+ $color-action-capture-brd: $color-action-success-brd !default;
20
+ $color-action-save-bg: $color-action-success-bg !default;
21
+ $color-action-save-brd: $color-action-success-brd !default;
22
+ $color-action-mail-bg: $color-action-success-bg !default;
23
+ $color-action-mail-brd: $color-action-success-brd !default;
24
+ $color-action-failure-bg: $color-action-danger-bg !default;
25
+ $color-action-failure-brd: $color-action-danger-brd !default;
26
+
27
+ $actions: (
28
+ edit,
29
+ clone,
30
+ remove,
31
+ void,
32
+ capture,
33
+ save,
34
+ cancel,
35
+ mail,
36
+ failure
37
+ ) !default;
38
+
39
+ $actions-bg-colors: (
40
+ $color-action-edit-bg,
41
+ $color-action-clone-bg,
42
+ $color-action-remove-bg,
43
+ $color-action-void-bg,
44
+ $color-action-capture-bg,
45
+ $color-action-save-bg,
46
+ $color-action-cancel-bg,
47
+ $color-action-mail-bg,
48
+ $color-action-failure-bg
49
+ ) !default;
50
+
51
+ $actions-brd-colors: (
52
+ $color-action-edit-brd,
53
+ $color-action-clone-brd,
54
+ $color-action-remove-brd,
55
+ $color-action-void-brd,
56
+ $color-action-capture-brd,
57
+ $color-action-save-brd,
58
+ $color-action-cancel-brd,
59
+ $color-action-mail-brd,
60
+ $color-action-failure-brd
61
+ ) !default;
62
+
1
63
  table tbody tr {
2
64
  &.highlight {
3
65
 
@@ -44,16 +44,16 @@
44
44
  color: $body-color;
45
45
 
46
46
  &.notice {
47
- background-color: rgba(lighten($color-notice, 15), .95);
48
- border-top-color: $color-notice;
47
+ background-color: rgba(theme-color-level(warning, -8), .95);
48
+ border-top-color: theme-color(warning);
49
49
  }
50
50
  &.success {
51
- background-color: rgba(lighten($color-success, 30), .95);
52
- border-top-color: $color-success;
51
+ background-color: rgba(theme-color-level(success, -10), .95);
52
+ border-top-color: theme-color(success);
53
53
  }
54
54
  &.error {
55
- background-color: rgba(lighten($color-error, 30), .95);
56
- border-top-color: $color-error;
55
+ background-color: rgba(theme-color-level(danger, -8), .95);
56
+ border-top-color: theme-color(danger);
57
57
  }
58
58
  }
59
59
 
@@ -11,7 +11,7 @@ $output-solidus-deprecation-warnings: true !default;
11
11
  @if $output-solidus-deprecation-warnings == true {
12
12
  @if global-variable-exists($variable) {
13
13
  @warn "[Solidus] [Deprecation] `$#{$variable}` is deprecated and will be " +
14
- "removed in 3.0.0. Please use Bootstraps $#{$replacement} instead";
14
+ "removed in 3.0.0. Please use Bootstraps #{$replacement} instead";
15
15
  }
16
16
  }
17
17
  }
@@ -62,11 +62,11 @@ $color-tab-active-bg: $color-white !default;
62
62
  $color-tab-active-border: $color-white !default;
63
63
 
64
64
  // Basic flash colors
65
- @include bs-deprecated-variable("color-success", "brand-success");
65
+ @include bs-deprecated-variable("color-success", "theme-color(success)");
66
66
  $color-success: $color-green !default;
67
- @include bs-deprecated-variable("color-notice", "brand-warning");
67
+ @include bs-deprecated-variable("color-notice", "theme-color(warning)");
68
68
  $color-notice: $color-yellow !default;
69
- @include bs-deprecated-variable("color-error", "brand-danger");
69
+ @include bs-deprecated-variable("color-error", "theme-color(danger)");
70
70
  $color-error: $color-red !default;
71
71
 
72
72
  // Breadcrumb custom variable
@@ -113,26 +113,6 @@ $color-pill-warning-text: $color-pill-text;
113
113
  $color-pill-error: #ff967b;
114
114
  $color-pill-error-text: $color-pill-text;
115
115
 
116
- // Actions colors
117
- $color-action-edit-bg: lighten($color-success, (5 * 5) ) !default;
118
- $color-action-edit-brd: lighten($color-success, (20 * 5) ) !default;
119
- $color-action-clone-bg: lighten($color-notice, (5 * 5) ) !default;
120
- $color-action-clone-brd: lighten($color-notice, (15 * 5) ) !default;
121
- $color-action-remove-bg: lighten($color-error, (5 * 5) ) !default;
122
- $color-action-remove-brd: lighten($color-error, (10 * 5) ) !default;
123
- $color-action-void-bg: lighten($color-error, (10 * 5) ) !default;
124
- $color-action-void-brd: lighten($color-error, (20 * 5) ) !default;
125
- $color-action-cancel-bg: lighten($color-notice, (10 * 5) ) !default;
126
- $color-action-cancel-brd: lighten($color-notice, (20 * 5) ) !default;
127
- $color-action-capture-bg: lighten($color-success, (5 * 5) ) !default;
128
- $color-action-capture-brd: lighten($color-success, (20 * 5) ) !default;
129
- $color-action-save-bg: lighten($color-success, (5 * 5) ) !default;
130
- $color-action-save-brd: lighten($color-success, (20 * 5) ) !default;
131
- $color-action-mail-bg: lighten($color-success, (5 * 5) ) !default;
132
- $color-action-mail-brd: lighten($color-success, (20 * 5) ) !default;
133
- $color-action-failure-bg: lighten($color-error, (10 * 5) ) !default;
134
- $color-action-failure-brd: lighten($color-error, (20 * 5) ) !default;
135
-
136
116
  // Available states
137
117
  $states: (
138
118
  active,
@@ -160,11 +140,6 @@ $states: (
160
140
  void
161
141
  ) !default;
162
142
 
163
- // Available actions
164
- $actions: edit, clone, remove, void, capture, save, cancel, mail, failure !default;
165
- $actions-bg-colors: $color-action-edit-bg, $color-action-clone-bg, $color-action-remove-bg, $color-action-void-bg, $color-action-capture-bg, $color-action-save-bg, $color-action-cancel-bg, $color-action-mail-bg, $color-action-failure-bg !default;
166
- $actions-brd-colors: $color-action-edit-brd, $color-action-clone-brd, $color-action-remove-brd, $color-action-void-brd, $color-action-capture-brd, $color-action-save-brd, $color-action-cancel-brd, $color-action-mail-brd, $color-action-failure-brd !default;
167
-
168
143
  // Sidebar
169
144
  //--------------------------------------------------------------
170
145
  $width-sidebar: 200px !default;
@@ -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>
@@ -39,17 +39,17 @@ colors = [
39
39
  used_for: 'Buttons primary actions, links, active states.'
40
40
  },
41
41
  {
42
- name: '$color-success',
42
+ name: 'theme-color(success)',
43
43
  value: '#52B73B',
44
44
  used_for: 'Success actions.'
45
45
  },
46
46
  {
47
- name: '$color-error',
47
+ name: 'theme-color(danger)',
48
48
  value: '#CE452A',
49
49
  used_for: 'Errors, destructive action warnings.'
50
50
  },
51
51
  {
52
- name: '$color-notice',
52
+ name: 'theme-color(warning)',
53
53
  value: '#FFDD59',
54
54
  used_for: 'Warnings actions.'
55
55
  }
@@ -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).exists? %>
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.3
4
+ version: 2.11.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-18 00:00:00.000000000 Z
11
+ date: 2021-04-01 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.3
19
+ version: 2.11.8
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.3
26
+ version: 2.11.8
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.3
33
+ version: 2.11.8
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.3
40
+ version: 2.11.8
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