spree_backend 4.3.0 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (263) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +222 -0
  3. data/.codeclimate.yml +36 -0
  4. data/.editorconfig +22 -0
  5. data/.eslintignore +7 -0
  6. data/.eslintrc.cjs +29 -0
  7. data/.gem_release.yml +4 -0
  8. data/.github/CONTRIBUTING.md +1 -0
  9. data/.github/ISSUE_TEMPLATE/bug_report.md +47 -0
  10. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  11. data/.github/ISSUE_TEMPLATE.md +39 -0
  12. data/.github/dependabot.yml +7 -0
  13. data/.github/workflows/spelling_lint.yml +34 -0
  14. data/.gitignore +64 -0
  15. data/.rubocop.yml +197 -0
  16. data/.solargraph.yml +20 -0
  17. data/.stylelintignore +4 -0
  18. data/.stylelintrc +6 -0
  19. data/CODE_OF_CONDUCT.md +22 -0
  20. data/Gemfile +59 -3
  21. data/README.md +123 -0
  22. data/SECURITY.md +1 -0
  23. data/app/assets/config/spree_backend_manifest.js +1 -1
  24. data/app/assets/images/backend-cloud-arrow-up.svg +4 -0
  25. data/app/assets/images/backend-eye-open.svg +1 -1
  26. data/app/assets/images/backend-file-earmark-font.svg +4 -0
  27. data/app/assets/images/backend-file-earmark-image.svg +4 -0
  28. data/app/assets/images/backend-file-earmark-music.svg +4 -0
  29. data/app/assets/images/backend-file-earmark-pdf.svg +4 -0
  30. data/app/assets/images/backend-file-earmark-play.svg +4 -0
  31. data/app/assets/images/backend-file-earmark-spreadsheet.svg +3 -0
  32. data/app/assets/images/backend-file-earmark-zip.svg +4 -0
  33. data/app/assets/images/backend-file-earmark.svg +3 -0
  34. data/app/assets/images/backend-hdd.svg +4 -0
  35. data/app/assets/images/backend-link.svg +4 -0
  36. data/app/assets/images/backend-view.svg +1 -1
  37. data/app/assets/javascripts/spree/backend/address_states.es6 +2 -0
  38. data/app/assets/javascripts/spree/backend/adjustments.js +5 -5
  39. data/app/assets/javascripts/spree/backend/admin.js +4 -6
  40. data/app/assets/javascripts/spree/backend/calculator.js +1 -1
  41. data/app/assets/javascripts/spree/backend/checkouts/edit.js +1 -1
  42. data/app/assets/javascripts/spree/backend/cms/links.es6 +1 -1
  43. data/app/assets/javascripts/spree/backend/cms/live_preview.es6 +1 -1
  44. data/app/assets/javascripts/spree/backend/cms/page.es6 +22 -40
  45. data/app/assets/javascripts/spree/backend/cms/section.es6 +1 -1
  46. data/app/assets/javascripts/spree/backend/gateway.js +1 -1
  47. data/app/assets/javascripts/spree/backend/general_settings.js +1 -1
  48. data/app/assets/javascripts/spree/backend/global/_index.js +3 -1
  49. data/app/assets/javascripts/spree/backend/global/alerts.es6 +1 -1
  50. data/app/assets/javascripts/spree/backend/global/animate_css.es6 +19 -0
  51. data/app/assets/javascripts/spree/backend/global/fetch_request_utility.es6 +114 -0
  52. data/app/assets/javascripts/spree/backend/global/flatpickr.es6 +8 -1
  53. data/app/assets/javascripts/spree/backend/global/info_alert.es6 +1 -1
  54. data/app/assets/javascripts/spree/backend/global/radio_panel_toggle.es6 +1 -1
  55. data/app/assets/javascripts/spree/backend/global/ransack.es6 +7 -5
  56. data/app/assets/javascripts/spree/backend/global/responsive_menus.es6 +1 -1
  57. data/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6 +11 -4
  58. data/app/assets/javascripts/spree/backend/global/select2_populate.es6 +2 -2
  59. data/app/assets/javascripts/spree/backend/global/side_scroll_indication.es6 +2 -2
  60. data/app/assets/javascripts/spree/backend/global/sortable.es6 +1 -1
  61. data/app/assets/javascripts/spree/backend/global/tinymce.es6 +3 -2
  62. data/app/assets/javascripts/spree/backend/line_items.js +7 -9
  63. data/app/assets/javascripts/spree/backend/line_items_on_order_edit.js +23 -28
  64. data/app/assets/javascripts/spree/backend/menus/_index.es6 +0 -1
  65. data/app/assets/javascripts/spree/backend/menus/menu_item.es6 +1 -1
  66. data/app/assets/javascripts/spree/backend/multi_currency.js +2 -2
  67. data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +1 -1
  68. data/app/assets/javascripts/spree/backend/orders/edit.js +1 -1
  69. data/app/assets/javascripts/spree/backend/payments/edit.js +32 -22
  70. data/app/assets/javascripts/spree/backend/payments/new.js +1 -1
  71. data/app/assets/javascripts/spree/backend/product_picker.js +16 -25
  72. data/app/assets/javascripts/spree/backend/progress.js +5 -3
  73. data/app/assets/javascripts/spree/backend/promotions.js +3 -1
  74. data/app/assets/javascripts/spree/backend/returns/expedited_exchanges_warning.js +1 -1
  75. data/app/assets/javascripts/spree/backend/returns/return_item_selection.js +1 -1
  76. data/app/assets/javascripts/spree/backend/shipments.js +80 -79
  77. data/app/assets/javascripts/spree/backend/spree-select2.js +8 -1
  78. data/app/assets/javascripts/spree/backend/states.js +1 -1
  79. data/app/assets/javascripts/spree/backend/stock_location.js +1 -1
  80. data/app/assets/javascripts/spree/backend/stock_management.js +1 -1
  81. data/app/assets/javascripts/spree/backend/stock_movement.js +58 -13
  82. data/app/assets/javascripts/spree/backend/stock_transfer.js +62 -32
  83. data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +9 -8
  84. data/app/assets/javascripts/spree/backend/taxons.js +17 -14
  85. data/app/assets/javascripts/spree/backend/user_picker.js +1 -1
  86. data/app/assets/javascripts/spree/backend/users/edit.js +1 -1
  87. data/app/assets/javascripts/spree/backend/variant_autocomplete.js +19 -11
  88. data/app/assets/javascripts/spree/backend/variant_management.js +1 -1
  89. data/app/assets/javascripts/spree/backend/zone.js +1 -1
  90. data/app/assets/javascripts/spree/backend.js +13 -33
  91. data/app/assets/javascripts/spree.js +2 -9
  92. data/app/assets/stylesheets/spree/backend/components/_main.scss +8 -0
  93. data/app/assets/stylesheets/spree/backend/plugins/_nav_x.scss +1 -1
  94. data/app/assets/stylesheets/spree/backend/plugins/_select2_custom.scss +1 -1
  95. data/app/assets/stylesheets/spree/backend/shared/_forms.scss +1 -1
  96. data/app/assets/stylesheets/spree/backend/shared/_sortable_tree.scss +62 -0
  97. data/app/assets/stylesheets/spree/backend/spree_admin.css.scss +3 -0
  98. data/app/assets/stylesheets/spree/backend/views/_digitals.scss +33 -0
  99. data/app/assets/stylesheets/spree/backend/views/{prototypes.scss → _prototypes.scss} +0 -0
  100. data/app/assets/stylesheets/spree/backend/views/_taxonomies.scss +3 -0
  101. data/app/controllers/spree/admin/base_controller.rb +4 -13
  102. data/app/controllers/spree/admin/digitals_controller.rb +33 -0
  103. data/app/controllers/spree/admin/general_settings_controller.rb +0 -5
  104. data/app/controllers/spree/admin/images_controller.rb +1 -1
  105. data/app/controllers/spree/admin/oauth_applications_controller.rb +17 -0
  106. data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -2
  107. data/app/controllers/spree/admin/orders_controller.rb +10 -2
  108. data/app/controllers/spree/admin/payment_methods_controller.rb +2 -2
  109. data/app/controllers/spree/admin/payments_controller.rb +1 -1
  110. data/app/controllers/spree/admin/products_controller.rb +4 -2
  111. data/app/controllers/spree/admin/promotions_controller.rb +1 -1
  112. data/app/controllers/spree/admin/properties_controller.rb +1 -1
  113. data/app/controllers/spree/admin/resource_controller.rb +9 -4
  114. data/app/controllers/spree/admin/return_index_controller.rb +3 -4
  115. data/app/controllers/spree/admin/stock_transfers_controller.rb +2 -2
  116. data/app/controllers/spree/admin/store_credits_controller.rb +2 -2
  117. data/app/controllers/spree/admin/stores_controller.rb +2 -2
  118. data/app/controllers/spree/admin/taxons_controller.rb +23 -38
  119. data/app/controllers/spree/admin/users_controller.rb +6 -19
  120. data/app/controllers/spree/admin/variants_controller.rb +1 -2
  121. data/app/controllers/spree/admin/webhooks_subscribers_controller.rb +48 -0
  122. data/app/helpers/spree/admin/base_helper.rb +27 -9
  123. data/app/helpers/spree/admin/digital_helper.rb +28 -0
  124. data/app/helpers/spree/admin/menu_helper.rb +0 -21
  125. data/app/helpers/spree/admin/navigation_helper.rb +19 -9
  126. data/app/helpers/spree/admin/sortable_tree_helper.rb +31 -0
  127. data/app/helpers/spree/admin/stores_helper.rb +1 -1
  128. data/app/helpers/spree/admin/webhooks_subscribers_helper.rb +31 -0
  129. data/app/javascript/spree/dashboard/controllers/clipboard_controller.js +12 -0
  130. data/app/javascript/spree/dashboard/controllers/password_toggle_controller.js +14 -0
  131. data/app/javascript/spree/dashboard/controllers/sortable_tree_controller.js +55 -0
  132. data/app/javascript/spree/dashboard/controllers/spree_controller.js +25 -0
  133. data/app/javascript/spree/dashboard/controllers/upload_button_controller.js +13 -0
  134. data/app/javascript/spree/dashboard/controllers/webhooks_subscriber_events_controller.js +19 -0
  135. data/app/javascript/spree/dashboard/index.js +49 -0
  136. data/app/{assets/javascripts/spree/backend/global/bootstrap.es6 → javascript/spree/dashboard/utilities/bootstrap.js} +6 -2
  137. data/app/javascript/spree/dashboard/utilities/request_utility.js +54 -0
  138. data/app/models/spree/backend_configuration.rb +11 -0
  139. data/app/views/spree/admin/adjustments/_form.html.erb +2 -2
  140. data/app/views/spree/admin/adjustments/index.html.erb +1 -0
  141. data/app/views/spree/admin/cms_pages/_form.html.erb +8 -8
  142. data/app/views/spree/admin/cms_pages/edit.html.erb +1 -6
  143. data/app/views/spree/admin/cms_sections/_form.html.erb +2 -2
  144. data/app/views/spree/admin/cms_sections/types/_featured_article.html.erb +6 -6
  145. data/app/views/spree/admin/cms_sections/types/_hero_image.html.erb +6 -6
  146. data/app/views/spree/admin/cms_sections/types/_image_gallery.html.erb +12 -12
  147. data/app/views/spree/admin/cms_sections/types/_rich_text_content.html.erb +1 -1
  148. data/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb +12 -12
  149. data/app/views/spree/admin/countries/_form.html.erb +4 -4
  150. data/app/views/spree/admin/customer_returns/new.html.erb +1 -1
  151. data/app/views/spree/admin/digitals/_form.html.erb +35 -0
  152. data/app/views/spree/admin/digitals/index.html.erb +25 -0
  153. data/app/views/spree/admin/general_settings/edit.html.erb +1 -22
  154. data/app/views/spree/admin/menu_items/_form.html.erb +6 -6
  155. data/app/views/spree/admin/menus/_form.html.erb +3 -3
  156. data/app/views/spree/admin/menus/edit.html.erb +18 -18
  157. data/app/views/spree/admin/oauth_applications/_form.html.erb +22 -0
  158. data/app/views/spree/admin/oauth_applications/create.turbo_stream.erb +38 -0
  159. data/app/views/spree/admin/oauth_applications/edit.html.erb +13 -0
  160. data/app/views/spree/admin/oauth_applications/index.html.erb +51 -0
  161. data/app/views/spree/admin/oauth_applications/new.html.erb +15 -0
  162. data/app/views/spree/admin/option_types/_form.html.erb +3 -3
  163. data/app/views/spree/admin/option_types/_option_value_fields.html.erb +2 -2
  164. data/app/views/spree/admin/orders/_channel_form.html.erb +1 -1
  165. data/app/views/spree/admin/orders/_form.html.erb +1 -0
  166. data/app/views/spree/admin/orders/_line_items_edit_form.html.erb +1 -0
  167. data/app/views/spree/admin/orders/_order_actions.html.erb +6 -0
  168. data/app/views/spree/admin/orders/_search.html.erb +151 -0
  169. data/app/views/spree/admin/orders/index.html.erb +2 -151
  170. data/app/views/spree/admin/payment_methods/_form.html.erb +2 -2
  171. data/app/views/spree/admin/payments/_list.html.erb +1 -1
  172. data/app/views/spree/admin/products/_form.html.erb +19 -20
  173. data/app/views/spree/admin/products/index.html.erb +2 -1
  174. data/app/views/spree/admin/products/new.html.erb +6 -6
  175. data/app/views/spree/admin/promotion_actions/create.js.erb +1 -1
  176. data/app/views/spree/admin/promotion_categories/_form.html.erb +2 -2
  177. data/app/views/spree/admin/promotions/_form.html.erb +5 -5
  178. data/app/views/spree/admin/properties/_form.html.erb +3 -3
  179. data/app/views/spree/admin/prototypes/_form.html.erb +4 -4
  180. data/app/views/spree/admin/refunds/new.html.erb +2 -2
  181. data/app/views/spree/admin/reimbursement_types/_form.html.erb +2 -2
  182. data/app/views/spree/admin/return_authorizations/_form.html.erb +3 -3
  183. data/app/views/spree/admin/roles/_form.html.erb +1 -1
  184. data/app/views/spree/admin/shared/_account_nav.html.erb +1 -1
  185. data/app/views/spree/admin/shared/_address_form.html.erb +4 -4
  186. data/app/views/spree/admin/shared/_head.html.erb +4 -8
  187. data/app/views/spree/admin/shared/_main_menu.html.erb +12 -0
  188. data/app/views/spree/admin/shared/_new_resource_links.html.erb +1 -1
  189. data/app/views/spree/admin/shared/_product_tabs.html.erb +8 -0
  190. data/app/views/spree/admin/shared/_version.html.erb +1 -1
  191. data/app/views/spree/admin/shared/cms/_spree_product.html.erb +2 -2
  192. data/app/views/spree/admin/shared/cms/_spree_taxon.html.erb +2 -2
  193. data/app/views/spree/admin/shared/linkables/_spree_cms_page.erb +2 -2
  194. data/app/views/spree/admin/shared/linkables/_spree_product.html.erb +2 -2
  195. data/app/views/spree/admin/shared/linkables/_spree_taxon.html.erb +2 -2
  196. data/app/views/spree/admin/shared/linkables/_url.html.erb +1 -1
  197. data/app/views/spree/admin/shared/named_types/_form.html.erb +1 -1
  198. data/app/views/spree/admin/{menus/nested_menu_items/_item_bar.html.erb → shared/sortable_tree/_menu.html.erb} +10 -7
  199. data/app/views/spree/admin/shared/sortable_tree/_taxonomy.html.erb +34 -0
  200. data/app/views/spree/admin/shared/sub_menu/_apps.html.erb +3 -0
  201. data/app/views/spree/admin/shared/sub_menu/_integrations.html.erb +3 -0
  202. data/app/views/spree/admin/shipping_categories/_form.html.erb +1 -1
  203. data/app/views/spree/admin/shipping_methods/_form.html.erb +8 -8
  204. data/app/views/spree/admin/states/_form.html.erb +2 -2
  205. data/app/views/spree/admin/stock_locations/_form.html.erb +2 -2
  206. data/app/views/spree/admin/stock_movements/_form.html.erb +3 -3
  207. data/app/views/spree/admin/store_credit_categories/_form.html.erb +1 -1
  208. data/app/views/spree/admin/store_credits/_form.html.erb +4 -4
  209. data/app/views/spree/admin/stores/_form.html.erb +280 -227
  210. data/app/views/spree/admin/tax_categories/_form.html.erb +4 -4
  211. data/app/views/spree/admin/tax_rates/_form.html.erb +4 -3
  212. data/app/views/spree/admin/taxonomies/_form.html.erb +2 -2
  213. data/app/views/spree/admin/taxonomies/edit.html.erb +34 -29
  214. data/app/views/spree/admin/taxons/_form.html.erb +101 -57
  215. data/app/views/spree/admin/taxons/edit.html.erb +6 -3
  216. data/app/views/spree/admin/taxons/index.html.erb +1 -1
  217. data/app/views/spree/admin/taxons/new.html.erb +16 -0
  218. data/app/views/spree/admin/users/_form.html.erb +3 -3
  219. data/app/views/spree/admin/users/edit.html.erb +0 -40
  220. data/app/views/spree/admin/variants/_autocomplete.js.erb +5 -5
  221. data/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb +2 -2
  222. data/app/views/spree/admin/variants/_autocomplete_stock.js.erb +6 -6
  223. data/app/views/spree/admin/variants/_split.js.erb +1 -1
  224. data/app/views/spree/admin/variants/index.html.erb +4 -1
  225. data/app/views/spree/admin/webhooks_subscribers/_form.html.erb +101 -0
  226. data/app/views/spree/admin/webhooks_subscribers/edit.html.erb +13 -0
  227. data/app/views/spree/admin/webhooks_subscribers/index.html.erb +47 -0
  228. data/app/views/spree/admin/webhooks_subscribers/new.html.erb +13 -0
  229. data/app/views/spree/admin/webhooks_subscribers/show.html.erb +59 -0
  230. data/app/views/spree/admin/zones/_country_members.html.erb +1 -1
  231. data/app/views/spree/admin/zones/_form.html.erb +2 -2
  232. data/app/views/spree/admin/zones/_state_members.html.erb +1 -1
  233. data/app/views/spree/layouts/admin.html.erb +1 -11
  234. data/codespell.txt +8 -0
  235. data/config/locales/en.yml +273 -0
  236. data/config/routes.rb +6 -2
  237. data/lib/generators/spree/backend/install/install_generator.rb +4 -2
  238. data/lib/generators/spree/backend/install/templates/app/javascript/spree-dashboard.js +7 -0
  239. data/lib/spree/backend/engine.rb +2 -1
  240. data/lib/spree/backend/testing_support/capybara_utils.rb +53 -0
  241. data/lib/spree/backend/testing_support/flash.rb +38 -0
  242. data/lib/spree/backend/testing_support/flatpickr_capybara.rb +126 -0
  243. data/lib/spree/backend/version.rb +9 -0
  244. data/lib/spree/backend.rb +2 -1
  245. data/lib/spree_backend.rb +17 -0
  246. data/license.md +13 -0
  247. data/package.json +45 -0
  248. data/rollup.config.js +41 -0
  249. data/spree_backend.gemspec +17 -16
  250. data/vendor/assets/javascripts/purify.js +1 -1
  251. data/vendor/assets/stylesheets/animate.css +2 -4
  252. data/yarn.lock +944 -0
  253. metadata +118 -36
  254. data/app/assets/javascripts/spree/backend/menus/menu.es6 +0 -57
  255. data/app/assets/javascripts/spree/backend/taxon_permalink_preview.js +0 -11
  256. data/app/assets/javascripts/spree/backend/taxon_tree_menu.js +0 -35
  257. data/app/assets/javascripts/spree/backend/taxonomy.js +0 -178
  258. data/app/views/spree/admin/taxonomies/_js_head.html.erb +0 -7
  259. data/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js +0 -4564
  260. data/vendor/assets/javascripts/js.cookie.js +0 -163
  261. data/vendor/assets/javascripts/modernizr.js +0 -3
  262. data/vendor/assets/stylesheets/jquery.jstree/themes/spree/style.scss +0 -230
  263. data/vendor/assets/stylesheets/jquery.jstree/themes/spree/throbber.gif +0 -0
