SO Index: Adding column dropdown

This commit is contained in:
Rob Harrington
2016-10-07 15:20:53 +11:00
parent a395f183f9
commit af9376b60c
5 changed files with 18 additions and 3 deletions

View File

@@ -1 +1 @@
angular.module("admin.standingOrders", ['ngResource','admin.indexUtils'])
angular.module("admin.standingOrders", ['ngResource','admin.indexUtils','admin.dropdown'])

View 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}" }

View File

@@ -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')

View File

@@ -9,4 +9,5 @@
%div{ ng: { controller: 'StandingOrdersController' } }
= render 'filters'
= render 'controls'
= render 'table'

View File

@@ -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