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
data/.rubocop.yml ADDED
@@ -0,0 +1,197 @@
1
+ require: rubocop-rspec
2
+
3
+ AllCops:
4
+ TargetRubyVersion: 2.5
5
+ Exclude:
6
+ - '**/sandbox/**/*'
7
+ - '**/db/migrate/*'
8
+ - '**/Gemfile'
9
+ - '**/Gemfile.lock'
10
+ - '**/Rakefile'
11
+ - '**/rails'
12
+ - '**/*.gemspec'
13
+ - '**/dummy/**/*'
14
+ - '**/vendor/**/*'
15
+ - '**/spec_helper.rb'
16
+ - '**/templates/**/*'
17
+
18
+ Layout/MultilineOperationIndentation:
19
+ EnforcedStyle: indented
20
+
21
+ Layout/ParameterAlignment:
22
+ Enabled: false
23
+
24
+ Metrics/ClassLength:
25
+ CountComments: false
26
+ Max: 150
27
+
28
+ Metrics/ModuleLength:
29
+ CountComments: false
30
+ Max: 250
31
+ Exclude:
32
+ - '**/spec/**/*'
33
+
34
+ Style/Documentation:
35
+ Enabled: false
36
+
37
+ Layout/LineLength:
38
+ Max: 150
39
+ Exclude:
40
+ - '**/spec/**/*'
41
+
42
+ Metrics/MethodLength:
43
+ CountComments: false
44
+ Max: 50
45
+
46
+ Metrics/BlockLength:
47
+ CountComments: false
48
+ Max: 50
49
+ Exclude:
50
+ - '**/spec/**/*'
51
+ - '**/*.rake'
52
+ - '**/factories/**/*'
53
+ - '**/config/routes.rb'
54
+
55
+ Metrics/AbcSize:
56
+ Max: 45
57
+
58
+ Style/StringLiterals:
59
+ EnforcedStyle: single_quotes
60
+
61
+ Layout/DotPosition:
62
+ EnforcedStyle: trailing
63
+ Enabled: true
64
+
65
+ Layout/SpaceInsideArrayLiteralBrackets:
66
+ Exclude:
67
+ - 'api/spec/integration/**/*.rb'
68
+ - 'api/lib/spree/api/testing_support/v2/platform_contexts.rb'
69
+
70
+ Style/FrozenStringLiteralComment:
71
+ Enabled: false
72
+
73
+ Style/RegexpLiteral:
74
+ Enabled: false
75
+
76
+ Style/WordArray:
77
+ Enabled: false
78
+
79
+ Style/SymbolArray:
80
+ Enabled: false
81
+
82
+ Style/SymbolProc:
83
+ Exclude:
84
+ - '**/app/serializers/**/*'
85
+
86
+ Style/GuardClause:
87
+ Enabled: false
88
+
89
+ Style/TrailingCommaInArrayLiteral:
90
+ Enabled: false
91
+
92
+ Style/TrailingCommaInHashLiteral:
93
+ Enabled: false
94
+
95
+ Style/BarePercentLiterals:
96
+ Enabled: false
97
+
98
+ Style/MutableConstant:
99
+ Enabled: false
100
+
101
+ Style/PercentLiteralDelimiters:
102
+ Enabled: false
103
+
104
+ Style/IfUnlessModifier:
105
+ Enabled: false
106
+
107
+ Naming/VariableNumber:
108
+ Enabled: false
109
+
110
+ Style/RedundantPercentQ:
111
+ Enabled: false
112
+
113
+ Lint/ParenthesesAsGroupedExpression:
114
+ Enabled: false
115
+
116
+ Style/NumericPredicate:
117
+ Enabled: false
118
+
119
+ Metrics/PerceivedComplexity:
120
+ Max: 10
121
+
122
+ Metrics/CyclomaticComplexity:
123
+ Max: 10
124
+
125
+ Style/ClassAndModuleChildren:
126
+ Enabled: false
127
+
128
+ Style/AndOr:
129
+ Exclude:
130
+ - '**/*controller.rb'
131
+
132
+ Style/HashEachMethods:
133
+ Enabled: false
134
+
135
+ Style/HashTransformKeys:
136
+ Enabled: false
137
+
138
+ Style/HashTransformValues:
139
+ Enabled: false
140
+
141
+ RSpec/NestedGroups:
142
+ Max: 7
143
+
144
+ Lint/AmbiguousBlockAssociation:
145
+ Exclude:
146
+ - '**/spec/**/*'
147
+
148
+ Style/NumericLiterals:
149
+ Enabled: false
150
+
151
+ RSpec/DescribeClass:
152
+ Enabled: false
153
+
154
+ RSpec/VerifiedDoubles:
155
+ Enabled: false
156
+
157
+ RSpec/MessageChain:
158
+ Enabled: false
159
+
160
+ RSpec/AnyInstance:
161
+ Enabled: false
162
+
163
+ RSpec/InstanceVariable:
164
+ Enabled: false
165
+
166
+ RSpec/ContextWording:
167
+ Enabled: false
168
+
169
+ RSpec/ExpectInHook:
170
+ Enabled: false
171
+
172
+ RSpec/ExampleLength:
173
+ Enabled: false
174
+
175
+ RSpec/MessageSpies:
176
+ Enabled: false
177
+
178
+ RSpec/NamedSubject:
179
+ Enabled: false
180
+
181
+ RSpec/MultipleExpectations:
182
+ Enabled: false
183
+
184
+ RSpec/FilePath:
185
+ Enabled: false
186
+
187
+ RSpec/LetSetup:
188
+ Enabled: false
189
+
190
+ RSpec/SubjectStub:
191
+ Enabled: false
192
+
193
+ RSpec/VoidExpect:
194
+ Enabled: false
195
+
196
+ RSpec/BeforeAfterAll:
197
+ Enabled: false
data/.solargraph.yml ADDED
@@ -0,0 +1,20 @@
1
+ ---
2
+ include:
3
+ - "**/*.rb"
4
+ exclude:
5
+ - "*/spec/**/*"
6
+ - "*test/**/*"
7
+ - "*/vendor/**/*"
8
+ - vendor/**/*
9
+ - ".bundle/**/*"
10
+ - sample/**/*
11
+ - sandbox/**/*
12
+ - pkg/**/*
13
+ - cli/**/*.gemspec
14
+ require: []
15
+ domains: []
16
+ reporters:
17
+ - rubocop
18
+ - require_not_found
19
+ require_paths: []
20
+ max_files: 50_000
data/.stylelintignore ADDED
@@ -0,0 +1,4 @@
1
+ **/vendor/**
2
+ **/dummy/**
3
+ **/sandbox/**
4
+ /cli/lib/spree_cli/templates/**
data/.stylelintrc ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "stylelint-config-recommended",
3
+ "rules": {
4
+ "at-rule-no-unknown": null
5
+ }
6
+ }
@@ -0,0 +1,22 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
6
+
7
+ Examples of unacceptable behavior by participants include:
8
+
9
+ * The use of sexualized language or imagery
10
+ * Personal attacks
11
+ * Trolling or insulting/derogatory comments
12
+ * Public or private harassment
13
+ * Publishing other's private information, such as physical or electronic addresses, without explicit permission
14
+ * Other unethical or unprofessional conduct.
15
+
16
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
17
+
18
+ This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
19
+
20
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
21
+
22
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
data/Gemfile CHANGED
@@ -1,6 +1,62 @@
1
- eval_gemfile('../common_spree_dependencies.rb')
1
+ source 'https://rubygems.org'
2
2
 
3
- gem 'spree_core', path: '../core'
4
- gem 'spree_api', path: '../api'
3
+ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
4
+
5
+ %w[
6
+ actionmailer actionpack actionview activejob activemodel activerecord
7
+ activestorage activesupport railties
8
+ ].each do |rails_gem|
9
+ gem rails_gem, ENV.fetch('RAILS_VERSION', '~> 6.1.0'), require: false
10
+ end
11
+
12
+ platforms :jruby do
13
+ gem 'jruby-openssl'
14
+ end
15
+
16
+ platforms :ruby do
17
+ gem 'mysql2'
18
+ gem 'pg', '~> 1.1'
19
+ end
20
+
21
+ group :test do
22
+ gem 'capybara', '~> 3.24'
23
+ gem 'capybara-screenshot', '~> 1.0'
24
+ gem 'capybara-select-2'
25
+ gem 'database_cleaner', '~> 2.0'
26
+ gem 'email_spec'
27
+ gem 'factory_bot_rails', '~> 6.0'
28
+ gem 'multi_json'
29
+ gem 'rspec-activemodel-mocks', '~> 1.0'
30
+ gem 'rspec-rails', '~> 5.0'
31
+ gem 'rspec-retry'
32
+ gem 'rspec_junit_formatter'
33
+ gem 'rswag-specs'
34
+ gem 'jsonapi-rspec'
35
+ gem 'simplecov', '0.17.1'
36
+ gem 'webmock', '~> 3.7'
37
+ gem 'timecop'
38
+ gem 'rails-controller-testing'
39
+ end
40
+
41
+ group :test, :development do
42
+ gem 'awesome_print'
43
+ gem 'gem-release'
44
+ gem 'redis'
45
+ gem 'rubocop', '~> 1.22.3', require: false # bumped
46
+ gem 'rubocop-rspec', require: false
47
+ gem 'pry-byebug'
48
+ gem 'webdrivers', '~> 4.1'
49
+ gem 'puma'
50
+ gem 'ffaker'
51
+ end
52
+
53
+ group :development do
54
+ gem 'github_fast_changelog'
55
+ gem 'solargraph'
56
+ end
57
+
58
+ spree_opts = { github: 'spree/spree', branch: '4-4-stable' }
59
+ gem 'spree_core', spree_opts
60
+ gem 'spree_api', spree_opts
5
61
 
6
62
  gemspec
data/README.md ADDED
@@ -0,0 +1,123 @@
1
+ <a href="https://spreecommerce.org">
2
+ <img src="https://raw.githubusercontent.com/spree/spree-dev-docs/master/.gitbook/assets/admin_panel_978-2x.jpg" alt="Spree Commerce - a headless open-source ecommerce platform for multi-store, marketplace, or B2B global brands" />
3
+ </a>
4
+
5
+ # Spree Admin Dashboard
6
+
7
+ This is the default Spree Admin Dashboard.
8
+
9
+ ## Maintained by
10
+
11
+ [![Spark Solutions](http://sparksolutions.co/wp-content/uploads/2015/01/logo-ss-tr-221x100.png)][spark]
12
+
13
+ [Spark Solutions][spark] is a full stack eCommerce agency. Our project teams consist of Designers, Software Engineers, Testers and Project Managers practicing agile project delivery. We’ll integrate our team with yours to jointly architect, deliver, maintain and scale the software products you need. You drive the project with requirements and acceptance testing and we help you deliver faster using industry-standard project management and comms best practices. [Contact us to launch your new eCommerce project](https://sparksolutions.co/contact/).
14
+
15
+ ## Key Features
16
+
17
+ * Mobile-first - works great on any device!
18
+ * Manage Product Catalog, Orders, Customers, Returns, Shipments and all other eCommerce crucial activities
19
+ * Multi-Store support out of the box
20
+ * Built-in CMS for Pages and Navigation
21
+ * Easily add 3rd party integrations such as Payments, Tax calculation services and Shipping couriers
22
+ * Easy customization to suit your needs
23
+
24
+ ## Demo
25
+
26
+ Fire up your own instance in the cloud:
27
+
28
+ [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/spree/spree_starter) <a href="https://render.com/deploy?repo=https://github.com/spree/spree_starter/tree/main">
29
+ <img src="https://render.com/images/deploy-to-render-button.svg" alt="Deploy to Render" height=32>
30
+ </a>
31
+
32
+ Default credentials:
33
+
34
+ * login: `spree@example.com`
35
+ * password: `spree123`
36
+
37
+ ## Installation
38
+
39
+ Spree Admin Dashboard is bundled with [Spree Starter](https://github.com/spree/spree_starter) and we recommend following [Spree Getting Started guide](https://dev-docs.spreecommerce.org/getting-started/installation).
40
+
41
+ You can also [add Spree and Admin Dashboard to an existing Ruby on Rails application](https://dev-docs.spreecommerce.org/advanced/existing_app_tutorial) as well.
42
+
43
+ ## Documentation
44
+
45
+ * [Developer Documentation](https://dev-docs.spreecommerce.org/)
46
+
47
+ ## Contributing
48
+
49
+ Spree Admin Dashboard is an open source project and we love contributions in any form - pull requests, issues, feature ideas!
50
+
51
+ Please review the [Spree Contributing Guide](https://dev-docs.spreecommerce.org/contributing/index)
52
+
53
+ ### Development Setup (JavaScript)
54
+
55
+ When working on the JavaScript in Spree Dashboard locally, you will need to yarn link your local development copy of `@spree/dashboard`, to the Rails app you are working in, so that your changes are picked up and represented live in the view.
56
+
57
+
58
+ From the root of `spree_backend` run:
59
+
60
+ ```bash
61
+ yarn link
62
+ ```
63
+
64
+ Next, from the root of the Rails app you are using to develop run:
65
+
66
+ ```bash
67
+ yarn link "@spree/dashboard"
68
+ ```
69
+
70
+ Once your local Spree Dashboard is linked with the Rails app you are using for development you will need two terminal tabs open,
71
+ one at the root of your Rails app, and one at the root of `spree_backend`.
72
+
73
+ In the terminal window at the root of the `spree_backend` run:
74
+
75
+ ```bash
76
+ yarn watch
77
+ ```
78
+
79
+ And from the Rails app you are using to run Spree and develop in run the following:
80
+
81
+ ```bash
82
+ bin/dev
83
+ ```
84
+ Any changes made to the JavaScript files in `spree_backend` will be processed by yarn and picked up in the Rails app you are running for development.
85
+
86
+ ### Local setup
87
+
88
+ 1. Fork it!
89
+ 2. Clone the repository
90
+ 3. Create test application:
91
+
92
+ ```bash
93
+ cd spree_backend
94
+ bundle install
95
+ bundle exec rake test_app
96
+ ```
97
+
98
+ ### Running tests
99
+
100
+ Entire test suite (this can take some time!)
101
+
102
+ ```bash
103
+ bundle exec rspec
104
+ ```
105
+
106
+ Single test file:
107
+
108
+ ```bash
109
+ bundle exec rspec spec/features/admin/users_spec.rb
110
+ ```
111
+
112
+ [ChromeDriver](https://chromedriver.chromium.org/) is required for feature tests. On MacOS you can install it by running:
113
+
114
+ ```bash
115
+ brew install chromedriver
116
+ ```
117
+
118
+
119
+ ## License
120
+
121
+ Spree Admin Dashboard is released under the [New BSD License](https://github.com/spree/spree_backend/blob/main/license.md).
122
+
123
+ [spark]:https://sparksolutions.co?utm_source=github
data/SECURITY.md ADDED
@@ -0,0 +1 @@
1
+ Please see [Spree Guides Security section](https://dev-docs.spreecommerce.org/security/index).
@@ -1,8 +1,8 @@
1
1
  //= link_tree ../images
2
2
 
3
+ //= link spree-dashboard.js
3
4
  //= link spree/backend/all.js
4
5
  //= link spree/backend/all.css
5
- //= link jquery.jstree/themes/spree/style.css
6
6
 
7
7
  //= link select2_locale_af.js
8
8
  //= link select2_locale_ar.js
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cloud-arrow-up" viewBox="0 0 16 16">
2
+ <path fill-rule="evenodd" d="M7.646 5.146a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1-.708.708L8.5 6.707V10.5a.5.5 0 0 1-1 0V6.707L6.354 7.854a.5.5 0 1 1-.708-.708l2-2z"/>
3
+ <path d="M4.406 3.342A5.53 5.53 0 0 1 8 2c2.69 0 4.923 2 5.166 4.579C14.758 6.804 16 8.137 16 9.773 16 11.569 14.502 13 12.687 13H3.781C1.708 13 0 11.366 0 9.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383zm.653.757c-.757.653-1.153 1.44-1.153 2.056v.448l-.445.049C2.064 6.805 1 7.952 1 9.318 1 10.785 2.23 12 3.781 12h8.906C13.98 12 15 10.988 15 9.773c0-1.216-1.02-2.228-2.313-2.228h-.5v-.5C12.188 4.825 10.328 3 8 3a4.53 4.53 0 0 0-2.941 1.1z"/>
4
+ </svg>
@@ -3,6 +3,6 @@
3
3
  </svg>
4
4
 
5
5
 
6
- <!-- To give Spree backwards compatability this file is duplicated in the following SVG files -->
6
+ <!-- To give Spree backwards compatibility this file is duplicated in the following SVG files -->
7
7
  <!-- VIEW EYE-OPEN -->
8
8
  <!-- If you update this file, be sure to make the same changes in all of the files above -->
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-font" viewBox="0 0 16 16">
2
+ <path d="M10.943 6H5.057L5 8h.5c.18-1.096.356-1.192 1.694-1.235l.293-.01v5.09c0 .47-.1.582-.898.655v.5H9.41v-.5c-.803-.073-.903-.184-.903-.654V6.755l.298.01c1.338.043 1.514.14 1.694 1.235h.5l-.057-2z"/>
3
+ <path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-image" viewBox="0 0 16 16">
2
+ <path d="M6.502 7a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"/>
3
+ <path d="M14 14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5V14zM4 1a1 1 0 0 0-1 1v10l2.224-2.224a.5.5 0 0 1 .61-.075L8 11l2.157-3.02a.5.5 0 0 1 .76-.063L13 10V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4z"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-music" viewBox="0 0 16 16">
2
+ <path d="M11 6.64a1 1 0 0 0-1.243-.97l-1 .25A1 1 0 0 0 8 6.89v4.306A2.572 2.572 0 0 0 7 11c-.5 0-.974.134-1.338.377-.36.24-.662.628-.662 1.123s.301.883.662 1.123c.364.243.839.377 1.338.377.5 0 .974-.134 1.338-.377.36-.24.662-.628.662-1.123V8.89l2-.5V6.64z"/>
3
+ <path d="M14 14V4.5L9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2zM9.5 3A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5v2z"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-pdf" viewBox="0 0 16 16">
2
+ <path d="M14 14V4.5L9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2zM9.5 3A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5v2z"/>
3
+ <path d="M4.603 14.087a.81.81 0 0 1-.438-.42c-.195-.388-.13-.776.08-1.102.198-.307.526-.568.897-.787a7.68 7.68 0 0 1 1.482-.645 19.697 19.697 0 0 0 1.062-2.227 7.269 7.269 0 0 1-.43-1.295c-.086-.4-.119-.796-.046-1.136.075-.354.274-.672.65-.823.192-.077.4-.12.602-.077a.7.7 0 0 1 .477.365c.088.164.12.356.127.538.007.188-.012.396-.047.614-.084.51-.27 1.134-.52 1.794a10.954 10.954 0 0 0 .98 1.686 5.753 5.753 0 0 1 1.334.05c.364.066.734.195.96.465.12.144.193.32.2.518.007.192-.047.382-.138.563a1.04 1.04 0 0 1-.354.416.856.856 0 0 1-.51.138c-.331-.014-.654-.196-.933-.417a5.712 5.712 0 0 1-.911-.95 11.651 11.651 0 0 0-1.997.406 11.307 11.307 0 0 1-1.02 1.51c-.292.35-.609.656-.927.787a.793.793 0 0 1-.58.029zm1.379-1.901c-.166.076-.32.156-.459.238-.328.194-.541.383-.647.547-.094.145-.096.25-.04.361.01.022.02.036.026.044a.266.266 0 0 0 .035-.012c.137-.056.355-.235.635-.572a8.18 8.18 0 0 0 .45-.606zm1.64-1.33a12.71 12.71 0 0 1 1.01-.193 11.744 11.744 0 0 1-.51-.858 20.801 20.801 0 0 1-.5 1.05zm2.446.45c.15.163.296.3.435.41.24.19.407.253.498.256a.107.107 0 0 0 .07-.015.307.307 0 0 0 .094-.125.436.436 0 0 0 .059-.2.095.095 0 0 0-.026-.063c-.052-.062-.2-.152-.518-.209a3.876 3.876 0 0 0-.612-.053zM8.078 7.8a6.7 6.7 0 0 0 .2-.828c.031-.188.043-.343.038-.465a.613.613 0 0 0-.032-.198.517.517 0 0 0-.145.04c-.087.035-.158.106-.196.283-.04.192-.03.469.046.822.024.111.054.227.09.346z"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-play" viewBox="0 0 16 16">
2
+ <path d="M6 6.883v4.234a.5.5 0 0 0 .757.429l3.528-2.117a.5.5 0 0 0 0-.858L6.757 6.454a.5.5 0 0 0-.757.43z"/>
3
+ <path d="M14 14V4.5L9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2zM9.5 3A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5v2z"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-spreadsheet" viewBox="0 0 16 16">
2
+ <path d="M14 14V4.5L9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2zM9.5 3A1.5 1.5 0 0 0 11 4.5h2V9H3V2a1 1 0 0 1 1-1h5.5v2zM3 12v-2h2v2H3zm0 1h2v2H4a1 1 0 0 1-1-1v-1zm3 2v-2h3v2H6zm4 0v-2h3v1a1 1 0 0 1-1 1h-2zm3-3h-3v-2h3v2zm-7 0v-2h3v2H6z"/>
3
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark-zip" viewBox="0 0 16 16">
2
+ <path d="M5 7.5a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v.938l.4 1.599a1 1 0 0 1-.416 1.074l-.93.62a1 1 0 0 1-1.11 0l-.929-.62a1 1 0 0 1-.415-1.074L5 8.438V7.5zm2 0H6v.938a1 1 0 0 1-.03.243l-.4 1.598.93.62.929-.62-.4-1.598A1 1 0 0 1 7 8.438V7.5z"/>
3
+ <path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1h-2v1h-1v1h1v1h-1v1h1v1H6V5H5V4h1V3H5V2h1V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z"/>
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-earmark" viewBox="0 0 16 16">
2
+ <path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z"/>
3
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-hdd" viewBox="0 0 16 16">
2
+ <path d="M4.5 11a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1zM3 10.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0z"/>
3
+ <path d="M16 11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V9.51c0-.418.105-.83.305-1.197l2.472-4.531A1.5 1.5 0 0 1 4.094 3h7.812a1.5 1.5 0 0 1 1.317.782l2.472 4.53c.2.368.305.78.305 1.198V11zM3.655 4.26 1.592 8.043C1.724 8.014 1.86 8 2 8h12c.14 0 .276.014.408.042L12.345 4.26a.5.5 0 0 0-.439-.26H4.094a.5.5 0 0 0-.44.26zM1 10v1a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1z"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-link-45deg" viewBox="0 0 16 16">
2
+ <path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1.002 1.002 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4.018 4.018 0 0 1-.128-1.287z"/>
3
+ <path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243L6.586 4.672z"/>
4
+ </svg>
@@ -3,6 +3,6 @@
3
3
  </svg>
4
4
 
5
5
 
6
- <!-- To give Spree backwards compatability this file is duplicated in the following SVG files -->
6
+ <!-- To give Spree backwards compatibility this file is duplicated in the following SVG files -->
7
7
  <!-- VIEW EYE-OPEN -->
8
8
  <!-- If you update this file, be sure to make the same changes in all of the files above -->
@@ -4,6 +4,8 @@ function updateAddressState(region, successCallback) {
4
4
  const stateSelect = $('#' + region + 'state select')
5
5
  const stateInput = $('#' + region + 'state input.state_name')
6
6
 
7
+ if (!countryId) { return }
8
+
7
9
  fetch(Spree.routes.countries_api_v2 + '/' + countryId + '?include=states', {
8
10
  headers: Spree.apiV2Authentication()
9
11
  }).then((response) => {
@@ -1,17 +1,17 @@
1
1
  /* global order_number, show_flash */
