spree_cm_commissioner 2.6.0 → 2.6.1.pre.patch1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 66ee7dd96d331aa9bc7b6c623122bfc392eb750b18e4b0862b369320cbc4dbb1
4
- data.tar.gz: 34144c8f2905396882d00c544ef24f3624135eaf534d9c0eeb47de3f2ea79674
3
+ metadata.gz: 274cc050ff740aa833dcaabe59107c1aa8d62888208331930c3d07c5b54ecddf
4
+ data.tar.gz: 24b5ba546e632c0170730bd70656004a9f6a754bbb491aa63745ffdded7997b4
5
5
  SHA512:
6
- metadata.gz: 6435ba7b9dc0d4581c9f970562ec45b3eb0645731e107adba712e199234fad6de29c05d74f770b3cf5aab612e48aa613ea913615793de0a1ebd90ba89e4db447
7
- data.tar.gz: 2d44d9326fcfa39419d7fc39d84d1d28aea75cbb99c866699e9a1a7741bce095a0bc20f532a069225abd783128fe7c3160da9b942a52b48c67ecdde8d667ca9e
6
+ metadata.gz: a3941126c0368b51bbd9ef5d88b48eb67eb3c42452328957df2de6bbadf18fcc55b5b5f219ce51fe4b0dfe8c9a5395069ecc48f85a1d17e03a15ae367c582ced
7
+ data.tar.gz: f39c889290db96eb38154db411eddb8f99a92bb4c048b69e0b85fc6ca04213d21425f81aee79ac52811a15af464a3b4a8f2b5bc1c0b527c8d732010a6c3fbf77
data/Gemfile.lock CHANGED
@@ -34,7 +34,7 @@ GIT
34
34
  PATH
35
35
  remote: .
36
36
  specs:
37
- spree_cm_commissioner (2.6.0)
37
+ spree_cm_commissioner (2.6.1.pre.patch1)
38
38
  activerecord-multi-tenant
39
39
  activerecord_json_validator (~> 2.1, >= 2.1.3)
40
40
  aws-sdk-cloudfront
@@ -0,0 +1,30 @@
1
+ module Spree
2
+ module Admin
3
+ module System
4
+ class CacheController < Spree::Admin::BaseController
5
+ def show; end
6
+
7
+ def invalidate
8
+ @patterns = params[:patterns].to_s
9
+
10
+ patterns = @patterns.split("\n").map(&:strip).compact_blank
11
+
12
+ if patterns.empty?
13
+ flash.now[:error] = 'Please enter at least one pattern.' # rubocop:disable Rails/I18nLocaleTexts
14
+ render :show and return
15
+ end
16
+
17
+ result = SpreeCmCommissioner::InvalidateCacheRequest.call(patterns: patterns)
18
+
19
+ if result.success?
20
+ flash[:success] = "Cache invalidated successfully for #{patterns.size} pattern(s)."
21
+ redirect_to admin_system_cache_path
22
+ else
23
+ flash.now[:error] = result.message
24
+ render :show
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,35 @@
1
+ module Spree
2
+ module Admin
3
+ module System
4
+ class WaitingRoomController < Spree::Admin::BaseController
5
+ def show
6
+ @fetcher = SpreeCmCommissioner::WaitingRoomSystemMetadataFetcher.new
7
+ @fetcher.load_document_data
8
+
9
+ @active_sesions_count = SpreeCmCommissioner::WaitingRoomSession.active.count
10
+ end
11
+
12
+ def modify_multiplier
13
+ modifier = params[:multiplier]&.to_i || 0
14
+ SpreeCmCommissioner::WaitingRoomSystemMetadataSetter.new.modify_multiplier(modifier)
15
+
16
+ redirect_back fallback_location: admin_system_waiting_room_path
17
+ end
18
+
19
+ def modify_max_thread_count
20
+ modifier = params[:max_thread_count]&.to_i || 0
21
+ SpreeCmCommissioner::WaitingRoomSystemMetadataSetter.new.modify_max_thread_count(modifier)
22
+
23
+ redirect_back fallback_location: admin_system_waiting_room_path
24
+ end
25
+
26
+ def force_pull
27
+ SpreeCmCommissioner::WaitingRoomLatestSystemMetadataPullerJob.perform_now
28
+ SpreeCmCommissioner::WaitingGuestsCallerJob.perform_now
29
+
30
+ redirect_back fallback_location: admin_system_waiting_room_path
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -132,7 +132,7 @@ module SpreeCmCommissioner
132
132
  'SpreeCmCommissioner::PinCodeMobileConfirm' => I18n.t('pincode.readable_type.confirmation_code'),
