spree_admin 5.0.2 → 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.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/spree/admin/dashboard_controller.rb +11 -12
  3. data/app/controllers/spree/admin/page_blocks_controller.rb +10 -2
  4. data/app/controllers/spree/admin/page_sections_controller.rb +13 -1
  5. data/app/controllers/spree/admin/webhooks_subscribers_controller.rb +32 -13
  6. data/app/helpers/spree/admin/base_helper.rb +1 -1
  7. data/app/helpers/spree/admin/navigation_helper.rb +1 -1
  8. data/app/helpers/spree/admin/orders_helper.rb +3 -1
  9. data/app/helpers/spree/admin/products_helper.rb +4 -0
  10. data/app/helpers/spree/admin/tags_helper.rb +1 -1
  11. data/app/javascript/spree/admin/application.js +0 -2
  12. data/app/javascript/spree/admin/controllers/asset_uploader_controller.js +3 -2
  13. data/app/javascript/spree/admin/controllers/variants_form_controller.js +22 -2
  14. data/app/javascript/spree/admin/helpers/trix/video_embed.js +2 -2
  15. data/app/views/spree/admin/dashboard/_top_products.html.erb +1 -1
  16. data/app/views/spree/admin/orders/_filters.html.erb +11 -1
  17. data/app/views/spree/admin/orders/_summary.html.erb +1 -1
  18. data/app/views/spree/admin/page_blocks/forms/_image.html.erb +9 -0
  19. data/app/views/spree/admin/page_builder/_sidebar_block.html.erb +10 -9
  20. data/app/views/spree/admin/page_builder/_sidebar_sections_toolbar.html.erb +152 -39
  21. data/app/views/spree/admin/payment_methods/_form.html.erb +1 -1
  22. data/app/views/spree/admin/products/form/_inventory.html.erb +1 -1
  23. data/app/views/spree/admin/products/form/_properties.html.erb +1 -1
  24. data/app/views/spree/admin/products/form/_variants.html.erb +1 -0
  25. data/app/views/spree/admin/shared/_head.html.erb +6 -1
  26. data/app/views/spree/admin/shared/_tax_nav.html.erb +1 -0
  27. data/app/views/spree/admin/shared/_user.html.erb +1 -1
  28. data/app/views/spree/admin/shared/sidebar/_store_nav.html.erb +3 -2
  29. data/app/views/spree/admin/shared/sidebar/_storefront_nav.html.erb +2 -0
  30. data/app/views/spree/admin/stores/form/_basic.html.erb +1 -1
  31. data/app/views/spree/admin/taxons/_form.html.erb +2 -2
  32. data/app/views/spree/admin/users/_form.html.erb +1 -1
  33. data/app/views/spree/admin/users/_user.html.erb +7 -6
  34. data/app/views/spree/admin/users/index.html.erb +6 -5
  35. data/app/views/spree/admin/variants/form/_media.html.erb +1 -0
  36. data/app/views/spree/admin/webhooks_subscribers/_form.html.erb +37 -19
  37. data/app/views/spree/admin/webhooks_subscribers/_webhooks_subscriber.html.erb +12 -6
  38. data/app/views/spree/admin/webhooks_subscribers/edit.html.erb +2 -2
  39. data/app/views/spree/admin/webhooks_subscribers/show.html.erb +58 -47
  40. data/config/importmap.rb +2 -2
  41. data/config/locales/en.yml +1 -1
  42. data/lib/spree/admin/engine.rb +9 -1
  43. data/vendor/javascript/bootstrap--dist--js--bootstrap.bundle.min.js.js +4 -4
  44. data/vendor/javascript/dompurify.js +24 -24
  45. metadata +8 -9
  46. data/app/javascript/spree/admin/controllers/webhook_subscriber_events_controller.js +0 -19
@@ -1,64 +1,177 @@
1
1
  <%= turbo_frame_tag :page_sidebar_toolbar do %>
2
2
  <div class="d-none">
