spree_backend 4.4.0.rc1 → 4.4.0.rc2

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
  SHA256:
3
- metadata.gz: 07d5367f1dbc355de3ae28ae2d8fe99c2325c64cb88755bc48086973c92ae89c
4
- data.tar.gz: a39a64d3fd3282f581dbd4bf208b4527ab1a3bcf21587b190a938688c085e4f4
3
+ metadata.gz: ebcc48cb4029196c2f92245da41148073d38eb79ab6e26a97870bad59e266364
4
+ data.tar.gz: 28613b605a0464f4e0e3ebd4d9b6eb0179267b3465e156830c8824d84ba5a70d
5
5
  SHA512:
6
- metadata.gz: 8f1009715e9017806b2c7c139b26bf48fb70d6c074b183ca61135044a0ea4cc48ffa385423aa412a84913d2d74de57e68474a7cacd391812d583421432bcdaa3
7
- data.tar.gz: '0684732d6c1df365155d75d7aaa84b11da1e293b05792e89ad9a5f56cf8b4fbe76754610bbf42c86ebde985de62093e677b11484340563c1899c73e2b7d1ada6'
6
+ metadata.gz: c17c6967cc3daf6e6dfe6bda173cb8214b1da6662c601f08cd4657de6c2e7d1883151d832d7a7a10971148b673346c28864e7b3491dea8949674a41424d9fd01
7
+ data.tar.gz: 6e4366fb5d2ca9fb24e796ca478e2063831e5448760f1771bb4410fbf0981f32ea860734de786f54bb30504224a481c0f6f7b60dcc420547135f763119b5b28a
data/.gitignore CHANGED
@@ -61,3 +61,4 @@ node_modules
61
61
  app/assets/javascripts/spree-dashboard.js
62
62
  app/assets/javascripts/spree-dashboard.*.js
63
63
  src
64
+ *.gem
data/Gemfile CHANGED
@@ -55,7 +55,7 @@ group :development do
55
55
  gem 'solargraph'
56
56
  end
57
57
 
58
- spree_opts = { github: 'spree/spree', branch: 'main' }
58
+ spree_opts = { github: 'spree/spree', branch: '4-4-stable' }
59
59
  gem 'spree_core', spree_opts
60
60
  gem 'spree_api', spree_opts
61
61
 
