solidus_backend 2.5.2 → 2.6.0.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_backend might be problematic. Click here for more details.

Files changed (274) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +5 -3
  3. data/app/assets/javascripts/spree/backend.js +1 -0
  4. data/app/assets/javascripts/spree/backend/admin.js +1 -0
  5. data/app/assets/javascripts/spree/backend/highlight_negative_numbers.js +14 -0
  6. data/app/assets/javascripts/spree/backend/locale_selection.js +18 -0
  7. data/app/assets/javascripts/spree/backend/templates/products/sortable.hbs +1 -1
  8. data/app/assets/javascripts/spree/backend/templates/stock_items/stock_location_stock_item.hbs +11 -2
  9. data/app/assets/javascripts/spree/backend/views/stock/edit_stock_item_row.js +3 -1
  10. data/app/assets/stylesheets/spree/backend/components/_navigation.scss +6 -2
  11. data/app/assets/stylesheets/spree/backend/globals/_functions.scss +1 -2
  12. data/app/assets/stylesheets/spree/backend/shared/_typography.scss +3 -0
  13. data/app/controllers/spree/admin/adjustment_reasons_controller.rb +2 -0
  14. data/app/controllers/spree/admin/adjustments_controller.rb +2 -0
  15. data/app/controllers/spree/admin/base_controller.rb +2 -0
  16. data/app/controllers/spree/admin/cancellations_controller.rb +2 -0
  17. data/app/controllers/spree/admin/customer_returns_controller.rb +2 -0
  18. data/app/controllers/spree/admin/dashboards_controller.rb +2 -0
  19. data/app/controllers/spree/admin/general_settings_controller.rb +2 -0
  20. data/app/controllers/spree/admin/images_controller.rb +2 -0
  21. data/app/controllers/spree/admin/locale_controller.rb +24 -0
  22. data/app/controllers/spree/admin/log_entries_controller.rb +2 -0
  23. data/app/controllers/spree/admin/option_types_controller.rb +2 -0
  24. data/app/controllers/spree/admin/option_values_controller.rb +2 -0
  25. data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -0
  26. data/app/controllers/spree/admin/orders_controller.rb +4 -2
  27. data/app/controllers/spree/admin/payment_methods_controller.rb +2 -0
  28. data/app/controllers/spree/admin/payments_controller.rb +2 -0
  29. data/app/controllers/spree/admin/prices_controller.rb +2 -0
  30. data/app/controllers/spree/admin/product_properties_controller.rb +2 -0
  31. data/app/controllers/spree/admin/products_controller.rb +2 -0
  32. data/app/controllers/spree/admin/promotion_actions_controller.rb +2 -0
  33. data/app/controllers/spree/admin/promotion_categories_controller.rb +2 -0
  34. data/app/controllers/spree/admin/promotion_code_batches_controller.rb +2 -0
  35. data/app/controllers/spree/admin/promotion_codes_controller.rb +2 -0
  36. data/app/controllers/spree/admin/promotion_rules_controller.rb +6 -0
  37. data/app/controllers/spree/admin/promotions_controller.rb +2 -0
  38. data/app/controllers/spree/admin/properties_controller.rb +2 -0
  39. data/app/controllers/spree/admin/refund_reasons_controller.rb +2 -0
  40. data/app/controllers/spree/admin/refunds_controller.rb +2 -0
  41. data/app/controllers/spree/admin/reimbursement_types_controller.rb +2 -0
  42. data/app/controllers/spree/admin/reimbursements_controller.rb +2 -0
  43. data/app/controllers/spree/admin/reports_controller.rb +2 -0
  44. data/app/controllers/spree/admin/resource_controller.rb +2 -0
  45. data/app/controllers/spree/admin/return_authorizations_controller.rb +2 -0
  46. data/app/controllers/spree/admin/return_items_controller.rb +2 -0
  47. data/app/controllers/spree/admin/return_reasons_controller.rb +2 -0
  48. data/app/controllers/spree/admin/root_controller.rb +2 -0
  49. data/app/controllers/spree/admin/search_controller.rb +2 -0
  50. data/app/controllers/spree/admin/shipping_categories_controller.rb +2 -0
  51. data/app/controllers/spree/admin/shipping_methods_controller.rb +2 -0
  52. data/app/controllers/spree/admin/stock_items_controller.rb +2 -0
  53. data/app/controllers/spree/admin/stock_locations_controller.rb +2 -1
  54. data/app/controllers/spree/admin/stock_movements_controller.rb +2 -0
  55. data/app/controllers/spree/admin/store_credits_controller.rb +2 -0
  56. data/app/controllers/spree/admin/stores_controller.rb +2 -0
  57. data/app/controllers/spree/admin/style_guide_controller.rb +2 -0
  58. data/app/controllers/spree/admin/tax_categories_controller.rb +2 -0
  59. data/app/controllers/spree/admin/tax_rates_controller.rb +2 -0
  60. data/app/controllers/spree/admin/taxonomies_controller.rb +2 -0
  61. data/app/controllers/spree/admin/taxons_controller.rb +2 -0
  62. data/app/controllers/spree/admin/users_controller.rb +4 -1
  63. data/app/controllers/spree/admin/variant_property_rule_values_controller.rb +2 -0
  64. data/app/controllers/spree/admin/variants_controller.rb +2 -0
  65. data/app/controllers/spree/admin/variants_including_master_controller.rb +2 -0
  66. data/app/controllers/spree/admin/zones_controller.rb +2 -0
  67. data/app/helpers/spree/admin/adjustments_helper.rb +2 -0
  68. data/app/helpers/spree/admin/base_helper.rb +6 -3
  69. data/app/helpers/spree/admin/customer_returns_helper.rb +2 -0
  70. data/app/helpers/spree/admin/navigation_helper.rb +11 -7
  71. data/app/helpers/spree/admin/orders_helper.rb +5 -3
  72. data/app/helpers/spree/admin/payments_helper.rb +4 -3
  73. data/app/helpers/spree/admin/products_helper.rb +2 -0
  74. data/app/helpers/spree/admin/reimbursement_type_helper.rb +2 -0
  75. data/app/helpers/spree/admin/stock_locations_helper.rb +2 -0
  76. data/app/helpers/spree/admin/stock_movements_helper.rb +2 -0
  77. data/app/helpers/spree/admin/store_credit_events_helper.rb +2 -0
  78. data/app/helpers/spree/promotion_rules_helper.rb +2 -0
  79. data/app/models/spree/backend_configuration.rb +2 -0
  80. data/app/views/spree/admin/adjustment_reasons/index.html.erb +1 -1
  81. data/app/views/spree/admin/adjustments/edit.html.erb +1 -1
  82. data/app/views/spree/admin/adjustments/index.html.erb +2 -2
  83. data/app/views/spree/admin/adjustments/new.html.erb +2 -2
  84. data/app/views/spree/admin/customer_returns/index.html.erb +1 -1
  85. data/app/views/spree/admin/customer_returns/new.html.erb +2 -2
  86. data/app/views/spree/admin/images/_image_row.html.erb +1 -1
  87. data/app/views/spree/admin/images/_new.html.erb +1 -1
  88. data/app/views/spree/admin/images/edit.html.erb +2 -2
  89. data/app/views/spree/admin/log_entries/index.html.erb +2 -2
  90. data/app/views/spree/admin/option_types/index.html.erb +1 -1
  91. data/app/views/spree/admin/orders/_carton_manifest.html.erb +1 -1
  92. data/app/views/spree/admin/orders/_shipment_manifest.html.erb +1 -1
  93. data/app/views/spree/admin/orders/cart.html.erb +2 -2
  94. data/app/views/spree/admin/orders/confirm/_payments.html.erb +1 -1
  95. data/app/views/spree/admin/orders/customer_details/_form.html.erb +1 -1
  96. data/app/views/spree/admin/orders/customer_details/show.html.erb +1 -1
  97. data/app/views/spree/admin/orders/edit.html.erb +1 -1
  98. data/app/views/spree/admin/orders/index.html.erb +2 -2
  99. data/app/views/spree/admin/payment_methods/edit.html.erb +1 -1
  100. data/app/views/spree/admin/payment_methods/index.html.erb +1 -1
  101. data/app/views/spree/admin/payment_methods/new.html.erb +1 -1
  102. data/app/views/spree/admin/payments/_list.html.erb +2 -2
  103. data/app/views/spree/admin/payments/credit.html.erb +1 -1
  104. data/app/views/spree/admin/payments/index.html.erb +1 -1
  105. data/app/views/spree/admin/payments/new.html.erb +1 -1
  106. data/app/views/spree/admin/payments/show.html.erb +2 -2
  107. data/app/views/spree/admin/prices/_form.html.erb +1 -1
  108. data/app/views/spree/admin/prices/index.html.erb +2 -2
  109. data/app/views/spree/admin/product_properties/index.html.erb +1 -1
  110. data/app/views/spree/admin/products/_form.html.erb +4 -1
  111. data/app/views/spree/admin/products/edit.html.erb +1 -1
  112. data/app/views/spree/admin/products/index.html.erb +2 -2
  113. data/app/views/spree/admin/promotion_categories/_form.html.erb +1 -1
  114. data/app/views/spree/admin/promotion_categories/index.html.erb +37 -29
  115. data/app/views/spree/admin/promotion_code_batches/download.csv.ruby +2 -0
  116. data/app/views/spree/admin/promotion_code_batches/index.html.erb +1 -1
  117. data/app/views/spree/admin/promotion_code_batches/new.html.erb +6 -1
  118. data/app/views/spree/admin/promotion_codes/index.csv.ruby +2 -0
  119. data/app/views/spree/admin/promotion_codes/index.html.erb +1 -1
  120. data/app/views/spree/admin/promotions/_actions.html.erb +2 -2
  121. data/app/views/spree/admin/promotions/_activations_new.html.erb +4 -0
  122. data/app/views/spree/admin/promotions/_rules.html.erb +2 -2
  123. data/app/views/spree/admin/promotions/actions/_create_quantity_adjustments.html.erb +5 -2
  124. data/app/views/spree/admin/promotions/edit.html.erb +2 -2
  125. data/app/views/spree/admin/promotions/index.html.erb +2 -2
  126. data/app/views/spree/admin/promotions/rules/_store.html.erb +6 -0
  127. data/app/views/spree/admin/properties/index.html.erb +2 -2
  128. data/app/views/spree/admin/refund_reasons/index.html.erb +1 -1
  129. data/app/views/spree/admin/refunds/edit.html.erb +2 -2
  130. data/app/views/spree/admin/refunds/new.html.erb +2 -2
  131. data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
  132. data/app/views/spree/admin/reimbursements/index.html.erb +1 -1
  133. data/app/views/spree/admin/reimbursements/show.html.erb +1 -1
  134. data/app/views/spree/admin/return_authorizations/edit.html.erb +3 -3
  135. data/app/views/spree/admin/return_authorizations/index.html.erb +1 -1
  136. data/app/views/spree/admin/return_authorizations/new.html.erb +2 -2
  137. data/app/views/spree/admin/search/products.json.jbuilder +2 -0
  138. data/app/views/spree/admin/search/users.json.jbuilder +2 -0
  139. data/app/views/spree/admin/shared/_datepicker.html.erb +8 -0
  140. data/app/views/spree/admin/shared/_edit_resource_links.html.erb +2 -2
  141. data/app/views/spree/admin/shared/_locale_selection.html.erb +15 -0
  142. data/app/views/spree/admin/shared/_navigation.html.erb +1 -0
  143. data/app/views/spree/admin/shared/_new_resource_links.html.erb +1 -1
  144. data/app/views/spree/admin/shared/_no_objects_found.html.erb +1 -1
  145. data/app/views/spree/admin/shared/_order_summary.html.erb +1 -1
  146. data/app/views/spree/admin/shared/_refunds.html.erb +1 -1
  147. data/app/views/spree/admin/shared/_report_order_criteria.html.erb +1 -1
  148. data/app/views/spree/admin/shared/_variant_search.html.erb +1 -1
  149. data/app/views/spree/admin/shared/named_types/_index.html.erb +1 -1
  150. data/app/views/spree/admin/shipping_categories/index.html.erb +1 -1
  151. data/app/views/spree/admin/shipping_methods/_form.html.erb +8 -0
  152. data/app/views/spree/admin/shipping_methods/index.html.erb +1 -1
  153. data/app/views/spree/admin/stock_locations/_form.html.erb +1 -1
  154. data/app/views/spree/admin/stock_locations/edit.html.erb +7 -0
  155. data/app/views/spree/admin/stock_locations/index.html.erb +1 -1
  156. data/app/views/spree/admin/stock_movements/index.html.erb +15 -15
  157. data/app/views/spree/admin/store_credits/edit_validity.html.erb +2 -2
  158. data/app/views/spree/admin/store_credits/show.html.erb +2 -0
  159. data/app/views/spree/admin/stores/_form.html.erb +77 -60
  160. data/app/views/spree/admin/stores/edit.html.erb +1 -1
  161. data/app/views/spree/admin/stores/index.html.erb +3 -3
  162. data/app/views/spree/admin/tax_categories/index.html.erb +1 -1
  163. data/app/views/spree/admin/tax_rates/index.html.erb +1 -1
  164. data/app/views/spree/admin/taxonomies/{edit.erb → edit.html.erb} +3 -3
  165. data/app/views/spree/admin/taxonomies/index.html.erb +1 -1
  166. data/app/views/spree/admin/taxonomies/new.html.erb +1 -1
  167. data/app/views/spree/admin/taxons/edit.html.erb +3 -3
  168. data/app/views/spree/admin/taxons/search.json.jbuilder +2 -0
  169. data/app/views/spree/admin/users/_user_page_actions.html.erb +1 -1
  170. data/app/views/spree/admin/users/edit.html.erb +3 -3
  171. data/app/views/spree/admin/users/index.html.erb +2 -2
  172. data/app/views/spree/admin/zones/index.html.erb +1 -1
  173. data/config/initializers/assets.rb +2 -0
  174. data/config/initializers/form_builder.rb +2 -0
  175. data/config/routes.rb +4 -0
  176. data/lib/solidus_backend.rb +2 -0
  177. data/lib/spree/backend.rb +2 -0
  178. data/lib/spree/backend/action_callbacks.rb +2 -0
  179. data/lib/spree/backend/callbacks.rb +2 -0
  180. data/lib/spree/backend/engine.rb +2 -0
  181. data/lib/spree_backend.rb +2 -0
  182. data/script/rails +4 -2
  183. data/solidus_backend.gemspec +6 -5
  184. data/spec/controllers/spree/admin/base_controller_spec.rb +2 -0
  185. data/spec/controllers/spree/admin/cancellations_controller_spec.rb +2 -0
  186. data/spec/controllers/spree/admin/customer_returns_controller_spec.rb +2 -0
  187. data/spec/controllers/spree/admin/missing_products_controller_spec.rb +2 -0
  188. data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +2 -1
  189. data/spec/controllers/spree/admin/orders_controller_spec.rb +2 -9
  190. data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +2 -0
  191. data/spec/controllers/spree/admin/payments_controller_spec.rb +2 -0
  192. data/spec/controllers/spree/admin/prices_controller_spec.rb +2 -0
  193. data/spec/controllers/spree/admin/product_properties_controller_spec.rb +2 -0
  194. data/spec/controllers/spree/admin/products_controller_spec.rb +2 -0
  195. data/spec/controllers/spree/admin/promotion_actions_controller_spec.rb +2 -0
  196. data/spec/controllers/spree/admin/promotion_codes_controller_spec.rb +2 -0
  197. data/spec/controllers/spree/admin/promotion_rules_controller_spec.rb +27 -12
  198. data/spec/controllers/spree/admin/promotions_controller_spec.rb +2 -0
  199. data/spec/controllers/spree/admin/refunds_controller_spec.rb +2 -0
  200. data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +2 -0
  201. data/spec/controllers/spree/admin/reports_controller_spec.rb +2 -0
  202. data/spec/controllers/spree/admin/resource_controller_spec.rb +2 -0
  203. data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +2 -0
  204. data/spec/controllers/spree/admin/return_items_controller_spec.rb +2 -0
  205. data/spec/controllers/spree/admin/root_controller_spec.rb +2 -0
  206. data/spec/controllers/spree/admin/search_controller_spec.rb +2 -0
  207. data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +2 -0
  208. data/spec/controllers/spree/admin/stock_items_controller_spec.rb +2 -0
  209. data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +2 -0
  210. data/spec/controllers/spree/admin/store_credits_controller_spec.rb +2 -0
  211. data/spec/controllers/spree/admin/users_controller_spec.rb +2 -1
  212. data/spec/controllers/spree/admin/variants_controller_spec.rb +2 -0
  213. data/spec/features/admin/configuration/payment_methods_spec.rb +2 -0
  214. data/spec/features/admin/configuration/shipping_methods_spec.rb +2 -0
  215. data/spec/features/admin/configuration/stock_locations_spec.rb +2 -0
  216. data/spec/features/admin/configuration/store_spec.rb +2 -0
  217. data/spec/features/admin/configuration/tax_categories_spec.rb +2 -0
  218. data/spec/features/admin/configuration/tax_rates_spec.rb +2 -0
  219. data/spec/features/admin/configuration/taxonomies_spec.rb +2 -0
  220. data/spec/features/admin/configuration/zones_spec.rb +2 -0
  221. data/spec/features/admin/homepage_spec.rb +2 -0
  222. data/spec/features/admin/javascript_format_money_spec.rb +2 -0
  223. data/spec/features/admin/locale_spec.rb +3 -0
  224. data/spec/features/admin/orders/adjustments_promotions_spec.rb +2 -0
  225. data/spec/features/admin/orders/adjustments_spec.rb +2 -0
  226. data/spec/features/admin/orders/cancelling_and_resuming_spec.rb +2 -0
  227. data/spec/features/admin/orders/cancelling_inventory_spec.rb +2 -0
  228. data/spec/features/admin/orders/customer_details_spec.rb +3 -1
  229. data/spec/features/admin/orders/line_items_spec.rb +2 -0
  230. data/spec/features/admin/orders/listing_spec.rb +2 -0
  231. data/spec/features/admin/orders/log_entries_spec.rb +2 -0
  232. data/spec/features/admin/orders/new_order_spec.rb +3 -1
  233. data/spec/features/admin/orders/order_details_spec.rb +3 -2
  234. data/spec/features/admin/orders/payments_spec.rb +5 -6
  235. data/spec/features/admin/orders/return_authorizations_spec.rb +2 -0
  236. data/spec/features/admin/orders/return_payment_state_spec.rb +2 -0
  237. data/spec/features/admin/orders/risk_analysis_spec.rb +2 -0
  238. data/spec/features/admin/orders/shipments_spec.rb +2 -0
  239. data/spec/features/admin/payments/store_credits_spec.rb +2 -0
  240. data/spec/features/admin/products/edit/images_spec.rb +2 -0
  241. data/spec/features/admin/products/edit/products_spec.rb +2 -1
  242. data/spec/features/admin/products/edit/taxons_spec.rb +3 -1
  243. data/spec/features/admin/products/edit/variants_spec.rb +2 -0
  244. data/spec/features/admin/products/option_types_spec.rb +2 -0
  245. data/spec/features/admin/products/pricing_spec.rb +2 -0
  246. data/spec/features/admin/products/products_spec.rb +2 -1
  247. data/spec/features/admin/products/properties_spec.rb +2 -0
  248. data/spec/features/admin/products/stock_management_spec.rb +2 -0
  249. data/spec/features/admin/products/variant_spec.rb +2 -1
  250. data/spec/features/admin/promotion_adjustments_spec.rb +2 -0
  251. data/spec/features/admin/promotions/option_value_rule_spec.rb +2 -0
  252. data/spec/features/admin/promotions/product_rule_spec.rb +2 -0
  253. data/spec/features/admin/promotions/promotion_categories_spec.rb +83 -0
  254. data/spec/features/admin/promotions/tiered_calculator_spec.rb +3 -1
  255. data/spec/features/admin/promotions/user_rule_spec.rb +2 -0
  256. data/spec/features/admin/reimbursements_spec.rb +2 -0
  257. data/spec/features/admin/reports_spec.rb +2 -0
  258. data/spec/features/admin/store_credits_spec.rb +2 -0
  259. data/spec/features/admin/stores_spec.rb +2 -0
  260. data/spec/features/admin/style_guide_spec.rb +2 -0
  261. data/spec/features/admin/taxons_spec.rb +2 -0
  262. data/spec/features/admin/users_spec.rb +2 -0
  263. data/spec/helpers/admin/base_helper_spec.rb +2 -0
  264. data/spec/helpers/admin/navigation_helper_spec.rb +2 -1
  265. data/spec/helpers/admin/stock_movements_helper_spec.rb +2 -0
  266. data/spec/helpers/admin/store_credit_events_helper_spec.rb +2 -0
  267. data/spec/helpers/promotion_rules_helper_spec.rb +2 -0
  268. data/spec/spec_helper.rb +3 -1
  269. data/spec/support/appear_before_matcher.rb +2 -0
  270. data/spec/support/feature/base_feature_helper.rb +2 -0
  271. data/spec/support/feature/order_feature_helper.rb +2 -0
  272. data/spec/teaspoon_env.rb +3 -1
  273. data/spec/views/spree/admin/shared/navigation_footer_spec.rb +2 -1
  274. metadata +43 -35
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 677c8a507ac453e77774d4f96196b315b1ad706763c2611f0571f0eb53205e4c
4
- data.tar.gz: 14eea3e8b0daac22dce08b0b17f1991ca9359861b5a40d8485a49b299a61538f
3
+ metadata.gz: f79830d32bfa95c9482aeca3614e8d72742a3e9b565087d09b4bd42e296a2c15
4
+ data.tar.gz: deb28571eea0833eaef03429c6f1fc508e0f2516ccb7f006cb6a22f8d4788cd4
5
5
  SHA512:
