spree_admin 5.0.3 → 5.0.4
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 +4 -4
- data/app/controllers/spree/admin/dashboard_controller.rb +11 -12
- data/app/controllers/spree/admin/webhooks_subscribers_controller.rb +32 -13
- data/app/helpers/spree/admin/base_helper.rb +1 -1
- data/app/helpers/spree/admin/navigation_helper.rb +1 -1
- data/app/helpers/spree/admin/orders_helper.rb +3 -1
- data/app/javascript/spree/admin/application.js +0 -2
- data/app/javascript/spree/admin/controllers/asset_uploader_controller.js +3 -2
- data/app/javascript/spree/admin/controllers/variants_form_controller.js +3 -2
- data/app/javascript/spree/admin/helpers/trix/video_embed.js +2 -2
- data/app/views/spree/admin/dashboard/_top_products.html.erb +1 -1
- data/app/views/spree/admin/orders/_filters.html.erb +11 -1
- data/app/views/spree/admin/orders/_summary.html.erb +1 -1
- data/app/views/spree/admin/page_blocks/forms/_image.html.erb +9 -0
- data/app/views/spree/admin/page_builder/_sidebar_block.html.erb +10 -9
- data/app/views/spree/admin/page_builder/_sidebar_sections_toolbar.html.erb +152 -39
- data/app/views/spree/admin/payment_methods/_form.html.erb +1 -1
- data/app/views/spree/admin/products/form/_variants.html.erb +1 -0
- data/app/views/spree/admin/shared/_head.html.erb +6 -1
- data/app/views/spree/admin/shared/_tax_nav.html.erb +1 -0
- data/app/views/spree/admin/shared/sidebar/_store_nav.html.erb +3 -2
- data/app/views/spree/admin/shared/sidebar/_storefront_nav.html.erb +2 -0
- data/app/views/spree/admin/stores/form/_basic.html.erb +1 -1
- data/app/views/spree/admin/users/_form.html.erb +1 -1
- data/app/views/spree/admin/users/index.html.erb +3 -3
- data/app/views/spree/admin/variants/form/_media.html.erb +1 -0
- data/app/views/spree/admin/webhooks_subscribers/_form.html.erb +37 -19
- data/app/views/spree/admin/webhooks_subscribers/_webhooks_subscriber.html.erb +12 -6
- data/app/views/spree/admin/webhooks_subscribers/edit.html.erb +2 -2
- data/app/views/spree/admin/webhooks_subscribers/show.html.erb +58 -47
- data/config/importmap.rb +2 -2
- data/lib/spree/admin/engine.rb +9 -1
- data/vendor/javascript/bootstrap--dist--js--bootstrap.bundle.min.js.js +4 -4
- data/vendor/javascript/dompurify.js +24 -24
- metadata +8 -9
- data/app/javascript/spree/admin/controllers/webhook_subscriber_events_controller.js +0 -19
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class="form-group">
|
2
2
|
<%= f.label :email, raw(Spree.t(:email) + required_span_tag) %>
|
3
|
-
<%= f.email_field :email, class: 'form-control', required: true, autofocus: f.object.new_record
|
3
|
+
<%= f.email_field :email, class: 'form-control', required: true, autofocus: f.object.new_record? %>
|
4
4
|
<%= f.error_message_on :email %>
|
5
5
|
</div>
|
6
6
|
<div class="form-group">
|
@@ -6,12 +6,12 @@
|
|
6
6
|
<%= link_to spree.admin_users_path(q: params[:q].to_unsafe_hash, page: params[:page], per_page: params[:per_page], format: :csv), class: 'btn btn-light bg-transparent with-tip d-none d-lg-inline-flex', title: 'Export Customers to a CSV file. To filter specific Customers use "Filters" or Customers/Subscribers tabs before clicking this button' do %>
|
7
7
|
<%= icon 'table-export' %>
|
8
8
|
<%= Spree.t(:export) %>
|
9
|
-
<% end if can?(:
|
9
|
+
<% end if can?(:create, Spree::Export) %>
|
10
10
|
|
11
11
|
<%= render 'extra_actions' %>
|
12
12
|
|
13
|
-
<%= link_to_with_icon 'plus', Spree.t(:create_customer), spree.new_admin_user_path, class: "btn btn-primary" %>
|
14
|
-
<% end
|
13
|
+
<%= link_to_with_icon 'plus', Spree.t(:create_customer), spree.new_admin_user_path, class: "btn btn-primary" if can? :create, Spree::user_class %>
|
14
|
+
<% end %>
|
15
15
|
|
16
16
|
<div class="card-lg">
|
17
17
|
<%= render "spree/admin/users/filters" %>
|
@@ -19,6 +19,7 @@
|
|
19
19
|
asset_uploader_viewable_id_value: viewable&.id,
|
20
20
|
asset_uploader_viewable_type_value: 'Spree::Variant',
|
21
21
|
asset_uploader_allowed_file_types_value: allowed_file_types_for_upload,
|
22
|
+
asset_uploader_admin_assets_path_value: spree.admin_assets_path,
|
22
23
|
action: 'asset-uploader#open',
|
23
24
|
media_form_target: 'addButton'
|
24
25
|
} do %>
|
@@ -30,33 +30,51 @@
|
|
30
30
|
<%= Spree.t('admin.webhooks_subscribers.webhooks_events') %>
|
31
31
|
</h5>
|
32
32
|
</div>
|
33
|
-
<div class="card-body" data-controller="
|
33
|
+
<div class="card-body" data-controller="reveal">
|
34
34
|
<div class="form-group">
|
35
35
|
<div>
|
36
|
-
<div class="radio
|
36
|
+
<div class="custom-control custom-radio mb-3">
|
37
37
|
<%= radio_button_tag :subscribe_to_all_events, true,
|
38
38
|
subscribe_to_all_events?,
|
39
39
|
{
|
40
|
-
'data-action' => '
|
41
|
-
|
42
|
-
|
43
|
-
<%= label_tag :subscribe_to_all_events_true, Spree.t('admin.webhooks_subscribers.subscribe_to_all_events') %>
|
40
|
+
'data-action' => 'click->reveal#hide',
|
41
|
+
class: 'custom-control-input events' } %>
|
42
|
+
<%= label_tag :subscribe_to_all_events_true, Spree.t('admin.webhooks_subscribers.subscribe_to_all_events'), class: 'custom-control-label' %>
|
44
43
|
</div>
|
45
|
-
<div class="
|
44
|
+
<div class="custom-control custom-radio">
|
46
45
|
<%= radio_button_tag :subscribe_to_all_events, false,
|
47
46
|
!subscribe_to_all_events?,
|
48
|
-
{ 'data-action' => '
|
49
|
-
class: 'events' } %>
|
50
|
-
<%= label_tag :subscribe_to_all_events_false, Spree.t('admin.webhooks_subscribers.select_events') %>
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
47
|
+
{ 'data-action' => 'click->reveal#show',
|
48
|
+
class: 'custom-control-input events' } %>
|
49
|
+
<%= label_tag :subscribe_to_all_events_false, Spree.t('admin.webhooks_subscribers.select_events'), class: 'custom-control-label' %>
|
50
|
+
|
51
|
+
<div data-reveal-target="item" class="<%= subscribe_to_all_events? ? 'hidden' : '' %>">
|
52
|
+
<div class="bg-light rounded-lg p-3 mt-3">
|
53
|
+
<% @supported_events.each do |event| %>
|
54
|
+
<div class="form-group">
|
55
|
+
<div class="custom-control custom-switch">
|
56
|
+
<% resource_name = event.first %>
|
57
|
+
<%= f.check_box resource_name,
|
58
|
+
{ class: 'events-checkbox custom-control-input',
|
59
|
+
checked: @webhooks_subscriber.subscriptions&.any? { |event| event.include? "#{resource_name}." } },
|
60
|
+
true,
|
61
|
+
nil %>
|
62
|
+
|
63
|
+
<%= f.label resource_name, class: 'custom-control-label w-100' do %>
|
64
|
+
<%= Spree.t("#{resource_name.to_s.pluralize}") %>
|
65
|
+
<p class="gap-2 mb-0 mt-1">
|
66
|
+
<% event.last.each do |event| %>
|
67
|
+
<span class="badge badge-light">
|
68
|
+
<%= event %>
|
69
|
+
</span>
|
70
|
+
<% end %>
|
71
|
+
</p>
|
72
|
+
<% end %>
|
73
|
+
</div>
|
74
|
+
</div>
|
75
|
+
<% end %>
|
76
|
+
</div>
|
77
|
+
</div>
|
60
78
|
</div>
|
61
79
|
</div>
|
62
80
|
</div>
|
@@ -1,16 +1,22 @@
|
|
1
1
|
<tr id="<%= spree_dom_id webhooks_subscriber %>" data-controller="row-link" class="cursor-pointer">
|
2
|
-
<td data-action="click->row-link#openLink">
|
2
|
+
<td class="w-40 text-wrap" data-action="click->row-link#openLink">
|
3
3
|
<%= webhooks_subscriber.url %>
|
4
4
|
</td>
|
5
|
-
<td data-action="click->row-link#openLink"><%= active_badge(webhooks_subscriber.active) %></td>
|
6
|
-
<td class="w-
|
5
|
+
<td class="w-5" data-action="click->row-link#openLink"><%= active_badge(webhooks_subscriber.active) %></td>
|
6
|
+
<td class="w-30 text-wrap" data-action="click->row-link#openLink">
|
7
7
|
<% webhooks_subscriber.subscriptions&.sort&.each do |subscription| %>
|
8
8
|
<span class="badge badge-light"><%= subscription %></span>
|
9
9
|
<% end %>
|
10
10
|
</td>
|
11
|
-
<td data-action="click->row-link#openLink"
|
12
|
-
|
13
|
-
|
11
|
+
<td class="w-10" data-action="click->row-link#openLink">
|
12
|
+
<% if webhooks_subscriber.latest_event_at %>
|
13
|
+
<%= local_time(webhooks_subscriber.latest_event_at) %>
|
14
|
+
<% else %>
|
15
|
+
<span class="text-muted"><%= Spree.t(:not_available) %></span>
|
16
|
+
<% end %>
|
17
|
+
</td>
|
18
|
+
<td class="w-15">
|
19
|
+
<%= link_to_with_icon 'eye', Spree.t(:view), spree.admin_webhooks_subscriber_path(webhooks_subscriber), class: "btn btn-light btn-sm", data: { row_link_target: 'link' } %>
|
14
20
|
<%= link_to_edit(webhooks_subscriber) if can? :edit, webhooks_subscriber %>
|
15
21
|
</td>
|
16
22
|
</tr>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<% content_for :page_title do %>
|
2
|
-
<%= page_header_back_button spree.
|
2
|
+
<%= page_header_back_button spree.admin_webhooks_subscriber_path(@webhooks_subscriber) %>
|
3
3
|
<%= @webhooks_subscriber.url %>
|
4
4
|
<% end %>
|
5
5
|
<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @webhooks_subscriber } %>
|
6
|
-
<%= form_for [:admin, @webhooks_subscriber] do |f| %>
|
6
|
+
<%= form_for [:admin, @webhooks_subscriber], html: { id: "edit_subscriber_#{@webhooks_subscriber.id}" } do |f| %>
|
7
7
|
<%= render 'form', f: f %>
|
8
8
|
<%= render 'spree/admin/shared/edit_resource_links', f: f %>
|
9
9
|
<% end %>
|
@@ -1,54 +1,65 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<%= @webhooks_subscriber.url %>
|
3
|
+
<% end %>
|
4
|
+
|
1
5
|
<% content_for :page_title do %>
|
2
6
|
<%= page_header_back_button spree.admin_webhooks_subscribers_path %>
|
3
7
|
<%= @webhooks_subscriber.url %>
|
4
8
|
<% end %>
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
<% if @events.any? %>
|
26
|
-
<div class="card mb-4">
|
27
|
-
<div class="card-header">
|
28
|
-
<h5 class="card-title">
|
29
|
-
<%= Spree.t('admin.webhooks_subscribers.webhooks_events') %>
|
30
|
-
</h5>
|
9
|
+
|
10
|
+
<% content_for :page_actions do %>
|
11
|
+
<%= link_to_with_icon 'edit', Spree.t(:edit), spree.edit_admin_webhooks_subscriber_path(@webhooks_subscriber), class: 'btn btn-primary' %>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<ul class="list-group bg-white mb-4 rounded-lg">
|
15
|
+
<li class="list-group-item d-flex justify-content-between">
|
16
|
+
<strong class="text-uppercase"><%= Spree.t(:url) %></strong>
|
17
|
+
<%= external_link_to @webhooks_subscriber.url, @webhooks_subscriber.url, class: 'text-blue text-decoration-none' %>
|
18
|
+
</li>
|
19
|
+
<li class="list-group-item d-flex justify-content-between">
|
20
|
+
<strong><%= Spree.t(:active) %></strong>
|
21
|
+
<%= active_badge(@webhooks_subscriber.active) %>
|
22
|
+
</li>
|
23
|
+
<li class="list-group-item d-flex justify-content-between">
|
24
|
+
<strong><%= Spree.t('admin.webhooks_subscribers.subscriptions') %></strong>
|
25
|
+
<div>
|
26
|
+
<% @webhooks_subscriber.subscriptions&.sort&.each do |subscription| %>
|
27
|
+
<span class="badge badge-light"><%= subscription %></span>
|
28
|
+
<% end %>
|
31
29
|
</div>
|
32
|
-
|
33
|
-
|
30
|
+
</li>
|
31
|
+
</ul>
|
32
|
+
|
33
|
+
<div class="card mb-4">
|
34
|
+
<div class="card-header">
|
35
|
+
<h5 class="card-title">
|
36
|
+
<%= Spree.t('admin.webhooks_subscribers.webhooks_events') %>
|
37
|
+
</h5>
|
38
|
+
</div>
|
39
|
+
<table class="table card-body pb-0">
|
40
|
+
<thead>
|
41
|
+
<tr>
|
42
|
+
<th><%= Spree.t('admin.name') %></th>
|
43
|
+
<th><%= Spree.t('admin.successful') %></th>
|
44
|
+
<th><%= Spree.t('admin.created_at') %></th>
|
45
|
+
<th><%= Spree.t('admin.response_code') %></th>
|
46
|
+
<th><%= Spree.t('admin.execution_time') %></th>
|
47
|
+
<th><%= Spree.t('admin.errors') %></th>
|
48
|
+
<th></th>
|
49
|
+
</tr>
|
50
|
+
</thead>
|
51
|
+
<tbody>
|
52
|
+
<% if @events.any? %>
|
53
|
+
<%= render partial: 'spree/admin/webhook_events/webhook_event', collection: @events, cached: spree_base_cache_scope %>
|
54
|
+
<% else %>
|
34
55
|
<tr>
|
35
|
-
<
|
36
|
-
|
37
|
-
|
38
|
-
<th><%= Spree.t('admin.response_code') %></th>
|
39
|
-
<th><%= Spree.t('admin.execution_time') %></th>
|
40
|
-
<th><%= Spree.t('admin.errors') %></th>
|
41
|
-
<th></th>
|
56
|
+
<td colspan="7" class="text-center">
|
57
|
+
<%= render 'spree/admin/shared/no_resource_found', new_object_url: nil, model_class: Spree::Webhooks::Event %>
|
58
|
+
</td>
|
42
59
|
</tr>
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
</div>
|
50
|
-
<% else %>
|
51
|
-
<div class="text-center no-objects-found m-5">
|
52
|
-
<%= Spree.t('admin.webhooks_subscribers.no_events') %>
|
53
|
-
</div>
|
54
|
-
<% end %>
|
60
|
+
<% end %>
|
61
|
+
</tbody>
|
62
|
+
</table>
|
63
|
+
<%= render 'spree/admin/shared/index_table_options', collection: @events %>
|
64
|
+
</div>
|
65
|
+
|
data/config/importmap.rb
CHANGED
@@ -15,8 +15,8 @@ pin 'Chart.bundle', to: 'Chart.bundle.js', preload: ['application-spree-admin']
|
|
15
15
|
pin 'local-time', preload: ['application-spree-admin'] # @3.0.2
|
16
16
|
pin 'mapkick/bundle', to: 'mapkick.bundle.js', preload: ['application-spree-admin']
|
17
17
|
pin "jquery", to: 'jquery.min.js', preload: ['application-spree-admin'] # @3.7.1
|
18
|
-
pin 'bootstrap', to: 'bootstrap--dist--js--bootstrap.bundle.min.js.js', preload: ['application-spree-admin'] # @4.6.
|
19
|
-
pin 'dompurify', preload: ['application-spree-admin'] # @3.2.
|
18
|
+
pin 'bootstrap', to: 'bootstrap--dist--js--bootstrap.bundle.min.js.js', preload: ['application-spree-admin'] # @4.6.2
|
19
|
+
pin 'dompurify', preload: ['application-spree-admin'] # @3.2.5
|
20
20
|
|
21
21
|
# Stimulus components
|
22
22
|
pin '@stimulus-components/rails-nested-form', to: '@stimulus-components--rails-nested-form.js', preload: ['application-spree-admin'] # @5.0.0
|
data/lib/spree/admin/engine.rb
CHANGED
@@ -21,9 +21,13 @@ module Spree
|
|
21
21
|
:orders_filters_partials,
|
22
22
|
:store_form_partials,
|
23
23
|
:store_nav_partials,
|
24
|
+
:settings_nav_partials,
|
24
25
|
:store_settings_nav_partials,
|
25
26
|
:store_orders_nav_partials,
|
26
|
-
:store_products_nav_partials
|
27
|
+
:store_products_nav_partials,
|
28
|
+
:storefront_nav_partials,
|
29
|
+
:tax_nav_partials,
|
30
|
+
:user_dropdown_partials
|
27
31
|
)
|
28
32
|
|
29
33
|
# accessible via Rails.application.config.spree_admin
|
@@ -92,9 +96,13 @@ module Spree
|
|
92
96
|
Rails.application.config.spree_admin.orders_filters_partials = []
|
93
97
|
Rails.application.config.spree_admin.store_form_partials = []
|
94
98
|
Rails.application.config.spree_admin.store_nav_partials = []
|
99
|
+
Rails.application.config.spree_admin.settings_nav_partials = []
|
95
100
|
Rails.application.config.spree_admin.store_settings_nav_partials = []
|
96
101
|
Rails.application.config.spree_admin.store_orders_nav_partials = []
|
97
102
|
Rails.application.config.spree_admin.store_products_nav_partials = []
|
103
|
+
Rails.application.config.spree_admin.storefront_nav_partials = []
|
104
|
+
Rails.application.config.spree_admin.tax_nav_partials = []
|
105
|
+
Rails.application.config.spree_admin.user_dropdown_partials = []
|
98
106
|
end
|
99
107
|
end
|
100
108
|
end
|