133
133
  'SpreeCmCommissioner::PinCodeUpdateUserLogin' => I18n.t('pincode.readable_type.update_user_login'),
134
134
  'SpreeCmCommissioner::PinCodeEmailConfirm' => I18n.t('pincode.readable_type.confirmation_code'),
135
- 'SpreeCmCommissioner::OtpCode' => I18n.t('pincode.readable_type.otp_code'),
135
+ 'SpreeCmCommissioner::PinCodeOtp' => I18n.t('pincode.readable_type.otp_code'),
136
136
  'SpreeCmCommissioner::PinCodeTelegram' => I18n.t('pincode.readable_type.telegram_verification')
137
137
  }
138
138
  end
@@ -106,15 +106,15 @@ module SpreeCmCommissioner
106
106
  def homepage_section_patterns
107
107
  homepage_segment.flat_map do |segment|
108
108
  [
109
- "/api/v2/storefront/homepage/#{segment}/homepage_sections",
110
- "/api/v2/tenant/homepage/#{segment}/homepage_sections"
109
+ "/api/v2/storefront/homepage/#{segment}/homepage_sections*",
110
+ "/api/v2/tenant/homepage/#{segment}/homepage_sections*"
111
111
  ]
112
112
  end
113
113
  end
114
114
 
115
115
  def homepage_background_patterns
116
116
  homepage_segment.map do |segment|
117
- "/api/v2/storefront/homepage/#{segment}/homepage_background"
117
+ "/api/v2/storefront/homepage/#{segment}/homepage_background*"
118
118
  end
119
119
  end
120
120
  end
@@ -18,7 +18,6 @@
18
18
  <th>Status</th>
19
19
  <th>Public Metadata</th>
20
20
  <th>Private Metadata</th>
21
- <th>File</th>
22
21
  <th>Created At</th>
23
22
  <th>Actions</th>
24
23
  </tr>
@@ -66,15 +65,6 @@
66
65
  <span class="text-muted">-</span>
67
66
  <% end %>
68
67
  </td>
69
- <td>
70
- <% if export.exported_file.attached? %>
71
- <%= link_to export.exported_file_name, export.exported_file_url, target: '_blank', class: 'btn btn-sm btn-outline-primary' %>
72
- <br>
73
- <small class="text-muted"><%= number_to_human_size(export.file_size_bytes) %></small>
74
- <% else %>
75
- <span class="text-muted">-</span>
76
- <% end %>
77
- </td>
78
68
  <td><small><%= l(export.created_at, format: :short) %></small></td>
79
69
  <td data-hook="admin_exports_index_row_actions" class="actions">
80
70
  <span class="d-flex justify-content-end">