6
- metadata.gz: 0031a89ed07fae86008cfa1a6b97d8b4d621508471516267360dcd1ca0411e5ee08cdc04aa78204e42a137e855ce49de59cd28959ee95c84d93eadeb151adbd6
7
- data.tar.gz: d6468cd42e1dc058457e6c68d6b0797158b99b528b8eb3dd0ff198428a96ce3970051ade41a592cf95f1cabd40ad45c9250fb81be65ac44b0b3f6eb5aadd101b
6
+ metadata.gz: dfdfd52a7a26db75deeb3180e2d4f70c68e0381fb74200de5ac35e97da95f1d0ef870aa48570e1d4fc2eb0c363e3f7cc1788a20a22b5032a812517e6be9936df
7
+ data.tar.gz: 2d009959f1e8c74be278aa12f28b0704ab6842a9597b908fe402e710213bf1fc6900e5d3562661653f4356c61ddd85992fdc99d6fadf8485820a30dd2add41f7
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
  require 'rake'
3
5
  require 'rake/testtask'
@@ -10,7 +12,7 @@ RSpec::Core::RakeTask.new
10
12
  task default: [:spec, 'spec:js']
11
13
 
12
14
  DummyApp::RakeTasks.new(
13
- gem_root: File.expand_path('../', __FILE__),
15
+ gem_root: File.expand_path(__dir__),
14
16
  lib_name: 'solidus_backend'
15
17
  )
