mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Distributors and products displayed on edit
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
%td.active= check_box_tag 'order_cycle_exchange_{{ $index }}_active', 1, 1, 'ng-model' => 'exchange.active', 'id' => 'order_cycle_exchange_{{ $index }}_active'
|
||||
%td.supplier_name {{ enterprises[exchange.enterprise_id].name }}
|
||||
%td{:class => "#{type}_name"} {{ enterprises[exchange.enterprise_id].name }}
|
||||
%td.products
|
||||
= f.submit 'Products', 'ng-click' => 'toggleProducts($event, exchange)'
|
||||
{{ exchangeSelectedVariants(exchange) }} / {{ enterpriseTotalVariants(enterprises[exchange.enterprise_id]) }} selected
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
%th Products
|
||||
%tbody{'ng-repeat' => 'exchange in order_cycle.incoming_exchanges'}
|
||||
%tr.supplier
|
||||
= render 'exchange_form', :f => f
|
||||
= render 'exchange_form', :f => f, :type => 'supplier'
|
||||
%tr.products{'ng-show' => 'exchange.showProducts'}
|
||||
= render 'exchange_supplied_products_form'
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
%th Products
|
||||
%tbody{'ng-repeat' => 'exchange in order_cycle.outgoing_exchanges'}
|
||||
%tr.distributor
|
||||
= render 'exchange_form', :f => f
|
||||
= render 'exchange_form', :f => f, :type => 'distributor'
|
||||
%tr.products{'ng-show' => 'exchange.showProducts'}
|
||||
= render 'exchange_distributed_products_form'
|
||||
|
||||
|
||||
@@ -108,7 +108,20 @@ feature %q{
|
||||
page.all('table.exchanges tbody tr.supplier').each do |row|
|
||||
row.find('td.products input').click
|
||||
|
||||
products_row = page.find('table.exchanges tr.products')
|
||||
products_row = page.all('table.exchanges tr.products').select { |r| r.visible? }.first
|
||||
products_row.should have_selector "input[type='checkbox'][checked='checked']"
|
||||
|
||||
row.find('td.products input').click
|
||||
end
|
||||
|
||||
# And I should see the distributors with products
|
||||
page.should have_selector 'td.distributor_name', :text => oc.distributors.first.name
|
||||
page.should have_selector 'td.distributor_name', :text => oc.distributors.last.name
|
||||
|
||||
page.all('table.exchanges tbody tr.distributor').each do |row|
|
||||
row.find('td.products input').click
|
||||
|
||||
products_row = page.all('table.exchanges tr.products').select { |r| r.visible? }.first
|
||||
products_row.should have_selector "input[type='checkbox'][checked='checked']"
|
||||
|
||||
row.find('td.products input').click
|
||||
|
||||
Reference in New Issue
Block a user