@@ -0,0 +1,59 @@
1
+ <% content_for :page_title do %>
2
+ <%= link_to Spree.t('admin.webhooks_subscribers.webhooks_subscribers'), spree.admin_webhooks_subscribers_path %> /
3
+ <%= Spree.t('admin.webhooks_subscribers.webhooks_events') %>
4
+ <% end %>
5
+
6
+ <fieldset>
7
+ <div class="table-responsive">
8
+ <table class="table table-bordered">
9
+ <tr>
10
+ <td><strong><%= Spree.t('admin.url') %></strong></td>
11
+ <td><%= @webhooks_subscriber.url %></td>
12
+ </tr>
13
+ <tr>
14
+ <td><strong><%= Spree.t('admin.active') %></strong></td>
15
+ <td><%= active_badge(@webhooks_subscriber.active) %></td>
16
+ </tr>
17
+ <tr>
18
+ <td><strong><%= Spree.t('admin.webhooks_subscribers.subscriptions') %></strong></td>
19
+ <td><%= @webhooks_subscriber.subscriptions&.join(', ') %></td>
20
+ </tr>
21
+ </table>
22
+ </div>
23
+ </fieldset>
24
+
25
+ <% if @events.any? %>
26
+ <div class="table-responsive">
27
+ <table class="table">
28
+ <thead>
29
+ <tr>
30
+ <th><%= Spree.t('admin.name') %></th>
31
+ <th><%= Spree.t('admin.successful') %></th>
32
+ <th><%= Spree.t('admin.created_at') %></th>
33
+ <th><%= Spree.t('admin.response_code') %></th>
34
+ <th><%= Spree.t('admin.execution_time') %></th>
35
+ <th><%= Spree.t('admin.request_errors') %></th>
36
+ <th></th>
37
+ </tr>
38
+ </thead>
39
+ <tbody>
40
+ <% @events.each do |event| %>
41
+ <tr id="<%= spree_dom_id event %>">
42
+ <td><%= event.name %></td>
43
+ <td><%= active_badge(event.success) %></td>
44
+ <td><%= event.created_at %></td>
45
+ <td><%= event.response_code %></td>
46
+ <td><%= event.execution_time %></td>
47
+ <td><%= sanitize event.request_errors.gsub('[SPREE WEBHOOKS]', '') %></td>
48
+ </tr>
49
+ <% end %>
50
+ </tbody>
51
+ </table>
52
+ </div>
53
+ <%= render 'spree/admin/shared/index_table_options', collection: @events, simple: true %>
54
+
55
+ <% else %>
56
+ <div class="alert alert-info no-objects-found">
57
+ <%= Spree.t('admin.webhooks_subscribers.no_events') %>
58
+ </div>
59
+ <% end %>
@@ -7,7 +7,7 @@
7
7
  </div>