3
- <% @page_preview.sections.includes(:blocks).each do |section| %>
3
+ <% sections =
4
+ @page_preview.sections.includes(:blocks).map { |s| [@page_preview, s] } %>
5
+
6
+ <% sections +=
7
+ @theme_preview.sections.includes(:blocks).map { |s| [@theme_preview, s] } %>
8
+
9
+ <% sections.each do |parent, section| %>
4
10
  <% next if section.new_record? %>
5
11
 
6
- <div id="editor-toolbar-section-<%= section.id %>">
7
- <button class="editor-toolbar-lower">
8
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-down" viewBox="0 0 16 16">
9
- <path fill-rule="evenodd" d="M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1z"/>
10
- </svg>
11
- </button>
12
- <button class="editor-toolbar-higher">
13
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-up" viewBox="0 0 16 16">
14
- <path fill-rule="evenodd" d="M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5z"/>
15
- </svg>
16
- </button>
17
- <button class="editor-toolbar-edit">
18
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil" viewBox="0 0 16 16">
19
- <path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"/>
20
- </svg>
21
- </button>
22
- <button class="editor-toolbar-delete">
23
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16">
24
- <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6Z"/>
25
- <path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1ZM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118ZM2.5 3h11V2h-11v1Z"/>
26
- </svg>
27
- </button>
28
- </div>
12
+ <% unless parent.is_a?(Spree::Theme) %>
13
+ <div id="editor-toolbar-section-<%= section.id %>">
14
+ <button class="editor-toolbar-lower">
15
+ <svg
16
+ xmlns="http://www.w3.org/2000/svg"
17
+ width="16"
18
+ height="16"
19
+ fill="currentColor"
20
+ class="bi bi-arrow-down"
21
+ viewBox="0 0 16 16"
22
+ >
23
+ <path
24
+ fill-rule="evenodd"
25
+ d="M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1z"
26
+ />
27
+ </svg>
28
+ </button>
29
+ <button class="editor-toolbar-higher">
30
+ <svg
31
+ xmlns="http://www.w3.org/2000/svg"
32
+ width="16"
33
+ height="16"
34
+ fill="currentColor"
35
+ class="bi bi-arrow-up"
36
+ viewBox="0 0 16 16"
37
+ >
38
+ <path
39
+ fill-rule="evenodd"
40
+ d="M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5z"
41
+ />
42
+ </svg>
43
+ </button>
44
+ <button class="editor-toolbar-edit">
45
+ <svg
46
+ xmlns="http://www.w3.org/2000/svg"
47
+ width="16"
48
+ height="16"
49
+ fill="currentColor"
50
+ class="bi bi-pencil"
51
+ viewBox="0 0 16 16"
52
+ >
53
+ <path
54
+ d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"
55
+ />
56
+ </svg>
57
+ </button>
58
+ <button class="editor-toolbar-delete">
59
+ <svg
60
+ xmlns="http://www.w3.org/2000/svg"
61
+ width="16"
62
+ height="16"
63
+ fill="currentColor"
64
+ class="bi bi-trash"
65
+ viewBox="0 0 16 16"
66
+ >
67
+ <path
68
+ d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6Z"
69
+ />
70
+ <path
71
+ d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1ZM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118ZM2.5 3h11V2h-11v1Z"
72
+ />
73
+ </svg>
74
+ </button>
75
+ </div>
29
76
 
30
- <%= button_to Spree.t(:move_up), spree.move_higher_admin_page_section_path(@page_preview, section), method: :patch, id: "editor-toolbar-higher-section-#{section.id}" %>
31
- <%= button_to Spree.t(:move_down), spree.move_lower_admin_page_section_path(@page_preview, section), method: :patch, id: "editor-toolbar-lower-section-#{section.id}" %>
32
- <%= link_to Spree.t(:destroy), spree.admin_page_section_path(section), data: { turbo_confirm: Spree.t(:are_you_sure), turbo_method: :delete }, id: "editor-toolbar-delete-section-#{section.id}" %>
77
+ <%= button_to Spree.t(:move_up),
78
+ spree.move_higher_admin_page_section_path(parent, section),
79
+ method: :patch,
80
+ id: "editor-toolbar-higher-section-#{section.id}" %>
81
+ <%= button_to Spree.t(:move_down),
82
+ spree.move_lower_admin_page_section_path(parent, section),
83
+ method: :patch,
84
+ id: "editor-toolbar-lower-section-#{section.id}" %>
85
+ <%= link_to Spree.t(:destroy),
86
+ spree.admin_page_section_path(section),
87
+ data: {
88
+ turbo_confirm: Spree.t(:are_you_sure),
89
+ turbo_method: :delete,
90
+ },
91
+ id: "editor-toolbar-delete-section-#{section.id}" %>
92
+
93
+ <% end %>
33
94
 
