diff --git a/app/views/admin/standing_orders/_filters.html.haml b/app/views/admin/standing_orders/_filters.html.haml index 50501b0e6e..f56136e53d 100644 --- a/app/views/admin/standing_orders/_filters.html.haml +++ b/app/views/admin/standing_orders/_filters.html.haml @@ -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 diff --git a/app/views/admin/standing_orders/_table.html.haml b/app/views/admin/standing_orders/_table.html.haml index 4efd8437b1..545ca58505 100644 --- a/app/views/admin/standing_orders/_table.html.haml +++ b/app/views/admin/standing_orders/_table.html.haml @@ -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' } } diff --git a/spec/features/admin/standing_orders_spec.rb b/spec/features/admin/standing_orders_spec.rb index 599a00d538..139252be70 100644 --- a/spec/features/admin/standing_orders_spec.rb +++ b/spec/features/admin/standing_orders_spec.rb @@ -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