8
8
 
9
9
  <div class="card-body">
10
- <%= zone_form.field_container :country_ids, class: ['form-group'] do %>
10
+ <%= zone_form.field_container :country_ids do %>
11
11
  <%= zone_form.label :country_ids, Spree.t(:countries) %>
12
12
  <%= zone_form.collection_select :country_ids, @countries, :id, :name, {}, { multiple: true, class: "select2" } %>
13
13
  <% end %>
@@ -6,13 +6,13 @@
6
6
  </div>
7
7
 
8
8
  <div class="card-body">
9
- <%= zone_form.field_container :name, class: ['form-group'] do %>
9
+ <%= zone_form.field_container :name do %>
10
10
  <%= zone_form.label :name, Spree.t(:name) %>
11
11
  <%= zone_form.text_field :name, class: 'form-control' %>
12
12
  <%= zone_form.error_message_on :name %>
13
13
  <% end %>
14
14
 
15
- <%= zone_form.field_container :description, class: ['form-group'] do %>
15
+ <%= zone_form.field_container :description do %>
16
16
  <%= zone_form.label :description, Spree.t(:description) %>
17
17
  <%= zone_form.text_field :description, class: 'form-control' %>
18
18
  <% end %>
@@ -7,7 +7,7 @@
7
7
  </div>