34
95
  <% section.blocks.each do |block| %>
35
96
  <div id="editor-toolbar-block-<%= block.id %>">
36
97
  <button class="editor-toolbar-lower">
37
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-down" viewBox="0 0 16 16">
38
- <path fill-rule="evenodd" d="M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1z"/>
98
+ <svg
99
+ xmlns="http://www.w3.org/2000/svg"
100
+ width="16"
101
+ height="16"
102
+ fill="currentColor"
103
+ class="bi bi-arrow-down"
104
+ viewBox="0 0 16 16"
105
+ >
106
+ <path
107
+ fill-rule="evenodd"
108
+ d="M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1z"
109
+ />
39
110
  </svg>
40
111
  </button>
41
112
  <button class="editor-toolbar-higher">
42
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-up" viewBox="0 0 16 16">
43
- <path fill-rule="evenodd" d="M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5z"/>
113
+ <svg
114
+ xmlns="http://www.w3.org/2000/svg"
115
+ width="16"
116
+ height="16"
117
+ fill="currentColor"
118
+ class="bi bi-arrow-up"
119
+ viewBox="0 0 16 16"
120
+ >
121
+ <path
122
+ fill-rule="evenodd"
123
+ d="M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5z"
124
+ />
44
125
  </svg>
45
126
  </button>
46
127
  <button class="editor-toolbar-edit">
47
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil" viewBox="0 0 16 16">
48
- <path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"/>
128
+ <svg
129
+ xmlns="http://www.w3.org/2000/svg"
130
+ width="16"
131
+ height="16"
132
+ fill="currentColor"
133
+ class="bi bi-pencil"
134
+ viewBox="0 0 16 16"
135
+ >
136
+ <path
137
+ d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"
138
+ />
49
139
  </svg>
50
140
  </button>
51
141
  <button class="editor-toolbar-delete">
52
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16">
53
- <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6Z"/>
54
- <path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1ZM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118ZM2.5 3h11V2h-11v1Z"/>
142
+ <svg
143
+ xmlns="http://www.w3.org/2000/svg"
144
+ width="16"
145
+ height="16"
146
+ fill="currentColor"
147
+ class="bi bi-trash"
148
+ viewBox="0 0 16 16"
149
+ >
150
+ <path
151
+ d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6Z"
152
+ />
153
+ <path
154
+ d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1ZM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118ZM2.5 3h11V2h-11v1Z"
155
+ />
55
156
  </svg>
56
157
  </button>
57
158
  </div>
58
159
 
59
- <%= button_to Spree.t(:move_up), spree.move_higher_admin_page_section_block_path(section, block), method: :patch, id: "editor-toolbar-higher-block-#{block.id}" %>
60
- <%= button_to Spree.t(:move_down), spree.move_lower_admin_page_section_block_path(section, block), method: :patch, id: "editor-toolbar-lower-block-#{block.id}" %>
61
- <%= link_to Spree.t(:destroy), spree.admin_page_section_block_path(section, block), data: { turbo_confirm: Spree.t(:are_you_sure), turbo_method: :delete }, id: "editor-toolbar-delete-block-#{block.id}" %>
160
+ <%= button_to Spree.t(:move_up),
161
+ spree.move_higher_admin_page_section_block_path(section, block),
162
+ method: :patch,
163
+ id: "editor-toolbar-higher-block-#{block.id}" %>
164
+ <%= button_to Spree.t(:move_down),
165
+ spree.move_lower_admin_page_section_block_path(section, block),
166
+ method: :patch,
167
+ id: "editor-toolbar-lower-block-#{block.id}" %>
168
+ <%= link_to Spree.t(:destroy),
169
+ spree.admin_page_section_block_path(section, block),
170
+ data: {
171
+ turbo_confirm: Spree.t(:are_you_sure),
172
+ turbo_method: :delete,
173
+ },
174
+ id: "editor-toolbar-delete-block-#{block.id}" %>
62
175
  <% end %>