16
18
 
@@ -26,7 +28,7 @@ task :teaspoon do
26
28
  driver_options: ENV["driver_options"],
27
29
  }
28
30
 
29
- options.delete_if { |k, v| v.nil? }
31
+ options.delete_if { |_k, v| v.nil? }
30
32
 
31
33
  abort("rake teaspoon failed") if Teaspoon::Console.new(options).failures?
32
34
  end
@@ -35,7 +37,7 @@ desc "Run javascript specs"
35
37
  task 'spec:js' => :teaspoon
36
38
 
37
39
  namespace :teaspoon do
38
- task :server do
40
+ task :server do
39
41
  require 'teaspoon'
40
42
  Rake::Task['dummy_environment'].invoke
41
43
  require 'teaspoon/server'
@@ -37,6 +37,7 @@
37
37
  //= require spree/backend/handlebars_extensions
38
38
  //= require spree/backend/images/index
39
39
  //= require spree/backend/images/upload
40
+ //= require spree/backend/locale_selection
40
41
  //= require spree/backend/navigation
41
42
  //= require spree/backend/option_type_autocomplete
42
43
  //= require spree/backend/option_value_picker
@@ -7,6 +7,7 @@
7
7
  //= require spree/backend/product_picker
8
8
  //= require spree/backend/option_value_picker