8
8
 
9
9
  <div class="card-body">
10
- <%= zone_form.field_container :state_ids, class: ['form-group'] do %>
10
+ <%= zone_form.field_container :state_ids do %>
11
11
  <%= zone_form.label :state_ids, Spree.t(:states) %>
12
12
  <%= zone_form.collection_select :state_ids, @states, :id, :name, {}, { multiple: true, class: "select2" } %>
13
13
  <% end %>
@@ -4,7 +4,7 @@
4
4
  <%= render partial: 'spree/admin/shared/head' %>
5
5
  </head>
6
6
 
7
- <body class="admin">
7
+ <body class="admin" data-controller="spree">
8
8
  <%#-------------------------------------------------%>
9
9
  <%# Header navbar %>
10
10
  <%#-------------------------------------------------%>
@@ -77,15 +77,5 @@
77
77
  <div id="FlashAlertsContainer" class="d-none">
78
78
  <%= flash_alert(flash) %>
79
79
  </div>
80
-
81
- <%#-------------------------------------------------%>
82
- <%# Loading progress bars %>
83
- <%#-------------------------------------------------%>
84
- <div id="progress">
85
- <div class="alert alert-info alert-progress">
86
- <div class="spinner"><%= Spree.t(:loading) %>...</div>
87
- <div class="progress-message"><%= Spree.t(:loading) %>...</div>
88
- </div>
89
- </div>
90
80
  </body>