63
176
  <% end %>
64
177
  </div>
@@ -55,7 +55,7 @@
55
55
  </div>
56
56
  <div class="form-group">
57
57
  <%= label_tag :payment_method_auto_capture, Spree.t(:auto_capture) %>
58
- <%= select(:payment_method, :auto_capture, [["#{Spree.t(:use_app_default)} (#{Spree::Config[:auto_capture]})", ''], [Spree.t(:say_yes), true], [Spree.t(:say_no), false]], {}, {class: 'custom-select'}) %>
58
+ <%= select(:payment_method, :auto_capture, [["#{Spree.t(:use_app_default)} (#{Spree::Config[:auto_capture]})", ''], [Spree.t(:say_yes).to_s, true], [Spree.t(:say_no).to_s, false]], {}, {class: 'custom-select'}) %>
59
59
  </div>
60
60
 
61
61
  <div class="form-group">
@@ -1,4 +1,4 @@
1
- <div class="card mb-4">
1
+ <div class="inventory-form card mb-4">
2
2
  <div class="card-header d-flex align-items-center justify-content-between">
3
3
  <h5 class="card-title"><%= Spree.t(:inventory) %></h5>
4
4
 
@@ -15,7 +15,7 @@
15
15
  </tr>
16
16
  </thead>
17
17
  <tbody>
18
- <%= f.fields_for :product_properties do |product_property_form| %>
18
+ <%= f.fields_for :product_properties, sorted_product_properties(f.object) do |product_property_form| %>
19
19
  <% property = product_property_form.object.property %>
20
20
  <%= product_property_form.hidden_field :id %>
21
21
  <%= product_property_form.hidden_field :property_id %>
@@ -15,6 +15,7 @@
15
15
  data-variants-form-currencies-value="<%= supported_currencies.map(&:to_s).to_json %>"
16
16
  data-variants-form-current-stock-location-id-value="<%= default_stock_location_for_product(@product).id %>"
17
17
  data-variants-form-stock-locations-value="<%= available_stock_locations_for_product(@product).ids.map(&:to_s).to_json %>"
18
+ data-variants-form-admin-path-value="<%= spree.admin_path %>"
18
19
  <% if @product_options.present? %> data-variants-form-options-value="<%= @product_options.to_json %>" <% end %>
19
20
  <% if @product_available_options.present? %> data-variants-form-available-options-value="<%= @product_available_options.to_json %>" <% end %>
20
21
  <% if @product_stock.present? %> data-variants-form-stock-value="<%= @product_stock.to_json %>" <% end %>
@@ -51,4 +51,9 @@
51
51
 
52
52
  <%= render 'spree/shared/google_places_api_loader' %>
53
53
 
54
- <%= render_admin_partials(:head_partials) %>
54
+ <%= render_admin_partials(:head_partials) %>
55
+
56
+ <script>
57
+ window.Spree = window.Spree || {}
58
+ Spree.adminPath = '<%= spree.admin_path %>'
59
+ </script>
@@ -1,4 +1,5 @@
1
1
  <%= content_for(:page_tabs) do %>
2
2
  <%= nav_item(Spree.t(:tax_rates), spree.admin_tax_rates_path) if can?(:manage, Spree::TaxRate) %>
3
3
  <%= nav_item(Spree.t(:tax_categories), spree.admin_tax_categories_path) if can?(:manage, Spree::TaxCategory) %>
4
+ <%= render_admin_partials(:tax_nav_partials) %>
4
5
  <% end %>