@@ -4,6 +4,8 @@ function updateAddressState(region, successCallback) {
4
4
  const stateSelect = $('#' + region + 'state select')
5
5
  const stateInput = $('#' + region + 'state input.state_name')
6
6
 
7
+ if (!countryId) { return }
8
+
7
9
  fetch(Spree.routes.countries_api_v2 + '/' + countryId + '?include=states', {
8
10
  headers: Spree.apiV2Authentication()
9
11
  }).then((response) => {
@@ -21,3 +21,9 @@ document.addEventListener("spree:load", function() {
21
21
  flatpickr('.datepicker', {})
22
22
  })
23
23
 
24
+ document.addEventListener("turbo:before-cache", function() {
25
+ document.querySelectorAll('.datePickerFrom, .datePickerTo, .datepicker').forEach(function(element) {
26
+ element._flatpickr.destroy()
27
+ })
28
+ })
29
+
@@ -25,6 +25,13 @@ document.addEventListener("spree:load", function() {
25
25
  loadAutoCompleteParams()
26
26
  })
27
27
 
28
+ // we need to delete select2 instances before document is saved to cache
29
+ // https://stackoverflow.com/questions/36497723/select2-with-ajax-gets-initialized-several-times-with-rails-turbolinks-events
30
+ document.addEventListener("turbo:before-cache", function() {
31
+ const select2Autocompletes = document.querySelectorAll('select[data-autocomplete-url-value]')
32
+ select2Autocompletes.forEach(element => $(element).select2('destroy'))
33
+ })
34
+
28
35
  // eslint-disable-next-line no-unused-vars
29
36
  function loadAutoCompleteParams() {
30
37
  const select2Autocompletes = document.querySelectorAll('select[data-autocomplete-url-value]')
@@ -1,3 +1,10 @@
1
+ // we need to delete select2 instances before document is saved to cache
2
+ // https://stackoverflow.com/questions/36497723/select2-with-ajax-gets-initialized-several-times-with-rails-turbolinks-events
3
+ document.addEventListener("turbo:before-cache", function() {
4
+ $('select.select2').select2('destroy')
5
+ $('select.select2-clear').select2('destroy')
6
+ })
7
+
1
8
  document.addEventListener("spree:load", function() {
2
9
  // Initiate a standard Select2 on any select element with the class .select2
3
10
  // Remember to add a place holder in the HTML as needed.
@@ -2,7 +2,7 @@ module Spree
2
2
  module Admin
3
3
  class ReturnIndexController < BaseController
4
4
  def return_authorizations
5
- collection(Spree::ReturnAuthorization)
5
+ collection(Spree::ReturnAuthorization.for_store(current_store))
6
6
  respond_with(@collection)
7
7
  end
8
8
 
@@ -18,9 +18,8 @@ module Spree
18
18
 
19
19
  params[:q] ||= {}
20
20
 
21
- @collection = resource.all
22
21
  # @search needs to be defined as this is passed to search_form_for
23
- @search = @collection.ransack(params[:q])
22
+ @search = resource.ransack(params[:q])
24
23
  per_page = params[:per_page] || Spree::Backend::Config[:admin_customer_returns_per_page]
25
24
  @collection = @search.result.order(created_at: :desc).page(params[:page]).per(per_page)
26
25
  end
@@ -231,7 +231,6 @@
231
231
  <%= f.select :option_type_ids, options_from_collection_for_select(@product.option_types, :id, :name, @product.option_type_ids),
232
232
  { include_hidden: true },
233
233
  multiple: true,
234
- class: 'select2-hidden-accessible',
235
234
  data: { autocomplete_url_value: 'option_types_api_v2',
236
235
  autocomplete_return_attr_value: 'name',
237
236
  autocomplete_multiple_value: true } %>
@@ -10,7 +10,6 @@
10
10
  <div data-hook="admin_products_sidebar">
11
11
 
12
12
  <%= search_form_for [:admin, @search] do |f| %>
13
- <%- locals = {f: f} %>
14
13
  <div data-hook="admin_products_index_search" class="row">
15
14
  <div class="col-12 col-lg-6">
16
15
  <div class="form-group">
@@ -152,7 +152,7 @@
152
152
  <% end %>
153
153
  <%= f.field_container :checkout_zone_id do %>
154
154
  <%= f.label :checkout_zone_id, Spree.t(:zone) %>
155
- <%= f.select :checkout_zone_id, options_for_select(@zones, selected_checkout_zone(@store)&.id), { include_blank: Spree.t(:no_limits_zone) }, { class: 'select2' } %>
155
+ <%= f.select :checkout_zone_id, options_for_select(@zones), { include_blank: Spree.t(:no_limits_zone) }, { class: 'select2' } %>
156
156
  <small class="form-text text-muted">
157
157
  <%= raw(Spree.t('store_form.checkout_zone_help')) %>
158
158
  </small>
@@ -1,6 +1,6 @@
1
1
  module Spree
2
2
  module Backend
3
- VERSION = '4.4.0.rc1'.freeze
3
+ VERSION = '4.4.0.rc2'.freeze
4
4
 
5
5
  def self.version
6
6
  VERSION
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spree/dashboard",
3
- "version": "0.0.3",
3
+ "version": "0.1.0",
4
4
  "description": "Spree Dashboard",
5
5
  "main": "app/assets/javascripts/spree-dashboard.js",
6
6
  "type": "module",
@@ -22,7 +22,6 @@
22
22
  "@hotwired/stimulus": "^3.0.1",
23
23
  "@hotwired/turbo": "^7.0.1",
24
24
  "@rails/request.js": "^0.0.5",
25
- "@spree/dashboard": "^0.0.3",
26
25
  "bootstrap": "4.6.1",
27
26
  "flatpickr": "^4.6.9",
28
27
  "jquery": "3.5.1",
data/yarn.lock CHANGED
@@ -101,21 +101,6 @@
101
101
  estree-walker "^1.0.1"
102
102
  picomatch "^2.2.2"
103
103
 
104
- "@spree/dashboard@^0.0.3":
105
- version "0.0.3"
106
- resolved "https://registry.yarnpkg.com/@spree/dashboard/-/dashboard-0.0.3.tgz#efa6488953d8dc2b3dd1011dd82e79464bb314a1"
107
- integrity sha512-a5txJwwZ7uxq3HVBpq3dlwcO+rPzmqmj9IMMDNyPr3iTPQpZmoX6pL3xcJ9h/Bc8ddfPBqETI8S7YxRjY4GwGA==
108
- dependencies:
109
- "@hotwired/stimulus" "^3.0.1"
110
- "@hotwired/turbo" "^7.0.1"
111
- "@rails/request.js" "^0.0.5"
112
- bootstrap "4.6.1"
113
- flatpickr "^4.6.9"
114
- jquery "3.5.1"
115
- popper.js "1.16.1"
116
- sortablejs "^1.14.0"
117
- stimulus-sortable "^3.1.0"
118
-
119
104
  "@types/estree@*":
120
105
  version "0.0.50"
121
106
  resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.0.rc1
4
+ version: 4.4.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-12-04 00:00:00.000000000 Z
12
+ date: 2022-01-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spree
@@ -900,9 +900,9 @@ licenses:
900
900
  - BSD-3-Clause
901
901
  metadata:
902
902
  bug_tracker_uri: https://github.com/spree/spree_backend/issues
903
- changelog_uri: https://github.com/spree/spree_backend/releases/tag/v4.4.0.rc1
903
+ changelog_uri: https://github.com/spree/spree_backend/releases/tag/v4.4.0.rc2
904
904
  documentation_uri: https://dev-docs.spreecommerce.org/
905
- source_code_uri: https://github.com/spree/spree_backend/tree/v4.4.0.rc1
905
+ source_code_uri: https://github.com/spree/spree_backend/tree/v4.4.0.rc2
906
906
  post_install_message:
907
907
  rdoc_options: []
908
908
  require_paths:
@@ -919,7 +919,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
919
919
  version: 1.3.1
920
920
  requirements:
921
921
  - none
922
- rubygems_version: 3.2.22
922
+ rubygems_version: 3.2.32
923
923
  signing_key:
924
924
  specification_version: 4
925
925
  summary: Admin Dashboard for Spree eCommerce platform