2
- $(function () {
2
+ document.addEventListener("spree:load", function() {
3
3
  $('[data-hook=adjustments_new_coupon_code] #add_coupon_code').click(function () {
4
4
  var couponCode = $('#coupon_code').val()
5
5
  if (couponCode.length === 0) {
6
6
  return
7
7
  }
8
8
  $.ajax({
9
- type: 'PUT',
10
- url: Spree.url(Spree.routes.apply_coupon_code(order_number)),
9
+ type: 'PATCH',
10
+ url: Spree.routes.apply_coupon_code(order_number),
11
11
  data: {
12
12
  coupon_code: couponCode,
13
- token: Spree.api_key
14
- }
13
+ },
14
+ headers: Spree.apiV2Authentication(),
15
15
  }).done(function () {
16
16
  window.location.reload()
17
17
  }).fail(function (message) {
@@ -1,6 +1,6 @@
1
1
  /* global order_number, show_flash */
2
2
 
3
- $(document).ready(function() {
3
+ document.addEventListener("spree:load", function() {
4
4
  /**
5
5
  OBSERVE FIELD:
6
6
  **/
@@ -130,12 +130,10 @@ $(document).ready(function() {
130
130
  **/
131
131
  window.Spree.advanceOrder = function() {
132
132
  $.ajax({
133
- type: 'PUT',
133
+ type: 'PATCH',
134
134
  async: false,
135
- data: {
136
- token: Spree.api_key
137
- },
138
- url: Spree.url(Spree.routes.checkouts_api + '/' + order_number + '/advance')
135
+ headers: Spree.apiV2Authentication(),
136
+ url: Spree.url(Spree.routes.orders_api_v2 + '/' + order_number + '/advance')
139
137
  }).done(function() {
140
138
  window.location.reload()
141
139
  })
@@ -1,4 +1,4 @@
1
- $(function () {
1
+ document.addEventListener("spree:load", function() {
2
2
  var calculatorSelect = $('select#calc_type')
3
3
  var originalCalcType = calculatorSelect.prop('value')
4
4
  $('.calculator-settings-warning').hide()
@@ -103,7 +103,7 @@ $.fn.customerAutocomplete = function() {
103
103
  })
104
104
  }
105
105
 
106
- document.addEventListener('DOMContentLoaded', function() {
106
+ document.addEventListener("spree:load", function() {
107
107
  $('#customer_search').customerAutocomplete()
108
108
 
109
109
  if ($('#customer_autocomplete_template').length > 0) {
@@ -1,4 +1,4 @@
1
- document.addEventListener('DOMContentLoaded', function() {
1
+ document.addEventListener("spree:load", function() {
2
2
  const linkSwitcher = $('.link_switcher').select2()
3
3
 
4
4
  linkSwitcher.on('change', function() {
@@ -1,4 +1,4 @@
1
- document.addEventListener('DOMContentLoaded', function() {
1
+ document.addEventListener("spree:load", function() {
2
2
  const LiveViewSwitcher = document.getElementById('LiveViewSwitcher')
3
3
 
4
4
  if (!LiveViewSwitcher) return