@@ -1,4 +1,4 @@
1
- <%= link_to spree.admin_user_path(user), class: 'rounded hover-light p-2 d-flex justify-content-start align-items-center', data: {turbo_frame: :_top} do %>
1
+ <%= link_to spree.admin_user_path(user), class: 'rounded hover-light p-2 d-flex justify-content-start align-items-center', data: {turbo_frame: :_top, row_link_target: :link} do %>
2
2
  <% if user.name.present? %>
3
3
  <%= render_avatar(user, width: 48, height: 48, class: 'mr-3 avatar') %>
4
4
  <% else %>
@@ -17,6 +17,7 @@
17
17
  <%= nav_item(Spree.t(:emails), spree.edit_admin_store_path(section: 'emails'), icon: 'send', active: params[:section] == 'emails') %>
18
18
  <%= nav_item(Spree.t(:policies), spree.edit_admin_store_path(section: 'policies'), icon: 'list-check', active: params[:section] == 'policies') %>
19
19
  <%= nav_item(Spree.t(:checkout), spree.edit_admin_store_path(section: 'checkout'), icon: 'shopping-cart', active: params[:section] == 'checkout') %>
20
+ <%= render_admin_partials(:store_settings_nav_partials) %>
20
21
  <% end %>
21
22
 
22
23
  <% if can?(:manage, Spree::CustomDomain) %>
@@ -48,7 +49,7 @@
48
49
  <% end %>
49
50
 
50
51
  <% if can?(:manage, Spree::Store) %>
51
- <% if enterprise_edition? %>
52
+ <% if spree.respond_to?(:admin_audits_path) %>
52
53
  <%= nav_item(Spree.t('admin.audit_log'), spree.admin_audits_path, icon: 'history', active: %w[audits exports imports].include?(controller_name)) %>
53
54
  <% else %>
54
55
  <li class="nav-item">
@@ -66,7 +67,7 @@
66
67
  <%= nav_item(Spree.t(:developers), spree.admin_oauth_applications_path, icon: 'terminal', active: %w[oauth_applications webhooks_subscribers].include?(controller_name)) %>
67
68
  <% end %>
68
69
 
69
- <%= render_admin_partials(:store_settings_nav_partials) %>
70
+ <%= render_admin_partials(:settings_nav_partials) %>
70
71
  </ul>
71
72
  <% else %>
72
73
  <%= render 'spree/admin/shared/sidebar/store_dropdown' %>
@@ -17,6 +17,8 @@
17
17
  <% if can?(:manage, current_store) %>
18
18
  <%= nav_item(Spree.t(:settings), spree.edit_admin_storefront_path) %>
19
19
  <% end %>
20
+
21
+ <%= render_admin_partials(:storefront_nav_partials) %>
20
22
  </ul>
21
23
  <% end %>
22
24
  <% end %>
@@ -157,4 +157,4 @@
157
157
  </div>
158
158
  </div>
159
159
 
160
- <%= render_admin_partials(:store_form_partials, f: f) %>
160
+ <%= render_admin_partials(:store_form_partials, f: f, store: @store) %>
@@ -44,7 +44,7 @@
44
44
  </div>
45
45
  </div>
46
46
  <div class="card-body border-top pt-4 d-none" data-reveal-target="item">
47
- <h6><%= Spree.t(:conditions) %></h6>
47
+ <h6><%= Spree.t(:rules) %></h6>
48
48
  <%= render 'spree/admin/taxons/rules_form', f: f %>
49
49
  </div>
50
50
  </div>
@@ -52,7 +52,7 @@
52
52
  <% if @taxon.automatic? %>
53
53
  <div class="card mb-4">
54
54
  <div class="card-header">
55
- <h5 class="card-title"><%= Spree.t(:conditions) %></h5>
55
+ <h5 class="card-title"><%= Spree.t(:rules) %></h5>
56
56
  </div>
57
57
  <div class="card-body">
58
58
  <div class="alert alert-info mb-3"><%= Spree.t('admin.taxon_types.automatic_info') %></div>
