mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-02 02:11:33 +00:00
SO Index: standing orders can be filtered using quick search
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
.row.filters
|
||||
.sixteen.columns.alpha.omega
|
||||
.filter_select.five.columns.alpha
|
||||
|
||||
-# %label{ :for => 'quick_search', ng: {class: '{disabled: !shop_id}'} }=t('admin.quick_search')
|
||||
-# %br
|
||||
-# %input.fullwidth{ :type => "text", :id => 'quick_search', ng: { model: 'quickSearch', disabled: '!shop_id' }, :placeholder => "Search by email..." }
|
||||
%label{ :for => 'query', ng: {class: '{disabled: !shop_id}'} }=t('admin.quick_search')
|
||||
%br
|
||||
%input.fullwidth{ :type => "text", :id => 'query', ng: { model: 'query', disabled: '!shop_id'}, :placeholder => "Search by email..." }
|
||||
.filter_select.four.columns
|
||||
%label{ :for => 'shop_id', ng: { bind: "shop_id ? '#{t('admin.shop')}' : '#{t('admin.variant_overrides.index.select_a_shop')}'" } }
|
||||
%br
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
= t('admin.shipping_method')
|
||||
-# %th.actions
|
||||
-#
|
||||
%tr.standing_order{ :id => "so_{{standingOrder.id}}", ng: { repeat: "standingOrder in standingOrders", class: { even: "'even'", odd: "'odd'" } } }
|
||||
%tr.standing_order{ :id => "so_{{standingOrder.id}}", ng: { repeat: "standingOrder in standingOrders | filter:query", class: { even: "'even'", odd: "'odd'" } } }
|
||||
%td.customer{ ng: { show: 'columns.customer.visible', bind: '::standingOrder.customer.email' } }
|
||||
%td.schedule{ ng: { show: 'columns.schedule.visible', bind: '::standingOrder.schedule.name' } }
|
||||
%td.payment_method{ ng: { show: 'columns.payment_method.visible', bind: '::standingOrder.payment_method.name' } }
|
||||
|
||||
@@ -31,6 +31,13 @@ feature 'Standing Orders' do
|
||||
within "tr#so_#{standing_order2.id}" do
|
||||
expect(page).to have_selector "td.customer", text: standing_order2.customer.email
|
||||
end
|
||||
|
||||
# Filters standing orders according to query
|
||||
expect(page).to have_selector "tr#so_#{standing_order2.id}"
|
||||
fill_in 'query', with: 'blah blah blah'
|
||||
expect(page).to have_no_selector "tr#so_#{standing_order2.id}"
|
||||
fill_in 'query', with: ''
|
||||
expect(page).to have_selector "tr#so_#{standing_order2.id}"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user