91
81
  </html>
data/codespell.txt ADDED
@@ -0,0 +1,8 @@
1
+ devels
2
+ fo
3
+ wan
4
+ te
5
+ ue
6
+ nd
7
+ optionel
8
+ ot
@@ -0,0 +1,273 @@
1
+ en:
2
+ spree:
3
+ admin:
4
+ url: URL
5
+ active: Active
6
+ name: Name
7
+ successful: Successful
8
+ created_at: Created At
9
+ response_code: Response Code
10
+ execution_time: Execution Time
11
+ request_errors: Request Errors
12
+ cms:
13
+ all_pages: All Pages
14
+ add_new_page: Add New Page
15
+ add_new_section: Add New Section
16
+ content: Content
17
+ click_here: click here
18
+ draft_mode: Draft Mode
19
+ full_width: Full width
20
+ link_to_taxon: Link to Taxon
21
+ link_to_product: Link to Product
22
+ title: Title
23
+ fit: Fit To
24
+ info_hero_image_body: "<p>The Hero Image section adds a large image with a button and tagline text to your page.</p>
25
+ <p>The button can link to a Product, Taxon or Page. This section can be set to fit within the central container or to the edges of the screen.</p>
26
+ <p><b>Tip:</b> Use a hero image with no button text or title, and then set the <b>Fit:</b> to <b>Container</b> and <b>Gutters</b> to <b>Use Gutters</b> this creates an image section that looks great above a Side-by-Side Images section, or an Image Gallery section.</p>
27
+ <p>Experiment with the settings, and don't be afraid to use more than one Hero Image section per page.</p>"
28
+ info_image_gallery_body: "<p>The Image Gallery section can be configured in several ways. For example, each image can link to a product or taxon. If you do not provide a link, you can display three images. Additionally, you can also use labels to add text to your images.</p>
29
+ <p>There are two layout configurations for the Image Gallery section, with the taller image used on the left or the right. You can also set this section to fit the edges of the screen or the central container to match your website's style.</p>"
30
+ info_product_carousel_body: "<p>Product Carousel is a simple section to use. Search for the taxon you wish to display, save the changes, and the products in your chosen taxon will be displayed on your page.</p>"
31
+ info_featured_article_body: "<p>The Feature Article section allows you to add rich text to your page with a set title subtitle and linking button.</p>
32
+ <p>This section can be set to use full screen or container and also use gutters.</p>"
33
+ info_side_by_side_images_body: "<p>The Side-by-Side Images section can be configured in several ways, you have the option of using them as plane images, images with text, and either of those options can be clickable links if a link is set.</p>
34
+ <p><b>Tip:</b> You can blow these images out to the edge of the screen and remove the gutters to create a completely different look.</p>"
35
+ info_rich_text_content_body: "<p>The Rich Text Content section is simply a section that offers nothing more than an area of rich text editor content to be displayed on your page.</p>"
36
+ brand_bar:
37
+ uses_menu: This section uses your Spree Menu named <b>%{menu}</b> to manage the images and links,
38
+ vist_menu_to_edit: to edit this menu.
39
+ full_width_on_small: Full width on small devices
40
+ button_text: Button Text
41
+ go_to_fullscreen_section_manager: Go To Fullscreen Section Manager
42
+ page_type: Page Type
43
+ gutters: Gutters
44
+ you_have_no_pages: You have no Pages, click the <b>+ Add New Page</b> button to get started.
45
+ new_page: New Page
46
+ toggle_page_visibility: Toggle page visibility
47
+ meta_title: Meta Title
48
+ meta_description: Meta Description
49
+ page: Page
50
+ full_screen_mode: '<span class="exit">Exit </span>Full Screen Mode'
51
+ hero:
52
+ aspect_ratio: Please use an image with the aspect ratio of 12:5 (2400px x 1000px)
53
+ select_page_type: Select a page type
54
+ section_type: Section Type
55
+ subtitle: Subtitle
56
+ set_gutters: Set Gutters
57
+ click_button_to_change_page_type: Click the <b>%{button_type}</b> button to load the options for this page type.
58
+ more_page_settings: '<span class="more">More</span><span class="less">Less</span> Page Settings'
59
+ seo_settings: SEO Settings
60
+ no_sections_found_please_add_one: Add your first section to this page by clicking the <b>+ Add New Section</b> button above.
61
+ click_create_to_load_new_link: 'Click the <b>Create</b> button below to save your new page section, and load the section settings.'
62
+ click_update_to_load_new_link: 'Click the <b>Update</b> button below to load the new section settings.'
63
+ settings_for: 'Options For: <b>%{section}</b>'
64
+ page_sections: '%{page_name} Sections'
65
+ page_sections_info: 'The area below represents your %{page_type} displayed in %{store}, add sections and drag them into position'
66
+ visible: Visible
67
+ side_by_side:
68
+ left_image: Left Image
69
+ right_image: Right Image
70
+ image_info: 'Please use an image with an aspect ratio of 54:35 (1468px x 952px).'
71
+ image_gallery:
72
+ display_labels: Display labels
73
+ image_a: Image A
74
+ image_b: Image B
75
+ image_c: Image C
76
+ layout_style: Layout Style
77
+ square_image: Please use an image with an aspect ratio of 18:13 (1080px x 780px).
78
+ tall_image: Please use an image with an aspect ratio of 27:40 (1080px x 1600px).
79
+ copy_to_clipboard: Copy to clipboard
80
+ digitals:
81
+ digital: Digital
82
+ add_new_file: Add a new digital asset.
83
+ digital_assets: Digital Assets
84
+ reset_download_links: Reset Digital Download Links
85
+ downloads_reset: Digital Download Links Reset
86
+ no_digital_assets_added: No digital assets.
87
+ delete_file_confirmation: "Are you sure you want to delete: %{filename}"
88
+ upload: Upload
89
+ linkable:
90
+ search_for_a_page: Search for a page
91
+ search_for_a_taxon: Search for a Taxon
92
+ search_for_a_product: Search for a Product
93
+ store:
94
+ digital_settings:
95
+ digital_asset_settings: Digital Asset Settings
96
+ limit_digital_download_count: Limit Download Count
97
+ limit_digital_download_days: Limit Download Days
98
+ digital_asset_authorized_clicks:
99
+ authorized_clicks: Authorized Download Count
100
+ info: Number of times a download link can be clicked.
101
+ digital_asset_authorized_days:
102
+ authorized_days: Authorized Download Days
103
+ info: The number of days a purchase can be downloaded after purchase.
104
+ digital_asset_link_expire_time:
105
+ download_link_expire_time: Download Link Expire Time
106
+ link_expire_time: Set the expire time of each download link. (seconds).
107
+ tab:
108
+ configuration: Configuration
109
+ content: Content
110
+ option_types: Option Types
111
+ orders: Orders
112
+ overview: Overview
113
+ pages: Pages
114
+ products: Products
115
+ promotions: Promotions
116
+ promotion_categories: Promotion Categories
117
+ properties: Properties
118
+ prototypes: Prototypes
119
+ reports: Reports
120
+ navigation: Navigation
121
+ taxonomies: Taxonomies
122
+ taxons: Taxons
123
+ users: Users
124
+ return_authorizations: Return Authorizations
125
+ customer_returns: Customer Returns
126
+ apps: Apps
127
+ applications: Applications
128
+ integrations: Integrations
129
+ taxon:
130
+ nested_under_info: Nest this Taxon within the Taxonomy tree.
131
+ taxonomies:
132
+ edit_root_taxonomy: Edit %{name} Taxonomy
133
+ taxonomies: Taxonomies
134
+ taxons_belonging_to: "Taxons Belonging To %{taxonomy_name}"
135
+ submenu: Submenu
136
+ add_new_taxon: Add a new Taxon
137
+ no_taxons: '<b>%{taxonomy}</b> has no Taxons. Click the <b>Add a new Taxon</b> button, to begin adding Taxons.'
138
+ order:
139
+ changing_store_warning: If you change the store this order belongs to, the order will be reset.
140
+ once_an_order_is_complete_you_can_not_change_store: 'Sorry, once an order is complete, you can no longer change the store that the order belongs to.'
141
+ events:
142
+ approve: approve
143
+ cancel: cancel
144
+ resume: resume
145
+ resend: Resend
146
+ orders:
147
+ cart: Cart
148
+ oauth_applications:
149
+ list: oAuth applications
150
+ new: New oAuth application
151
+ uid: UID
152
+ scopes: Scopes
153
+ reports:
154
+ for: For %{store_name}
155
+ return_authorization:
156
+ product: Product
157
+ user:
158
+ account: Account
159
+ addresses: Addresses
160
+ items: Items
161
+ items_purchased: Items Purchased
162
+ order_history: Order History
163
+ order_num: "Order #"
164
+ orders: Orders
165
+ user_information: User Information
166
+ stores: Stores
167
+ store_credits: Store Credits
168
+ no_store_credit: User has no Store Credit available.
169
+ available_store_credit: User has %{amount} in Store Credit available.
170
+ navigation:
171
+ all_menus: All Menus
172
+ add_new_menu: Add New Menu
173
+ add_new_item: 'Add New Item'
174
+ code: Code
175
+ default_menus_info:
176
+ title: Default Menus
177
+ body: "Default menus are menus whose language matches the associated store's default language.<br><br>
178
+ <h5>Example</h5>If you have a store that uses Spanish as the default language but also offers the options of German and French; your default header menu for this store would be set to use <b>Español (es)</b> for the language and <b>Header</b> as the location.<br><br>
179
+ <h5>Why Are Default Menus Important?</h5> Default menus are displayed to your visitor if no menu is available in the current language they are browsing. It is recommended that you create a default menu for each menu location within each store.<br><br>
180
+ <h5>More Information</h5>To learn more about menus, view the official Spree user documentation by <a href='https://guides.spreecommerce.org/user/navigation/building_the_main_menu.html' target='_blank' class='alert-link'>clicking here</a>."
181
+ allow_this_menu_item_to_contain_nested_menu_items: Allow this Menu Item to contain nested items
182
+ back_to_all_menus: Back To All Menus
183
+ click_create_to_load_new_link: 'Click the <b>Create</b> button below to change the link field.'
184
+ click_update_to_load_new_link: 'Click the <b>Update</b> button below to change the link field.'
185
+ give_your_menu_a_unique_name: 'Use the unique code to identify your menu: spree-eu-main'
186
+ link_settings: Link Settings
187
+ link_to: Link To
188
+ image_alt_text: Add alt text to your image
189
+ image_asset: Add a Promotion image or Link icon.
190
+ move_could_not_be_saved: 'ERROR: This move could not be saved.'
191
+ managing_by_store_title: 'Managing Menus By Store'
192
+ managing_by_store: <p>You are managing the menus for <b>%{store}</b>. To manage menus for other stores, change the global store using the drop-down in the main navbar found at the top of the screen.</p>
193
+ new_menu_item: New Menu Item
194
+ new_menu: New Menu
195
+ nested_under: Nested under
196
+ no_menu_items: '<b>%{menu}</b> has no items. Click the <b>Add New Item</b> button to begin adding links to this menu.'
197
+ nested_under_info: Quickly nest your Menu Item if you already know where it needs to be.
198
+ item_type: Item Type
199
+ image_info: '<b>NOTE:</b> You can attach an image to any menu item, but your image will only be displayed in the main menu when nested inside a container with the code <b>promo</b>.<br><br> For best results use images with a width of 540px and height of 350px.'
200
+ open_link_in_new_window: Open this link in a new window
201
+ menu_item_type_container_message: "Containers are menu items that do not link to a destination. If you are building the Spree Main Menu
202
+ create containers with the code: <b>category</b> or <b>promo</b>, and then nest your links inside these containers build out your menu.
203
+ <br><br> For an indepth guide to building the main menu see the documenttation page <a href='https://guides.spreecommerce.org/user/navigation/building_the_main_menu.html' target='_blank' class='alert-link'>Building The Main Menu</a>"
204
+ menus: Menus
205
+ menu_items: '%{menu_name} Items'
206
+ public_details: Public Details
207
+ subtitle: Subtitle
208
+ url_info: 'The URL field can link to an external website using <b>https://example.com</b>, link to an otherwise unreachable internal path using <b>/policies/privacy</b>,
209
+ launch an email client using <b>mailto:sales@example.com</b> or used to create a clickable phone number with <b>tel:123456789</b>'
210
+ search_for_a_product: Search for a Product
211
+ search_for_a_taxon: Search for a Taxon
212
+ settings: Settings
213
+ set_a_code: "Adding a code is optional but can be useful if you need to identify this menu item. When building
214
+ the Spree main menu use the code <b>category</b> or <b>promo</b> to create the containers that organize links and promotions appropriately. To learn more view the documentation by <a href='https://guides.spreecommerce.org/user/navigation/add_menu_items.html' target='_blank' class='alert-link'>clicking here</a>."
215
+ type: Type
216
+ used_in: Used In
217
+ you_have_no_menus: You have no Menus, click the Add New Menu button to create your first Menu.
218
+ this_link_takes_you_to_your_stores_home_page: This link takes you to your stores home page.
219
+ utilities:
220
+ preview: Preview %{name}
221
+ webhooks_subscribers:
222
+ webhooks_subscribers: Webhooks Subscribers
223
+ new_webhooks_subscriber: New Webhooks Subscriber
224
+ webhooks_events: Webhooks Events
225
+ subscriptions: Subscriptions
226
+ time_of_last_event: Time of Last Event
227
+ all_events: All Events
228
+ no_events: No Events
229
+ subscribe_to_all_events: Subscribe to all events
230
+ select_events: Select events
231
+ addresses: Addresses
232
+ assets: Assets
233
+ cms_pages: Cms Pages
234
+ credit_cards: Credit Cards
235
+ customer_returns: Customer Returns
236
+ digital_links: Digital Links
237
+ digitals: Digitals
238
+ inventory_units: Inventory Units
239
+ line_items: Line Items
240
+ menu_items: Menu Items
241
+ menus: Menus
242
+ option_types: Option Types
243
+ option_values: Option Values
244
+ orders: Orders
245
+ payments: Payments
246
+ payment_capture_events: Payment Capture Events
247
+ prices: Prices
248
+ products: Products
249
+ promotions: Promotions
250
+ properties: Properties
251
+ prototypes: Prototypes
252
+ refunds: Refunds
253
+ reimbursements: Reimbursements
254
+ return_authorizations: Return Authorizations
255
+ return_items: Return Items
256
+ roles: Roles
257
+ shipments: Shipments
258
+ shipping_categories: Shipping Categories
259
+ shipping_methods: Shipping Methods
260
+ shipping_rates: Shipping Rates
261
+ stock_items: Stock Items
262
+ stock_locations: Stock Locations
263
+ stock_movements: Stock Movements
264
+ stock_transfers: Stock Transfers
265
+ store_credits: Store Credits
266
+ stores: Stores
267
+ tax_rates: Tax Rates
268
+ taxonomies: Taxonomies
269
+ taxons: Taxons
270
+ variants: Variants
271
+ wished_items: Wished Items
272
+ wishlists: Wishlists
273
+ zones: Zones
data/config/routes.rb CHANGED
@@ -46,6 +46,7 @@ Spree::Core::Engine.add_routes do
46
46
  end
