mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-07 22:46:06 +00:00
SO Index: Adding column dropdown
This commit is contained in:
@@ -1 +1 @@
|
||||
angular.module("admin.standingOrders", ['ngResource','admin.indexUtils'])
|
||||
angular.module("admin.standingOrders", ['ngResource','admin.indexUtils','admin.dropdown'])
|
||||
|
||||
6
app/views/admin/standing_orders/_controls.html.haml
Normal file
6
app/views/admin/standing_orders/_controls.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
%hr.divider.sixteen.columns.alpha.omega{ ng: { show: 'shop_id && standingOrders.length > 0' } }
|
||||
.controls.sixteen.columns.alpha.omega{ ng: { show: 'shop_id && standingOrders.length > 0' } }
|
||||
.twelve.columns.alpha
|
||||
|
||||
.four.columns.omega
|
||||
%columns-dropdown{ action: "#{controller_name}_#{action_name}" }
|
||||
@@ -8,7 +8,7 @@
|
||||
-# %input{ :type => "checkbox", :name => 'toggle_bulk', 'ng-click' => 'toggleAllCheckboxes()', 'ng-checked' => "allBoxesChecked()" }
|
||||
%th.customer{ ng: { show: 'columns.customer.visible' } }
|
||||
= t('admin.customer')
|
||||
%th.schedule{ ng: { show: 'columns.customer.visible', } }
|
||||
%th.schedule{ ng: { show: 'columns.schedule.visible', } }
|
||||
= t('admin.schedule')
|
||||
%th.payment_method{ ng: { show: 'columns.payment_method.visible', } }
|
||||
= t('admin.payment_method')
|
||||
|
||||
@@ -9,4 +9,5 @@
|
||||
|
||||
%div{ ng: { controller: 'StandingOrdersController' } }
|
||||
= render 'filters'
|
||||
= render 'controls'
|
||||
= render 'table'
|
||||
|
||||
@@ -43,12 +43,20 @@ feature 'Standing Orders' do
|
||||
expect(page).to have_selector "td.customer", text: standing_order.customer.email
|
||||
end
|
||||
|
||||
# Filters standing orders according to query
|
||||
# Using the Quick Search
|
||||
expect(page).to have_selector "tr#so_#{standing_order.id}"
|
||||
fill_in 'query', with: 'blah blah blah'
|
||||
expect(page).to have_no_selector "tr#so_#{standing_order.id}"
|
||||
fill_in 'query', with: ''
|
||||
expect(page).to have_selector "tr#so_#{standing_order.id}"
|
||||
|
||||
# Toggling columns
|
||||
expect(page).to have_selector "th.customer"
|
||||
expect(page).to have_content standing_order.customer.email
|
||||
first("div#columns-dropdown", :text => "COLUMNS").click
|
||||
first("div#columns-dropdown div.menu div.menu_item", text: "Customer").click
|
||||
expect(page).to_not have_selector "th.customer"
|
||||
expect(page).to_not have_content standing_order.customer.email
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user