@@ -0,0 +1,19 @@
1
+ <% content_for :page_title do %>
2
+ <%= Spree.t('system') %>
3
+ <% end %>
4
+
5
+ <% content_for(:page_tabs) do %>
6
+ <%= content_tag :li, class: 'nav-item' do %>
7
+ <%= link_to_with_icon 'activity.svg',
8
+ Spree.t(:waiting_room),
9
+ admin_system_waiting_room_path,
10
+ class: "nav-link #{'active' if current == :waiting_room}" %>
11
+ <% end %>
12
+
13
+ <%= content_tag :li, class: 'nav-item' do %>
14
+ <%= link_to_with_icon 'cloud.svg',
15
+ Spree.t(:cdn_cache),
16
+ admin_system_cache_path,
17
+ class: "nav-link #{'active' if current == :cache}" %>
18
+ <% end %>
19
+ <% end %>
@@ -0,0 +1,18 @@
1
+ <%= render 'spree/admin/shared/system_tabs', current: :cache %>
2
+
3
+ <div class="card">
4
+ <div class="card-body">
5
+ <%= form_tag invalidate_admin_system_cache_path, method: :post do %>
6
+ <div class="form-group">
7
+ <label for="patterns">Patterns</label>
8
+ <%= text_area_tag :patterns, @patterns,
9
+ id: 'patterns',
10
+ class: 'form-control font-monospace',
11
+ rows: 8,
12
+ placeholder: "/api/v2/storefront/homepage/general/homepage_sections*\n/api/v2/storefront/products/*" %>
13
+ <small class="form-text text-muted">One pattern per line. Use <code>*</code> as wildcard.</small>
14
+ </div>
15
+ <%= button_tag 'Invalidate', type: :submit, class: 'btn btn-primary' %>
16
+ <% end %>
17
+ </div>
18
+ </div>
@@ -1,12 +1,10 @@
1
- <% content_for :page_title do %>
2
- <%= link_to Spree.t('system'), spree.admin_system_path %>
3
- <% end %>
1
+ <%= render 'spree/admin/shared/system_tabs', current: :waiting_room %>
4
2
 
5
3
  <% content_for :page_actions do %>
6
- <%= button_link_to Spree.t(:force_pull), force_pull_admin_system_path, method: :post, class: "btn btn-outline-primary" %>
4
+ <%= button_link_to Spree.t(:force_pull), force_pull_admin_system_waiting_room_path, method: :post, class: "btn btn-outline-primary" %>
7
5
  <% end %>
8
6
 
9
- <div class="table-responsive border rounded bg-white">
7
+ <div class="bg-white border rounded table-responsive">
10
8
  <table class="table" data-hook>
11
9
  <thead class="text-muted">
12
10
  <tr data-hook="admin_system_index_headers">
@@ -32,13 +30,13 @@
32
30
  {
33
31
  field_name: :max_thread_count,
34
32
  value: @fetcher.max_thread_count,
35
- modify_path: modify_max_thread_count_admin_system_path
33
+ modify_path: modify_max_thread_count_admin_system_waiting_room_path
36
34
  },
37
35
  {
38
36
  field_name: :multiplier,
39
37
  value: @fetcher.multiplier,
40
38
  value_suffix: "%",
41
- modify_path: modify_multiplier_admin_system_path
39
+ modify_path: modify_multiplier_admin_system_waiting_room_path
42
40
  },
43
41
  ] %>
44
42
 
data/config/routes.rb CHANGED
@@ -8,11 +8,21 @@ Spree::Core::Engine.add_routes do
8
8
  namespace :admin do
9
9
  post '/invalidate_api_caches', to: 'base#invalidate_api_caches'
10
10
 
11
- resource :system, controller: :system do
12
- collection do
13
- post :force_pull
14
- post :modify_multiplier
15
- post :modify_max_thread_count
11
+ get '/system', to: redirect('/admin/system/waiting_room')
12
+
13
+ namespace :system do
14
+ resource :waiting_room, controller: :waiting_room, only: [:show] do
15
+ collection do
16
+ post :force_pull
17
+ post :modify_multiplier
18
+ post :modify_max_thread_count
19
+ end
20
+ end
21
+
22
+ resource :cache, controller: :cache, only: [:show] do
23
+ collection do
24
+ post :invalidate
25
+ end
16
26
  end
17
27
  end
18
28
 
@@ -1,5 +1,5 @@
1
1
  module SpreeCmCommissioner
2
- VERSION = '2.6.0'.freeze
2
+ VERSION = '2.6.1-patch1'.freeze
3
3
 
4
4
  module_function
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_cm_commissioner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1.pre.patch1
5
5
  platform: ruby
6
6
  authors:
7
7
  - You
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-24 00:00:00.000000000 Z
11
+ date: 2026-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree
@@ -883,7 +883,8 @@ files:
883
883
  - app/controllers/spree/admin/s3_presigned_urls_controller.rb