47
47
  resources :variants_including_master, only: [:update]
48
48
  resources :prices, only: [:index, :create]
49
+ resources :digitals, only: [:index, :create, :destroy]
49
50
  end
50
51
 
51
52
  resources :option_types do
@@ -57,6 +58,8 @@ Spree::Core::Engine.add_routes do
57
58
 
58
59
  delete '/option_values/:id', to: 'option_values#destroy', as: :option_value
59
60
 
61
+ resources :oauth_applications
62
+
60
63
  resources :properties do
61
64
  collection do
62
65
  get :filtered
@@ -86,6 +89,7 @@ Spree::Core::Engine.add_routes do
86
89
  put :resume
87
90
  get :channel
88
91
  put :set_channel
92
+ get :reset_digitals
89
93
  end
90
94
 
91
95
  resources :state_changes, only: [:index]
@@ -178,8 +182,6 @@ Spree::Core::Engine.add_routes do
178
182
  member do
179
183
  get :addresses
180
184
  put :addresses
181
- put :clear_api_key
182
- put :generate_api_key
183
185
  get :items
184
186
  get :orders
185
187
  end
@@ -198,6 +200,8 @@ Spree::Core::Engine.add_routes do
198
200
  end
199
201
  end
200
202
 
203
+ resources :webhooks_subscribers
204
+
201
205
  get '/forbidden', to: 'errors#forbidden', as: :forbidden
