mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Removed order.shipments_path from order serializer. In order list page the shipment state is now a label, not a link. The shipmeents page is gone in spree 2
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
class Api::Admin::OrderSerializer < ActiveModel::Serializer
|
||||
attributes :id, :number, :full_name, :email, :phone, :completed_at, :display_total
|
||||
attributes :show_path, :edit_path, :state, :payment_state, :shipment_state
|
||||
attributes :payments_path, :shipments_path, :ship_path, :ready_to_ship, :created_at
|
||||
attributes :payments_path, :ship_path, :ready_to_ship, :created_at
|
||||
attributes :distributor_name, :special_instructions, :payment_capture_path
|
||||
|
||||
has_one :distributor, serializer: Api::Admin::IdSerializer
|
||||
@@ -30,11 +30,6 @@ class Api::Admin::OrderSerializer < ActiveModel::Serializer
|
||||
spree_routes_helper.admin_order_payments_path(object)
|
||||
end
|
||||
|
||||
def shipments_path
|
||||
return '' unless object.shipment_state
|
||||
spree_routes_helper.admin_order_shipments_path(object)
|
||||
end
|
||||
|
||||
def ship_path
|
||||
spree_routes_helper.fire_admin_order_path(object, e: 'ship')
|
||||
end
|
||||
|
||||
@@ -61,8 +61,7 @@
|
||||
{{'payment_states.' + order.payment_state | t}}
|
||||
%td.align-center
|
||||
%span.state{'ng-class' => 'order.shipment_state', 'ng-if' => 'order.shipment_state'}
|
||||
%a{'ng-href' => '{{order.shipments_path}}' }
|
||||
{{'shipment_states.' + order.shipment_state | t}}
|
||||
{{'shipment_states.' + order.shipment_state | t}}
|
||||
%td
|
||||
= mail_to "{{order.email}}"
|
||||
%td.align-center
|
||||
|
||||
Reference in New Issue
Block a user