884
884
  - app/controllers/spree/admin/sprite_import_controller.rb
885
885
  - app/controllers/spree/admin/stock_managements_controller.rb
886
- - app/controllers/spree/admin/system_controller.rb
886
+ - app/controllers/spree/admin/system/cache_controller.rb
887
+ - app/controllers/spree/admin/system/waiting_room_controller.rb
887
888
  - app/controllers/spree/admin/taxon_childrens_controller.rb
888
889
  - app/controllers/spree/admin/taxon_vendors_controller.rb
889
890
  - app/controllers/spree/admin/taxons_controller_decorator.rb
@@ -2329,6 +2330,7 @@ files:
2329
2330
  - app/views/spree/admin/shared/_products.html.erb
2330
2331
  - app/views/spree/admin/shared/_send_all_form.html.erb
2331
2332
  - app/views/spree/admin/shared/_send_test_form.html.erb
2333
+ - app/views/spree/admin/shared/_system_tabs.html.erb
2332
2334
  - app/views/spree/admin/shared/_taxon_tabs.html.erb
2333
2335
  - app/views/spree/admin/shared/_vectors_option_type_tabs.html.erb
2334
2336
  - app/views/spree/admin/shared/_vectors_tabs.html.erb
@@ -2346,7 +2348,8 @@ files:
2346
2348
  - app/views/spree/admin/stock_managements/_variant_stock_items.html.erb
2347
2349
  - app/views/spree/admin/stock_managements/calendar.html.erb
2348
2350
  - app/views/spree/admin/stock_managements/index.html.erb
2349
- - app/views/spree/admin/system/show.html.erb
2351
+ - app/views/spree/admin/system/cache/show.html.erb
2352
+ - app/views/spree/admin/system/waiting_room/show.html.erb
2350
2353
  - app/views/spree/admin/taxon_childrens/index.html.erb
2351
2354
  - app/views/spree/admin/taxon_vendors/_form.html.erb
2352
2355
  - app/views/spree/admin/taxon_vendors/edit.html.erb
@@ -3282,9 +3285,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
3282
3285
  version: '2.7'
3283
3286
  required_rubygems_version: !ruby/object:Gem::Requirement
3284
3287
  requirements:
3285
- - - ">="
3288
+ - - ">"
3286
3289
  - !ruby/object:Gem::Version
3287
- version: '0'
3290
+ version: 1.3.1
3288
3291
  requirements:
3289
3292
  - none
3290
3293
  rubygems_version: 3.4.1
@@ -1,44 +0,0 @@
1
- module Spree
2
- module Admin
3
- class SystemController < Spree::Admin::ResourceController
4
- skip_before_action :load_resource
5
-
6
- def show
7
- @fetcher = SpreeCmCommissioner::WaitingRoomSystemMetadataFetcher.new
8
- @fetcher.load_document_data
9
-
10
- @active_sesions_count = SpreeCmCommissioner::WaitingRoomSession.active.count
11
- end
12
-
13
- def modify_multiplier
14
- modifier = params[:multiplier]&.to_i || 0
15
- SpreeCmCommissioner::WaitingRoomSystemMetadataSetter.new.modify_multiplier(modifier)
16
-
17
- redirect_back fallback_location: collection_url
18
- end
19
-
20
- def modify_max_thread_count
21
- modifier = params[:max_thread_count]&.to_i || 0
22
- SpreeCmCommissioner::WaitingRoomSystemMetadataSetter.new.modify_max_thread_count(modifier)
23
-
24
- redirect_back fallback_location: collection_url
25
- end
26
-
27
- def force_pull
28
- SpreeCmCommissioner::WaitingRoomLatestSystemMetadataPullerJob.perform_now
29
- SpreeCmCommissioner::WaitingGuestsCallerJob.perform_now
30
-
31
- redirect_back fallback_location: collection_url
32
- end
33
-
34
- def model_class
35
- nil
36
- end
37
-
38
- # override
39
- def collection_url(options = {})
40
- admin_system_url(options)
41
- end
42
- end
43
- end
44
- end