202
206
  end
203
207
 
@@ -2,19 +2,21 @@ module Spree
2
2
  module Backend
3
3
  module Generators
4
4
  class InstallGenerator < Rails::Generators::Base
5
- desc 'Installs spree rails admin panel'
5
+ desc 'Installs Spree Dashboard'
6
6
 
7
7
  def self.source_paths
8
8
  [
9
9
  File.expand_path('templates', __dir__),
10
10
  File.expand_path('../templates', "../#{__FILE__}"),
11
- File.expand_path('../templates', "../../#{__FILE__}"),
11
+ File.expand_path('../templates', "../../#{__FILE__}")
12
12
  ]
13
13
  end
14
14
 
15
15
  def install
16
+ template 'app/javascript/spree-dashboard.js'
16
17
  template 'vendor/assets/javascripts/spree/backend/all.js'
17
18
  template 'vendor/assets/stylesheets/spree/backend/all.css'
19
+ run 'yarn add @spree/dashboard'
18
20
  end
19
21
  end
20
22
  end
@@ -0,0 +1,7 @@
1
+ // Entry point for the build script in your package.json
2
+
3
+ import "@spree/dashboard"
4
+
5
+ new SpreeDashboard.Dashboard()
6
+
7
+ // window.Turbo = SpreeDashboard.Turbo
@@ -14,7 +14,8 @@ module Spree
14
14
 