9
9
  //= require spree/backend/taxons
10
+ //= require spree/backend/highlight_negative_numbers
10
11
 
11
12
  /**
12
13
  This is a collection of javascript functions and whatnot
@@ -0,0 +1,14 @@
1
+ Spree.ready(function() {
2
+ // Highlight negative numbers in red.
3
+ document.querySelector('body').addEventListener('input', function(e){
4
+ var el = e.target;
5
+ var isInputNumber = el instanceof HTMLInputElement && el.type == 'number';
6
+ if (isInputNumber) {
7
+ if (el.value < 0) {
8
+ el.classList.add("negative");
9
+ } else {
10
+ el.classList.remove("negative");
11
+ }
12
+ }
13
+ });
14
+ });
@@ -0,0 +1,18 @@
1
+ Spree.ready(function() {
2
+ var localeSelect = document.querySelector('.js-locale-selection');
3
+ if (!localeSelect) return;
4
+
5
+ localeSelect.addEventListener('change', function() {
6
+ Spree.ajax({
7
+ type: "PUT",
8
+ dataType: "json",
9
+ url: Spree.pathFor("admin/locale/set"),
10
+ data: {
11
+ switch_to_locale: localeSelect.value
12
+ },
13
+ success: function(data) {
14
+ document.location.href = data.location;
15
+ }
16
+ });
17
+ });
18
+ });
@@ -1,5 +1,5 @@
1
1
  <a href="#" id="product_{{ id }}" data-product-id="{{ id }}" class="sort_item list-group-item">
2
2
  <i class="fa fa-sort"></i>
3
3
  <span class="product_name">{{ name }}</span>
4
- <span class="right">{{ display_price }}</span>
4
+ <span class="float-right">{{ display_price }}</span>
5
5
  </a>
@@ -11,10 +11,19 @@
11
11
  <td>
12
12
  {{#if editing}}
13
13
  <form>
14
- <input class="fullwidth" name="count_on_hand" type="number" value="{{count_on_hand}}">
14
+ <input
15
+ {{#if negative}}
16
+ class="fullwidth negative"
17
+ {{else}}
18
+ class="fullwidth"
19
+ {{/if}}
20
+ name="count_on_hand"
21
+ type="number"
22
+ value="{{count_on_hand}}"
23
+ >
15
24
  </form>
16
25
  {{else}}
17
- <span>{{count_on_hand}}</span>
26
+ <span {{#if negative}}class="negative"{{/if}}>{{count_on_hand}}</span>
18
27
  {{/if}}
19
28
  </td>
20
29
  <td class="actions">
@@ -4,6 +4,7 @@ Spree.Views.Stock.EditStockItemRow = Backbone.View.extend({
4
4
  initialize: function(options) {
5
5
  this.stockLocationName = options.stockLocationName;
6
6
  this.editing = false;
7
+ this.negative = this.model.attributes.count_on_hand < 0;
7
8
  this.render();
8
9
  },
9
10
 
@@ -19,7 +20,8 @@ Spree.Views.Stock.EditStockItemRow = Backbone.View.extend({
19
20
  render: function() {
20
21
  var renderAttr = {
21
22
  stockLocationName: this.stockLocationName,
22
- editing: this.editing
23
+ editing: this.editing,
24
+ negative: this.negative
23
25
  };
24
26
  _.extend(renderAttr, this.model.attributes);
25
27
  this.$el.attr("data-variant-id", this.model.get('variant_id'));
@@ -160,6 +160,10 @@ nav.menu {
160
160
  }
161
161
  }
162
162
 
163
+ .admin-locale-selection {
164
+ margin: 1em;
165
+ }
166
+
163
167
  .admin-nav.fits .admin-nav-footer {
164
168
  position: fixed;
165
169
  bottom: 0;
@@ -170,8 +174,8 @@ nav.menu {
170
174
 
171
175
  .admin-login-nav {
172
176
  list-style: none;
173
- margin: 0;
174
- padding: 1rem 0;
177
+ padding: 0;
178
+ margin: 1rem 0;
175
179
 
176
180
  li {
177
181
  padding: 0.3rem 1.2rem;
@@ -1,5 +1,5 @@
1
1
  // Make color very close to white
2
- @function very-light($color, $adjust: 3){
2
+ @function very-light($color, $adjust: 3){
3
3
  @if type-of($adjust) == 'number' and $adjust > 0 {
4
4
  @for $i from 0 through 100 {
5
5
  @if lighten($color, $i) == white and ($i - $adjust) > $adjust {
@@ -10,7 +10,6 @@
10
10
  @else {
11
11
  @debug "Please correct $adjust value. It should be number and larger then 0. Currently it is '#{type-of($adjust)}' with value '#{$adjust}'"
12
12
  }
13
- @return $color;
14
13
  };
15
14
 
16
15
  // Quick fix for dynamic variables missing in SASS
@@ -98,6 +98,9 @@ dl {
98
98
  .red { color: $color-5 }
99
99
  .yellow { color: $color-6 }
100
100
 
101
+ .negative { color: $red }
102
+ input[type="number"].negative { color: $red } // needed to override blue style that is more specific than '.negative'
103
+
101
104
  .no-objects-found {
102
105
  text-align: center;
103
106
  font-size: 120%;
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class AdjustmentReasonsController < ResourceController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class AdjustmentsController < ResourceController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class BaseController < Spree::BaseController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class CancellationsController < Spree::Admin::BaseController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class CustomerReturnsController < ResourceController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class DashboardsController < BaseController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class GeneralSettingsController < Spree::Admin::BaseController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class ImagesController < ResourceController
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spree
4
+ module Admin
5
+ class LocaleController < Spree::Admin::BaseController
6
+ def set
7
+ locale = params[:switch_to_locale].to_s.presence
8
+
9
+ if locale && I18n.available_locales.include?(locale.to_sym)
10
+ I18n.locale = locale
11
+ session[:locale] = locale
12
+
13
+ respond_to do |format|
14
+ format.json { render json: { locale: locale, location: spree.admin_url } }
15
+ end
16
+ else
17
+ respond_to do |format|
18
+ format.json { render json: { locale: I18n.locale }, status: 404 }
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class LogEntriesController < Spree::Admin::BaseController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class OptionTypesController < ResourceController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class OptionValuesController < Spree::Admin::BaseController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  module Orders
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class OrdersController < Spree::Admin::BaseController
@@ -30,7 +32,7 @@ module Spree
30
32
  if params[:q][:created_at_gt].present?
31
33
  params[:q][:created_at_gt] = begin
32
34
  Time.zone.parse(params[:q][:created_at_gt]).beginning_of_day
33
- rescue
35
+ rescue StandardError
34
36
  ""
35
37
  end
36
38
  end
@@ -38,7 +40,7 @@ module Spree
38
40
  if params[:q][:created_at_lt].present?
39
41
  params[:q][:created_at_lt] = begin
40
42
  Time.zone.parse(params[:q][:created_at_lt]).end_of_day
41
- rescue
43
+ rescue StandardError
42
44
  ""
43
45
  end
44
46
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class PaymentMethodsController < ResourceController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class PaymentsController < Spree::Admin::BaseController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class PricesController < ResourceController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class ProductPropertiesController < ResourceController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class ProductsController < ResourceController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Spree::Admin::PromotionActionsController < Spree::Admin::BaseController
2
4
  before_action :load_promotion, only: [:create, :destroy]
3
5
  before_action :validate_promotion_action_type, only: :create
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class PromotionCategoriesController < ResourceController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class PromotionCodeBatchesController < ResourceController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'csv'
2
4
 
3
5
  module Spree
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Spree::Admin::PromotionRulesController < Spree::Admin::BaseController
2
4
  helper 'spree/promotion_rules'
3
5
 
@@ -33,6 +35,10 @@ class Spree::Admin::PromotionRulesController < Spree::Admin::BaseController
33
35
  @promotion = Spree::Promotion.find(params[:promotion_id])
34
36
  end
35
37
 
38
+ def model_class
39
+ Spree::PromotionRule
40
+ end
41
+
36
42
  def validate_promotion_rule_type
37
43
  requested_type = params[:promotion_rule].delete(:type)
38
44
  promotion_rule_types = Rails.application.config.spree.promotions.rules
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class PromotionsController < ResourceController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class PropertiesController < ResourceController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class RefundReasonsController < ResourceController
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module Admin
3
5
  class RefundsController < ResourceController