@@ -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?, required: true %>
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">
@@ -1,17 +1,18 @@
1
- <tr id="<%= spree_dom_id user %>">
1
+ <tr id="<%= spree_dom_id user %>" data-controller="row-link">
2
2
  <td class="pr-0 w-5">
3
3
  <%= bulk_operations_checkbox(user) %>
4
4
  </td>
5
- <td class='user_name w-50 no-wrap py-0 pl-1 pr-0'>
5
+ <td class='w-50 no-wrap py-0 pl-1 pr-0'>
6
6
  <%= render 'spree/admin/shared/user', user: user %>
7
7
  </td>
8
- <td class="no-wrap">
8
+ <td class="cursor-pointer" data-action="click->row-link#openLink">
9
9
  <%= active_badge(user.accepts_email_marketing?) %>
10
10
  </td>
11
- <td class="w-25 no-wrap">
11
+ <td class="w-25 cursor-pointer" data-action="click->row-link#openLink">
12
12
  <%= customer_location_flag(user) %>
13
13
  <%= customer_location(user) %>
14
14
  </td>
15
- <td class='user_num_orders w-10 no-wrap'><%= user.completed_orders_for_store(current_store).count %></td>
16
- <td class='user_amount_spent w-10 no-wrap'><%= user.display_amount_spent_in(current_currency) %></td>
15
+ <td class='w-10 no-wrap cursor-pointer' data-action="click->row-link#openLink"><%= user.completed_orders_for_store(current_store).count %></td>
16
+ <td class='w-10 no-wrap cursor-pointer' data-action="click->row-link#openLink"><%= user.display_amount_spent_in(current_currency) %></td>
17
+ <td class='w-10 no-wrap cursor-pointer' data-action="click->row-link#openLink"><%= local_time(user.created_at) %></td>
17
18
  </tr>
@@ -3,15 +3,15 @@
3
3
  <% end %>
4
4
 
5
5
  <% content_for :page_actions do %>
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 mr-2 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
- <%= icon 'table-export', class: 'mr-2' %>
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
+ <%= icon 'table-export' %>
8
8
  <%= Spree.t(:export) %>
9
- <% end if can?(:export, Spree::Export) %>
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 if can? :create, Spree::user_class %>
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" %>
@@ -53,6 +53,7 @@
53
53
  <th><%= Spree.t(:location) %></th>
54
54
  <th><%= Spree.t('admin.num_orders') %></th>
55
55
  <th><%= Spree.t('admin.amount_spent') %></th>
56
+ <th><%= sort_link @search, :created_at, Spree.t(:created_at) %></th>
56
57
  </tr>
57
58
  </thead>
58
59
  <tbody>
@@ -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="webhooks-subscriber-events">
33
+ <div class="card-body" data-controller="reveal">
34
34
  <div class="form-group">
35
35
  <div>
36
- <div class="radio my-2">
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' => 'webhooks-subscriber-events#hideCheckboxes',
41
- 'data-webhooks-subscriber-events-target' => 'subscribeToAll',
42
- class: 'events' } %>
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="radio my-2">
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' => 'webhooks-subscriber-events#showCheckboxes',
49
- class: 'events' } %>
50
- <%= label_tag :subscribe_to_all_events_false, Spree.t('admin.webhooks_subscribers.select_events') %>
51
- </div>
52
- </div>
53
- <br/>
54
- <div data-webhooks-subscriber-events-target="eventsCheckboxesContainer" class="<%= subscribe_to_all_events? ? 'd-none' : '' %>">
55
- <div class="row" >
56
- <% Spree::Webhooks::Subscriber.supported_events.each_with_index do |se, index| %>
57
- <% record, _ = se %>
58
- <%= event_checkbox_for(record, f) %>
59
- <% end %>
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-20" data-action="click->row-link#openLink">
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"><%= local_time(webhooks_subscriber.latest_event_at) %></td>
12
- <td class="actions">
13
- <%= link_to_with_icon 'eye', Spree.t(:view), admin_webhooks_subscriber_path(webhooks_subscriber), class: "btn btn-light btn-sm", data: { row_link_target: 'link' } %>
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.admin_webhooks_subscribers_path %>
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 %>