15
15
  initializer 'spree.backend.checking_deprecated_preferences' do
16
16
  Spree::Backend::Config.deprecated_preferences.each do |pref|
17
- warn "[DEPRECATION] Spree::Backend::Config[:#{pref[:name]}] is deprecated. #{pref[:message]}"
17
+ # FIXME: we should only notify about deprecated preferences that are in use, not all of them
18
+ # warn "[DEPRECATION] Spree::Backend::Config[:#{pref[:name]}] is deprecated. #{pref[:message]}"
18
19
  end
19
20
  end
20
21
  end
@@ -0,0 +1,53 @@
1
+ module Spree
2
+ module Backend
3
+ module TestingSupport
4
+ module CapybaraUtils
5
+ def click_icon(type)
6
+ first(".icon-#{type}").click
7
+ end
8
+
9
+ def within_row(num, &block)
10
+ if RSpec.current_example.metadata[:js]
11
+ within("table.table tbody tr:nth-child(#{num})", match: :first, &block)
12
+ else
13
+ within(all('table.table tbody tr')[num - 1], &block)
14
+ end
15
+ end
16
+
17
+ def column_text(num)
18
+ if RSpec.current_example.metadata[:js]
19
+ find("td:nth-child(#{num})").text
20
+ else
21
+ all('td')[num - 1].text
22
+ end
23
+ end
24
+
25
+ # delay in seconds
26
+ def wait_for_ajax(delay = Capybara.default_max_wait_time)
27
+ Timeout.timeout(delay) do
28
+ active = page.evaluate_script('typeof jQuery !== "undefined" && jQuery.active')
29
+ active = page.evaluate_script('typeof jQuery !== "undefined" && jQuery.active') until active.nil? || active.zero?
30
+ end
31
+ end
32
+
33
+ def wait_for_turbo(timeout = nil)
34
+ if has_css?('.turbo-progress-bar', visible: true, wait: 0.5.seconds)
35
+ has_no_css?('.turbo-progress-bar', wait: timeout.presence || 1.seconds)
36
+ end
37
+ end
38
+
39
+ def disable_html5_validation
40
+ page.execute_script('for(var f=document.forms,i=f.length;i--;)f[i].setAttribute("novalidate",i)')
41
+ end
42
+
43
+ def wait_for(options = {}, &block)
44
+ default_options = { error: nil, seconds: 5 }.merge(options)
45
+
46
+ Selenium::WebDriver::Wait.new(timeout: default_options[:seconds]).until(&block)
47
+ rescue Selenium::WebDriver::Error::TimeoutError
48
+ default_options[:error].nil? ? false : raise(default_options[:error])
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,38 @@
1
+ module Spree
2
+ module Backend
3
+ module TestingSupport
4
+ module Flash
5
+ def assert_admin_flash_alert_success(message)
6
+ message_content = convert_flash(message)
7
+
8
+ within('#FlashAlertsContainer', visible: :all) do
9
+ expect(page).to have_css('span[data-alert-type="success"]', text: message_content, visible: :all)
10
+ end
11
+ end
12
+
13
+ def assert_admin_flash_alert_error(message)
14
+ message_content = convert_flash(message)
15
+
16
+ within('#FlashAlertsContainer', visible: :all) do
17
+ expect(page).to have_css('span[data-alert-type="error"]', text: message_content, visible: :all)
18
+ end
19
+ end
20
+
21
+ def assert_admin_flash_alert_notice(message)
22
+ message_content = convert_flash(message)
23
+
24
+ within('#FlashAlertsContainer', visible: :all) do
25
+ expect(page).to have_css('span[data-alert-type="notice"]', text: message_content, visible: :all)
26
+ end
27
+ end
28
+
29
+ private
30
+
31
+ def convert_flash(flash)
32
+ flash = Spree.t(flash) if flash.is_a?(Symbol)
33
+ flash
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end