solidus_backend 1.3.2 → 1.4.0.beta1
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.
- checksums.yaml +4 -4
- data/README.md +38 -0
- data/app/assets/javascripts/spree/backend/components/tooltips.js +2 -0
- data/app/assets/javascripts/spree/backend/product_picker.js +2 -2
- data/app/assets/javascripts/spree/backend/routes.js +0 -1
- data/app/assets/javascripts/spree/backend/shipments.js +147 -118
- data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +16 -14
- data/app/assets/javascripts/spree/backend/templates/orders/customer_details/autocomplete.hbs +1 -1
- data/app/assets/javascripts/spree/backend/templates/variants/autocomplete.hbs.erb +1 -1
- data/app/assets/javascripts/spree/backend/templates/variants/line_items_autocomplete_stock.hbs +1 -1
- data/app/assets/javascripts/spree/backend/templates/variants/split.hbs +25 -27
- data/app/assets/javascripts/spree/backend/user_picker.js +14 -8
- data/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss +3 -3
- data/app/assets/stylesheets/spree/backend/components/_breadcrumb.scss +4 -0
- data/app/assets/stylesheets/spree/backend/components/_date-picker.scss +0 -1
- data/app/assets/stylesheets/spree/backend/components/_hint.scss +3 -0
- data/app/assets/stylesheets/spree/backend/components/_navigation.scss +0 -1
- data/app/assets/stylesheets/spree/backend/components/_progress.scss +5 -2
- data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +14 -5
- data/app/assets/stylesheets/spree/backend/components/_states.scss +1 -2
- data/app/assets/stylesheets/spree/backend/globals/_mixins.css +2 -0
- data/app/assets/stylesheets/spree/backend/globals/mixins/_line_through.scss +22 -0
- data/app/assets/stylesheets/spree/backend/plugins/_select2.scss +12 -3
- data/app/assets/stylesheets/spree/backend/sections/_products.scss +25 -7
- data/app/assets/stylesheets/spree/backend/sections/_promotions.scss +0 -1
- data/app/assets/stylesheets/spree/backend/sections/_transfer_items.scss +0 -1
- data/app/assets/stylesheets/spree/backend/shared/_forms.scss +4 -6
- data/app/assets/stylesheets/spree/backend/shared/_header.scss +5 -2
- data/app/assets/stylesheets/spree/backend/shared/_layout.scss +36 -3
- data/app/assets/stylesheets/spree/backend/shared/_tables.scss +1 -3
- data/app/assets/stylesheets/spree/backend/shared/_typography.scss +0 -2
- data/app/assets/stylesheets/spree/backend/spree_admin.scss +3 -1
- data/app/controllers/spree/admin/cancellations_controller.rb +1 -1
- data/app/controllers/spree/admin/general_settings_controller.rb +0 -6
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +7 -0
- data/app/controllers/spree/admin/orders_controller.rb +1 -1
- data/app/controllers/spree/admin/payment_methods_controller.rb +8 -3
- data/app/controllers/spree/admin/payments_controller.rb +12 -5
- data/app/controllers/spree/admin/products_controller.rb +1 -1
- data/app/controllers/spree/admin/refunds_controller.rb +1 -1
- data/app/controllers/spree/admin/reimbursements_controller.rb +1 -1
- data/app/controllers/spree/admin/root_controller.rb +1 -1
- data/app/controllers/spree/admin/stock_items_controller.rb +0 -8
- data/app/controllers/spree/admin/stock_transfers_controller.rb +6 -6
- data/app/controllers/spree/admin/users_controller.rb +7 -3
- data/app/helpers/spree/admin/base_helper.rb +11 -0
- data/app/helpers/spree/admin/navigation_helper.rb +46 -3
- data/app/helpers/spree/admin/orders_helper.rb +0 -1
- data/app/helpers/spree/admin/stock_locations_helper.rb +1 -5
- data/app/models/spree/backend_configuration.rb +100 -0
- data/app/views/spree/admin/adjustment_reasons/edit.html.erb +4 -7
- data/app/views/spree/admin/adjustment_reasons/index.html.erb +4 -4
- data/app/views/spree/admin/adjustment_reasons/new.html.erb +4 -4
- data/app/views/spree/admin/adjustments/edit.html.erb +4 -6
- data/app/views/spree/admin/adjustments/index.html.erb +3 -6
- data/app/views/spree/admin/adjustments/new.html.erb +5 -6
- data/app/views/spree/admin/cancellations/index.html.erb +4 -3
- data/app/views/spree/admin/countries/edit.html.erb +4 -6
- data/app/views/spree/admin/countries/index.html.erb +4 -4
- data/app/views/spree/admin/countries/new.html.erb +4 -4
- data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +1 -1
- data/app/views/spree/admin/customer_returns/edit.html.erb +4 -6
- data/app/views/spree/admin/customer_returns/index.html.erb +2 -5
- data/app/views/spree/admin/customer_returns/new.html.erb +5 -6
- data/app/views/spree/admin/general_settings/edit.html.erb +4 -28
- data/app/views/spree/admin/images/edit.html.erb +6 -2
- data/app/views/spree/admin/images/index.html.erb +3 -0
- data/app/views/spree/admin/images/new.html.erb +3 -3
- data/app/views/spree/admin/log_entries/index.html.erb +4 -8
- data/app/views/spree/admin/option_types/edit.html.erb +7 -9
- data/app/views/spree/admin/option_types/index.html.erb +4 -4
- data/app/views/spree/admin/orders/_shipment.html.erb +4 -1
- data/app/views/spree/admin/orders/_shipment_manifest.html.erb +4 -1
- data/app/views/spree/admin/orders/cart.html.erb +4 -8
- data/app/views/spree/admin/orders/confirm.html.erb +3 -4
- data/app/views/spree/admin/orders/confirm/_payments.html.erb +1 -1
- data/app/views/spree/admin/orders/confirm_advance.html.erb +3 -4
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +1 -1
- data/app/views/spree/admin/orders/customer_details/edit.html.erb +2 -4
- data/app/views/spree/admin/orders/customer_details/show.html.erb +3 -5
- data/app/views/spree/admin/orders/edit.html.erb +1 -8
- data/app/views/spree/admin/orders/index.html.erb +11 -5
- data/app/views/spree/admin/payment_methods/edit.html.erb +5 -7
- data/app/views/spree/admin/payment_methods/index.html.erb +6 -5
- data/app/views/spree/admin/payment_methods/new.html.erb +6 -7
- data/app/views/spree/admin/payments/_capture_events.html.erb +1 -1
- data/app/views/spree/admin/payments/credit.html.erb +3 -3
- data/app/views/spree/admin/payments/index.html.erb +4 -7
- data/app/views/spree/admin/payments/new.html.erb +4 -5
- data/app/views/spree/admin/payments/show.html.erb +4 -7
- data/app/views/spree/admin/prices/_form.html.erb +1 -0
- data/app/views/spree/admin/prices/index.html.erb +2 -2
- data/app/views/spree/admin/product_properties/index.html.erb +3 -1
- data/app/views/spree/admin/products/_form.html.erb +11 -18
- data/app/views/spree/admin/products/_properties_form.erb +1 -1
- data/app/views/spree/admin/products/edit.html.erb +3 -2
- data/app/views/spree/admin/products/index.html.erb +19 -28
- data/app/views/spree/admin/products/new.html.erb +4 -2
- data/app/views/spree/admin/promotion_categories/edit.html.erb +4 -3
- data/app/views/spree/admin/promotion_categories/index.html.erb +4 -4
- data/app/views/spree/admin/promotion_categories/new.html.erb +4 -3
- data/app/views/spree/admin/promotion_rules/create.js.erb +1 -1
- data/app/views/spree/admin/promotions/_actions.html.erb +3 -3
- data/app/views/spree/admin/promotions/_rules.html.erb +2 -2
- data/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +1 -1
- data/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +1 -1
- data/app/views/spree/admin/promotions/edit.html.erb +4 -5
- data/app/views/spree/admin/promotions/index.html.erb +3 -5
- data/app/views/spree/admin/promotions/new.html.erb +3 -3
- data/app/views/spree/admin/promotions/rules/_option_value.html.erb +2 -2
- data/app/views/spree/admin/properties/edit.html.erb +3 -6
- data/app/views/spree/admin/properties/index.html.erb +5 -5
- data/app/views/spree/admin/prototypes/_form.html.erb +3 -3
- data/app/views/spree/admin/prototypes/_prototypes.html.erb +1 -1
- data/app/views/spree/admin/prototypes/edit.html.erb +3 -6
- data/app/views/spree/admin/prototypes/index.html.erb +4 -4
- data/app/views/spree/admin/prototypes/show.html.erb +2 -2
- data/app/views/spree/admin/refund_reasons/edit.html.erb +4 -4
- data/app/views/spree/admin/refund_reasons/index.html.erb +5 -4
- data/app/views/spree/admin/refund_reasons/new.html.erb +5 -4
- data/app/views/spree/admin/refunds/edit.html.erb +5 -6
- data/app/views/spree/admin/refunds/new.html.erb +6 -6
- data/app/views/spree/admin/reimbursement_types/index.html.erb +4 -3
- data/app/views/spree/admin/reimbursements/edit.html.erb +5 -6
- data/app/views/spree/admin/reimbursements/index.html.erb +2 -4
- data/app/views/spree/admin/reimbursements/show.html.erb +3 -4
- data/app/views/spree/admin/reports/index.html.erb +2 -3
- data/app/views/spree/admin/reports/sales_total.html.erb +2 -4
- data/app/views/spree/admin/return_authorizations/edit.html.erb +15 -16
- data/app/views/spree/admin/return_authorizations/index.html.erb +3 -5
- data/app/views/spree/admin/return_authorizations/new.html.erb +5 -6
- data/app/views/spree/admin/return_reasons/edit.html.erb +3 -2
- data/app/views/spree/admin/return_reasons/index.html.erb +3 -1
- data/app/views/spree/admin/return_reasons/new.html.erb +4 -2
- data/app/views/spree/admin/shared/_areas_tabs.html.erb +3 -3
- data/app/views/spree/admin/shared/_configuration_menu.html.erb +2 -2
- data/app/views/spree/admin/shared/_edit_resource_links.html.erb +2 -2
- data/app/views/spree/admin/shared/_head.html.erb +1 -8
- data/app/views/spree/admin/shared/_header.html.erb +8 -12
- data/app/views/spree/admin/shared/_new_resource_links.html.erb +2 -2
- data/app/views/spree/admin/shared/_no_objects_found.html.erb +1 -1
- data/app/views/spree/admin/shared/_order_submenu.html.erb +10 -10
- data/app/views/spree/admin/shared/_order_summary.html.erb +1 -1
- data/app/views/spree/admin/shared/_order_tabs.html.erb +3 -3
- data/app/views/spree/admin/shared/_payments_tabs.html.erb +1 -1
- data/app/views/spree/admin/shared/_product_sub_menu.html.erb +2 -2
- data/app/views/spree/admin/shared/_product_tabs.html.erb +8 -9
- data/app/views/spree/admin/shared/_report_criteria.html.erb +2 -2
- data/app/views/spree/admin/shared/_report_order_criteria.html.erb +2 -2
- data/app/views/spree/admin/shared/_settings_checkout_tabs.html.erb +4 -4
- data/app/views/spree/admin/shared/_settings_sub_menu.html.erb +5 -5
- data/app/views/spree/admin/shared/_shipping_tabs.html.erb +4 -3
- data/app/views/spree/admin/shared/_sidebar.html.erb +1 -1
- data/app/views/spree/admin/shared/_tabs.html.erb +12 -37
- data/app/views/spree/admin/shared/_taxes_tabs.html.erb +2 -2
- data/app/views/spree/admin/shared/_variant_search.html.erb +1 -1
- data/app/views/spree/admin/shared/named_types/_edit.html.erb +5 -5
- data/app/views/spree/admin/shared/named_types/_index.html.erb +5 -4
- data/app/views/spree/admin/shared/named_types/_new.html.erb +5 -4
- data/app/views/spree/admin/shipping_categories/edit.html.erb +5 -6
- data/app/views/spree/admin/shipping_categories/index.html.erb +5 -4
- data/app/views/spree/admin/shipping_categories/new.html.erb +5 -6
- data/app/views/spree/admin/shipping_methods/_form.html.erb +2 -2
- data/app/views/spree/admin/shipping_methods/edit.html.erb +5 -6
- data/app/views/spree/admin/shipping_methods/index.html.erb +5 -5
- data/app/views/spree/admin/shipping_methods/new.html.erb +5 -6
- data/app/views/spree/admin/states/edit.html.erb +5 -6
- data/app/views/spree/admin/states/index.html.erb +5 -4
- data/app/views/spree/admin/states/new.html.erb +5 -3
- data/app/views/spree/admin/stock_items/index.html.erb +4 -7
- data/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb +2 -2
- data/app/views/spree/admin/stock_locations/edit.html.erb +5 -5
- data/app/views/spree/admin/stock_locations/index.html.erb +16 -9
- data/app/views/spree/admin/stock_locations/new.html.erb +5 -4
- data/app/views/spree/admin/stock_movements/index.html.erb +3 -4
- data/app/views/spree/admin/stock_movements/new.html.erb +2 -3
- data/app/views/spree/admin/stock_transfers/_location.html.erb +7 -0
- data/app/views/spree/admin/stock_transfers/_transfer_item_table.html.erb +1 -1
- data/app/views/spree/admin/stock_transfers/edit.html.erb +5 -6
- data/app/views/spree/admin/stock_transfers/index.html.erb +5 -5
- data/app/views/spree/admin/stock_transfers/new.html.erb +6 -8
- data/app/views/spree/admin/stock_transfers/receive.html.erb +4 -12
- data/app/views/spree/admin/stock_transfers/show.html.erb +6 -12
- data/app/views/spree/admin/stock_transfers/tracking_info.html.erb +5 -13
- data/app/views/spree/admin/store_credits/edit_amount.html.erb +6 -4
- data/app/views/spree/admin/store_credits/edit_validity.html.erb +8 -6
- data/app/views/spree/admin/store_credits/index.html.erb +5 -5
- data/app/views/spree/admin/store_credits/new.html.erb +5 -4
- data/app/views/spree/admin/store_credits/show.html.erb +5 -4
- data/app/views/spree/admin/style_guide/topics/typography/_icons.html.erb +2 -2
- data/app/views/spree/admin/tax_categories/edit.html.erb +5 -4
- data/app/views/spree/admin/tax_categories/index.html.erb +5 -4
- data/app/views/spree/admin/tax_categories/new.html.erb +5 -4
- data/app/views/spree/admin/tax_rates/edit.html.erb +5 -6
- data/app/views/spree/admin/tax_rates/index.html.erb +5 -4
- data/app/views/spree/admin/tax_rates/new.html.erb +5 -6
- data/app/views/spree/admin/taxonomies/edit.erb +7 -9
- data/app/views/spree/admin/taxonomies/index.html.erb +4 -4
- data/app/views/spree/admin/taxonomies/new.html.erb +5 -7
- data/app/views/spree/admin/taxons/edit.html.erb +5 -6
- data/app/views/spree/admin/taxons/index.html.erb +2 -3
- data/app/views/spree/admin/trackers/edit.html.erb +5 -6
- data/app/views/spree/admin/trackers/index.html.erb +4 -4
- data/app/views/spree/admin/trackers/new.html.erb +4 -6
- data/app/views/spree/admin/users/_form.html.erb +2 -2
- data/app/views/spree/admin/users/_tabs.html.erb +5 -5
- data/app/views/spree/admin/users/_user_page_actions.html.erb +1 -4
- data/app/views/spree/admin/users/addresses.html.erb +5 -4
- data/app/views/spree/admin/users/edit.html.erb +6 -6
- data/app/views/spree/admin/users/index.html.erb +4 -5
- data/app/views/spree/admin/users/items.html.erb +4 -3
- data/app/views/spree/admin/users/new.html.erb +2 -9
- data/app/views/spree/admin/users/orders.html.erb +4 -3
- data/app/views/spree/admin/variants/_form.html.erb +1 -0
- data/app/views/spree/admin/variants/edit.html.erb +4 -3
- data/app/views/spree/admin/variants/index.html.erb +10 -8
- data/app/views/spree/admin/variants/new.html.erb +5 -0
- data/app/views/spree/admin/zones/_country_members.html.erb +2 -2
- data/app/views/spree/admin/zones/_state_members.html.erb +2 -2
- data/app/views/spree/admin/zones/edit.html.erb +5 -6
- data/app/views/spree/admin/zones/index.html.erb +5 -4
- data/app/views/spree/admin/zones/new.html.erb +6 -7
- data/app/views/spree/layouts/admin.html.erb +28 -15
- data/config/initializers/form_builder.rb +6 -0
- data/config/routes.rb +2 -6
- data/spec/controllers/spree/admin/cancellations_controller_spec.rb +3 -3
- data/spec/controllers/spree/admin/customer_returns_controller_spec.rb +4 -4
- data/spec/controllers/spree/admin/missing_products_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +5 -5
- data/spec/controllers/spree/admin/orders_controller_spec.rb +28 -28
- data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +5 -5
- data/spec/controllers/spree/admin/payments_controller_spec.rb +7 -7
- data/spec/controllers/spree/admin/prices_controller_spec.rb +2 -2
- data/spec/controllers/spree/admin/product_properties_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/products_controller_spec.rb +6 -6
- data/spec/controllers/spree/admin/promotion_actions_controller_spec.rb +2 -2
- data/spec/controllers/spree/admin/promotion_codes_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/promotion_rules_controller_spec.rb +2 -2
- data/spec/controllers/spree/admin/promotions_controller_spec.rb +7 -7
- data/spec/controllers/spree/admin/refunds_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +5 -5
- data/spec/controllers/spree/admin/reports_controller_spec.rb +2 -2
- data/spec/controllers/spree/admin/resource_controller_spec.rb +6 -6
- data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +11 -11
- data/spec/controllers/spree/admin/return_items_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/search_controller_spec.rb +2 -2
- data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/stock_items_controller_spec.rb +3 -3
- data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +3 -3
- data/spec/controllers/spree/admin/stock_transfers_controller_spec.rb +10 -10
- data/spec/controllers/spree/admin/store_credits_controller_spec.rb +10 -10
- data/spec/controllers/spree/admin/users_controller_spec.rb +139 -141
- data/spec/controllers/spree/admin/variants_controller_spec.rb +2 -2
- data/spec/features/admin/configuration/general_settings_spec.rb +7 -16
- data/spec/features/admin/configuration/payment_methods_spec.rb +7 -7
- data/spec/features/admin/configuration/stock_locations_spec.rb +1 -1
- data/spec/features/admin/configuration/tax_categories_spec.rb +1 -1
- data/spec/features/admin/configuration/zones_spec.rb +1 -1
- data/spec/features/admin/homepage_spec.rb +2 -2
- data/spec/features/admin/orders/adjustments_spec.rb +1 -1
- data/spec/features/admin/orders/cancelling_inventory_spec.rb +8 -8
- data/spec/features/admin/orders/customer_details_spec.rb +20 -5
- data/spec/features/admin/orders/listing_spec.rb +97 -70
- data/spec/features/admin/orders/new_order_spec.rb +35 -6
- data/spec/features/admin/orders/order_details_spec.rb +37 -58
- data/spec/features/admin/orders/payments_spec.rb +57 -4
- data/spec/features/admin/orders/return_authorizations_spec.rb +25 -0
- data/spec/features/admin/orders/shipments_spec.rb +5 -5
- data/spec/features/admin/products/edit/products_spec.rb +1 -1
- data/spec/features/admin/products/edit/taxons_spec.rb +5 -5
- data/spec/features/admin/products/edit/variants_spec.rb +1 -1
- data/spec/features/admin/products/option_types_spec.rb +2 -2
- data/spec/features/admin/products/products_spec.rb +6 -6
- data/spec/features/admin/products/properties_spec.rb +6 -6
- data/spec/features/admin/products/prototypes_spec.rb +1 -1
- data/spec/features/admin/products/stock_management_spec.rb +5 -5
- data/spec/features/admin/promotion_adjustments_spec.rb +8 -8
- data/spec/features/admin/promotions/option_value_rule_spec.rb +4 -4
- data/spec/features/admin/promotions/product_rule_spec.rb +33 -0
- data/spec/features/admin/promotions/tiered_calculator_spec.rb +2 -2
- data/spec/features/admin/promotions/user_rule_spec.rb +15 -0
- data/spec/features/admin/reports_spec.rb +1 -1
- data/spec/features/admin/users_spec.rb +27 -2
- data/spec/helpers/admin/base_helper_spec.rb +30 -0
- data/spec/helpers/admin/navigation_helper_spec.rb +40 -2
- data/spec/spec_helper.rb +10 -8
- data/spec/support/feature/order_feature_helper.rb +17 -0
- metadata +18 -11
- data/app/assets/javascripts/spree/backend/general_settings.js.coffee +0 -13
- data/spec/controllers/spree/admin/general_settings_controller_spec.rb +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c121c41301d41542d9b3fe3941b3acdd6a3e29d1
|
4
|
+
data.tar.gz: 8293cff794592075ee3638aa926873579d906541
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f8ea23a0cf50a9688efacb4a0b653e88544cb53b0eae2779267e0044ede4cf7c4888b13205f762f4d27f25c357bae56c2acad46daf0f5bf7c4c444dc95b748d
|
7
|
+
data.tar.gz: 04c77a3933e864fad64848f820b311ca8c0ce8014e417bac20735536835cb4ff98d5c9e1305dcceb459d1acacf9e5e26eb89fcbb9f75f16bb763cb2d5e764636
|
data/README.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# solidus\_backend
|
2
|
+
|
3
|
+
Backend contains the controllers, views, and assets making up the admin interface of solidus.
|
4
|
+
|
5
|
+
## Assets
|
6
|
+
|
7
|
+
### Javascript
|
8
|
+
|
9
|
+
Can be found in [app/assets/javascripts/spree/backend/](./app/assets/javascripts/spree/backend/)
|
10
|
+
|
11
|
+
Out scripts are written in a mix of coffeescript and javascript. We can't
|
12
|
+
easily use a transpiler for ECMAScript >= 6 without adding additional steps for
|
13
|
+
applications using solidus\_admin.
|
14
|
+
|
15
|
+
As a result, we accept contributions in either plain-ol javascript or
|
16
|
+
CoffeeScript, and discourage converting existing files.
|
17
|
+
|
18
|
+
### Stylesheets
|
19
|
+
|
20
|
+
Can be found in [app/assets/stylesheets/spree/backend/](./app/assets/stylesheets/spree/backend/)
|
21
|
+
|
22
|
+
The stylesheets are written in SCSS and include all of [bourbon](http://bourbon.io/docs/) and [bootstrap 4 alpha](http://v4-alpha.getbootstrap.com/).
|
23
|
+
|
24
|
+
When running the application there is a styleguide available at:
|
25
|
+
|
26
|
+
```
|
27
|
+
/admin/style_guide
|
28
|
+
```
|
29
|
+
|
30
|
+
## Testing
|
31
|
+
|
32
|
+
Create the test site
|
33
|
+
|
34
|
+
bundle exec rake test_app
|
35
|
+
|
36
|
+
Run the tests
|
37
|
+
|
38
|
+
bundle exec rake spec
|
@@ -1,6 +1,5 @@
|
|
1
1
|
Spree.routes.checkouts_api = Spree.pathFor('api/checkouts')
|
2
2
|
Spree.routes.classifications_api = Spree.pathFor('api/classifications')
|
3
|
-
Spree.routes.clear_cache = Spree.pathFor('admin/general_settings/clear_cache')
|
4
3
|
Spree.routes.option_value_search = Spree.pathFor('api/option_values')
|
5
4
|
Spree.routes.option_type_search = Spree.pathFor('api/option_types')
|
6
5
|
Spree.routes.orders_api = Spree.pathFor('api/orders')
|
@@ -102,86 +102,6 @@ adjustShipmentItems = function(shipment_number, variant_id, quantity){
|
|
102
102
|
}
|
103
103
|
};
|
104
104
|
|
105
|
-
startItemSplit = function(event){
|
106
|
-
event.preventDefault();
|
107
|
-
var link = $(this);
|
108
|
-
link.parent().find('a.split-item').toggle();
|
109
|
-
link.parent().find('a.delete-item').toggle();
|
110
|
-
var variant_id = link.data('variant-id');
|
111
|
-
|
112
|
-
Spree.ajax({
|
113
|
-
type: "GET",
|
114
|
-
url: Spree.routes.variants_api + "/" + variant_id,
|
115
|
-
}).success(function(variant){
|
116
|
-
var max_quantity = link.closest('tr').data('item-quantity');
|
117
|
-
var split_item_template = HandlebarsTemplates['variants/split'];
|
118
|
-
link.closest('tr').after(split_item_template({ variant: variant, shipments: shipments, max_quantity: max_quantity }));
|
119
|
-
|
120
|
-
$('#item_stock_location').select2({
|
121
|
-
width: 'resolve',
|
122
|
-
placeholder: Spree.translations.item_stock_placeholder,
|
123
|
-
minimumResultsForSearch: 8
|
124
|
-
});
|
125
|
-
});
|
126
|
-
};
|
127
|
-
|
128
|
-
completeItemSplit = function(event) {
|
129
|
-
event.preventDefault();
|
130
|
-
|
131
|
-
if($('#item_stock_location').val() === ""){
|
132
|
-
alert('Please select the split destination.');
|
133
|
-
return false;
|
134
|
-
}
|
135
|
-
|
136
|
-
var link = $(this);
|
137
|
-
var stock_item_row = link.closest('tr');
|
138
|
-
var variant_id = stock_item_row.data('variant-id');
|
139
|
-
var quantity = stock_item_row.find('#item_quantity').val();
|
140
|
-
|
141
|
-
var stock_location_id = stock_item_row.find('#item_stock_location').val();
|
142
|
-
var original_shipment_number = link.closest('tbody').data('shipment-number');
|
143
|
-
|
144
|
-
var selected_shipment = stock_item_row.find($('#item_stock_location').select2('data').element);
|
145
|
-
var target_shipment_number = selected_shipment.data('shipment-number');
|
146
|
-
var new_shipment = selected_shipment.data('new-shipment');
|
147
|
-
|
148
|
-
if (stock_location_id != 'new_shipment') {
|
149
|
-
if (new_shipment != undefined) {
|
150
|
-
// TRANSFER TO A NEW LOCATION
|
151
|
-
Spree.ajax({
|
152
|
-
type: "POST",
|
153
|
-
url: Spree.routes.shipments_api + "/transfer_to_location",
|
154
|
-
data: {
|
155
|
-
original_shipment_number: original_shipment_number,
|
156
|
-
variant_id: variant_id,
|
157
|
-
quantity: quantity,
|
158
|
-
stock_location_id: stock_location_id
|
159
|
-
}
|
160
|
-
}).error(function(msg) {
|
161
|
-
alert(msg.responseJSON['message']);
|
162
|
-
}).done(function() {
|
163
|
-
window.Spree.advanceOrder();
|
164
|
-
});
|
165
|
-
} else {
|
166
|
-
// TRANSFER TO AN EXISTING SHIPMENT
|
167
|
-
Spree.ajax({
|
168
|
-
type: "POST",
|
169
|
-
url: Spree.routes.shipments_api + "/transfer_to_shipment",
|
170
|
-
data: {
|
171
|
-
original_shipment_number: original_shipment_number,
|
172
|
-
target_shipment_number: target_shipment_number,
|
173
|
-
variant_id: variant_id,
|
174
|
-
quantity: quantity
|
175
|
-
}
|
176
|
-
}).error(function(msg) {
|
177
|
-
alert(msg.responseJSON['message']);
|
178
|
-
}).done(function() {
|
179
|
-
window.Spree.advanceOrder();
|
180
|
-
});
|
181
|
-
}
|
182
|
-
}
|
183
|
-
};
|
184
|
-
|
185
105
|
addVariantFromStockLocation = function(stock_location_id, variant_id, quantity) {
|
186
106
|
var shipment = _.find(shipments, function(shipment){
|
187
107
|
return shipment.stock_location_id == stock_location_id && (shipment.state == 'ready' || shipment.state == 'pending');
|
@@ -193,7 +113,7 @@ addVariantFromStockLocation = function(stock_location_id, variant_id, quantity)
|
|
193
113
|
url: Spree.routes.shipments_api,
|
194
114
|
data: {
|
195
115
|
shipment: {
|
196
|
-
order_id: order_number
|
116
|
+
order_id: window.order_number
|
197
117
|
},
|
198
118
|
variant_id: variant_id,
|
199
119
|
quantity: quantity,
|
@@ -208,62 +128,171 @@ addVariantFromStockLocation = function(stock_location_id, variant_id, quantity)
|
|
208
128
|
}
|
209
129
|
};
|
210
130
|
|
211
|
-
var
|
212
|
-
|
213
|
-
|
214
|
-
var shipment_number = tbody.data("shipment-number");
|
215
|
-
this.shipment_number = shipment_number;
|
216
|
-
this.order_number = tbody.data("order-number");
|
131
|
+
var ShipmentSplitItemView = Backbone.View.extend({
|
132
|
+
tagName: 'tr',
|
133
|
+
className: 'stock-item-split',
|
217
134
|
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
135
|
+
initialize: function(options) {
|
136
|
+
this.variant = options.variant;
|
137
|
+
this.shipments = options.shipments;
|
138
|
+
this.shipment_number = options.shipment_number;
|
139
|
+
this.max_quantity = options.max_quantity;
|
140
|
+
this.shipmentItemView = options.shipmentItemView;
|
141
|
+
this.render()
|
224
142
|
},
|
225
143
|
|
226
144
|
events: {
|
227
|
-
"click
|
228
|
-
|
229
|
-
|
230
|
-
"click a.cancel-split": "cancelItemSplit",
|
231
|
-
"click a.save-split": "completeItemSplit",
|
145
|
+
"click .cancel-split": "cancelItemSplit",
|
146
|
+
"click .save-split": "completeItemSplit",
|
147
|
+
},
|
232
148
|
|
233
|
-
|
234
|
-
|
235
|
-
"click a.save-method": "saveMethod",
|
149
|
+
cancelItemSplit: function(e){
|
150
|
+
e.preventDefault();
|
236
151
|
|
237
|
-
|
238
|
-
|
239
|
-
"click a.save-tracking": "saveTracking",
|
152
|
+
this.shipmentItemView.removeSplit();
|
153
|
+
this.remove();
|
240
154
|
},
|
241
155
|
|
242
|
-
|
156
|
+
completeItemSplit: function(e){
|
243
157
|
e.preventDefault();
|
244
|
-
if (confirm(Spree.translations.are_you_sure_delete)) {
|
245
|
-
var del = $(e.currentTarget);
|
246
|
-
var variant_id = del.data('variant-id');
|
247
158
|
|
248
|
-
|
159
|
+
var quantity = this.$('.quantity').val();
|
160
|
+
var target = this.$('[name="item_stock_location"]').val().split(':');
|
161
|
+
var target_type = target[0];
|
162
|
+
var target_id = target[1];
|
163
|
+
|
164
|
+
var split_attr = {
|
165
|
+
original_shipment_number: this.shipment_number,
|
166
|
+
variant_id: this.variant.id,
|
167
|
+
quantity: quantity
|
168
|
+
};
|
169
|
+
var jqXHR;
|
170
|
+
if (target_type == 'stock_location') {
|
171
|
+
// transfer to a new location
|
172
|
+
split_attr.stock_location_id = target_id;
|
173
|
+
jqXHR = Spree.ajax({
|
174
|
+
type: "POST",
|
175
|
+
url: Spree.routes.shipments_api + "/transfer_to_location",
|
176
|
+
data: split_attr
|
177
|
+
});
|
178
|
+
} else if (target_type == 'shipment') {
|
179
|
+
// transfer to an existing shipment
|
180
|
+
split_attr.target_shipment_number = target_id;
|
181
|
+
jqXHR = Spree.ajax({
|
182
|
+
type: "POST",
|
183
|
+
url: Spree.routes.shipments_api + "/transfer_to_shipment",
|
184
|
+
data: split_attr
|
185
|
+
});
|
186
|
+
} else {
|
187
|
+
alert('Please select the split destination.');
|
188
|
+
return false;
|
249
189
|
}
|
190
|
+
jqXHR.error(function(msg) {
|
191
|
+
alert(msg.responseJSON['message']);
|
192
|
+
}).done(function() {
|
193
|
+
window.Spree.advanceOrder();
|
194
|
+
});
|
195
|
+
},
|
196
|
+
|
197
|
+
template: HandlebarsTemplates['variants/split'],
|
198
|
+
|
199
|
+
render: function() {
|
200
|
+
/* Only display other shipments */
|
201
|
+
var shipments = _.reject(this.shipments, _.matcher({'number': this.shipment_number}))
|
202
|
+
|
203
|
+
var renderAttr = {
|
204
|
+
variant: this.variant,
|
205
|
+
shipments: shipments,
|
206
|
+
max_quantity: this.max_quantity
|
207
|
+
};
|
208
|
+
this.$el.html(this.template(renderAttr));
|
209
|
+
|
210
|
+
this.$('[name="item_stock_location"]').select2({
|
211
|
+
width: 'resolve',
|
212
|
+
placeholder: Spree.translations.item_stock_placeholder,
|
213
|
+
minimumResultsForSearch: 8
|
214
|
+
});
|
215
|
+
}
|
216
|
+
});
|
217
|
+
|
218
|
+
var ShipmentItemView = Backbone.View.extend({
|
219
|
+
initialize: function(options) {
|
220
|
+
this.shipment_number = options.shipment_number
|
221
|
+
this.order_number = options.order_number
|
222
|
+
this.quantity = this.$el.data('item-quantity')
|
223
|
+
this.variant_id = this.$el.data('variant-id')
|
224
|
+
},
|
225
|
+
|
226
|
+
events: {
|
227
|
+
"click .delete-item": "onDelete",
|
228
|
+
"click .split-item": "onSplit",
|
250
229
|
},
|
251
230
|
|
252
|
-
|
231
|
+
removeSplit: function() {
|
232
|
+
this.$('.split-item').show();
|
233
|
+
this.$('.delete-item').show();
|
234
|
+
},
|
235
|
+
|
236
|
+
onSplit: function(e) {
|
253
237
|
e.preventDefault();
|
254
|
-
|
238
|
+
this.$('.split-item').toggle();
|
239
|
+
this.$('.delete-item').toggle();
|
240
|
+
|
241
|
+
var _this = this;
|
242
|
+
Spree.ajax({
|
243
|
+
type: "GET",
|
244
|
+
url: Spree.routes.variants_api + "/" + this.variant_id,
|
245
|
+
}).success(function(variant){
|
246
|
+
var split = new ShipmentSplitItemView({
|
247
|
+
shipmentItemView: _this,
|
248
|
+
shipment_number: _this.shipment_number,
|
249
|
+
variant: variant,
|
250
|
+
shipments: window.shipments,
|
251
|
+
max_quantity: _this.quantity
|
252
|
+
});
|
253
|
+
|
254
|
+
_this.$el.after(split.$el);
|
255
|
+
});
|
255
256
|
},
|
256
257
|
|
257
|
-
|
258
|
+
onDelete: function(e){
|
258
259
|
e.preventDefault();
|
260
|
+
if (confirm(Spree.translations.are_you_sure_delete)) {
|
261
|
+
adjustShipmentItems(this.shipment_number, this.variant_id, 0);
|
262
|
+
}
|
263
|
+
},
|
264
|
+
});
|
259
265
|
|
260
|
-
|
261
|
-
|
262
|
-
this.$(
|
266
|
+
var ShipmentEditView = Backbone.View.extend({
|
267
|
+
initialize: function(){
|
268
|
+
var tbody = this.$("tbody[data-order-number][data-shipment-number]");
|
269
|
+
this.shipment_number = tbody.data("shipment-number");
|
270
|
+
this.order_number = tbody.data("order-number");
|
271
|
+
|
272
|
+
var shipmentView = this;
|
273
|
+
this.$("form.admin-ship-shipment").each(function(el){
|
274
|
+
new ShipShipmentView({
|
275
|
+
el: this,
|
276
|
+
shipment_number: shipmentView.shipment_number
|
277
|
+
});
|
278
|
+
});
|
279
|
+
this.$(".stock-item").each(function(){
|
280
|
+
new ShipmentItemView({
|
281
|
+
el: this,
|
282
|
+
shipment_number: shipmentView.shipment_number,
|
283
|
+
order_number: shipmentView.order_number
|
284
|
+
});
|
285
|
+
});
|
263
286
|
},
|
264
287
|
|
265
|
-
|
266
|
-
|
288
|
+
events: {
|
289
|
+
"click a.edit-method": "toggleMethodEdit",
|
290
|
+
"click a.cancel-method": "toggleMethodEdit",
|
291
|
+
"click a.save-method": "saveMethod",
|
292
|
+
|
293
|
+
"click a.edit-tracking": "toggleTrackingEdit",
|
294
|
+
"click a.cancel-tracking": "toggleTrackingEdit",
|
295
|
+
"click a.save-tracking": "saveTracking",
|
267
296
|
},
|
268
297
|
|
269
298
|
toggleMethodEdit: function(e){
|
@@ -290,7 +319,7 @@ var ShipmentEditView = Backbone.View.extend({
|
|
290
319
|
|
291
320
|
saveTracking: function(e) {
|
292
321
|
e.preventDefault();
|
293
|
-
var tracking = this.$('
|
322
|
+
var tracking = this.$('[name="tracking"]').val();
|
294
323
|
var _this = this;
|
295
324
|
updateShipment(this.shipment_number, {
|
296
325
|
tracking: tracking
|
@@ -1,12 +1,7 @@
|
|
1
|
-
|
1
|
+
$.fn.taxonAutocomplete = function () {
|
2
|
+
'use strict';
|
2
3
|
|
3
|
-
|
4
|
-
function formatTaxon(taxon) {
|
5
|
-
return Select2.util.escapeMarkup(taxon.pretty_name);
|
6
|
-
}
|
7
|
-
|
8
|
-
if ($('#product_taxon_ids').length > 0) {
|
9
|
-
$('#product_taxon_ids').select2({
|
4
|
+
this.select2({
|
10
5
|
placeholder: Spree.translations.taxon_placeholder,
|
11
6
|
multiple: true,
|
12
7
|
initSelection: function (element, callback) {
|
@@ -24,7 +19,6 @@ var set_taxon_select = function(){
|
|
24
19
|
},
|
25
20
|
ajax: {
|
26
21
|
url: Spree.routes.taxons_search,
|
27
|
-
params: { "headers": { "X-Spree-Token": Spree.api_key } },
|
28
22
|
datatype: 'json',
|
29
23
|
data: function (term, page) {
|
30
24
|
return {
|
@@ -45,12 +39,20 @@ var set_taxon_select = function(){
|
|
45
39
|
};
|
46
40
|
}
|
47
41
|
},
|
48
|
-
formatResult:
|
49
|
-
|
42
|
+
formatResult: function (taxon, container, query, escapeMarkup) {
|
43
|
+
return escapeMarkup(taxon.pretty_name);
|
44
|
+
},
|
45
|
+
formatSelection: function (taxon, container, escapeMarkup) {
|
46
|
+
return escapeMarkup(taxon.pretty_name);
|
47
|
+
}
|
50
48
|
});
|
51
|
-
|
52
|
-
}
|
49
|
+
};
|
53
50
|
|
54
51
|
$(document).ready(function () {
|
55
|
-
|
52
|
+
$('#product_taxon_ids, .taxon_picker').taxonAutocomplete();
|
56
53
|
});
|
54
|
+
|
55
|
+
// for backwards compat...
|
56
|
+
var set_taxon_select = function() {
|
57
|
+
$('#product_taxon_ids, .taxon_picker').taxonAutocomplete();
|
58
|
+
}
|
data/app/assets/javascripts/spree/backend/templates/orders/customer_details/autocomplete.hbs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class='customer-autocomplete-item'>
|
2
2
|
<div class='customer-details'>
|
3
|
-
<
|
3
|
+
<span class="customer-email">{{customer.email}}</span>
|
4
4
|
{{#if bill_address.firstname }}
|
5
5
|
<strong>{{t 'bill_address' }}</strong>
|
6
6
|
{{bill_address.firstname}} {{bill_address.lastname}}<br>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
<div class="media-body">
|
11
11
|
<h6 class="media-heading">{{variant.name}}</h6>
|
12
|
-
<dl class="dl-collapse">
|
12
|
+
<dl class="media-content dl-collapse">
|
13
13
|
{{#if variant.option_values}}
|
14
14
|
{{#each variant.option_values}}
|
15
15
|
<dt>{{this.option_type_presentation}}:</dt>
|