Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused Batch Actions code #2021

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,4 @@ window.AA.DropdownMenu = class AA.DropdownMenu

(($) ->
$.widget.bridge 'aaDropdownMenu', AA.DropdownMenu

$ ->
$(".dropdown_menu").aaDropdownMenu()
)(jQuery)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $ ->
window.location.search = ''

# Batch Actions dropdown
$('.dropdown_button').popover()
$('.dropdown_menu').aaDropdownMenu()

# Filter form: don't send any inputs that are empty
$('#q_search').submit ->
Expand Down
3 changes: 1 addition & 2 deletions lib/active_admin/batch_actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
require "active_admin/batch_actions/controller"

# Add our Extensions
ActiveAdmin::Resource.send :include, ActiveAdmin::BatchActions::ResourceExtension
ActiveAdmin::Resource.send :include, ActiveAdmin::BatchActions::ResourceExtension
ActiveAdmin::ResourceController.send :include, ActiveAdmin::BatchActions::Controller

# Require all the views
require "active_admin/batch_actions/views/batch_action_form"
require "active_admin/batch_actions/views/batch_action_popover"
require "active_admin/batch_actions/views/selection_cells"
require "active_admin/batch_actions/views/batch_action_selector"

Expand Down
28 changes: 0 additions & 28 deletions lib/active_admin/batch_actions/views/batch_action_popover.rb

This file was deleted.

9 changes: 0 additions & 9 deletions lib/active_admin/batch_actions/views/batch_action_selector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,6 @@ def batch_actions_to_display
end
end

# def build_batch_action_button
# a :class => 'table_tools_button dropdown_button disabled', :href => "#batch_actions_popover", :id => "batch_actions_button" do
# text_node I18n.t("active_admin.batch_actions.button_label")
# end
# end

# def build_batch_action_popover
# end

end

end
Expand Down
2 changes: 1 addition & 1 deletion lib/active_admin/batch_actions/views/selection_cells.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ResourceSelectionToggleCell < ActiveAdmin::Component
builder_method :resource_selection_toggle_cell

def build
input( :type => "checkbox", :id => "collection_selection_toggle_all", :name => "collection_selection_toggle_all", :class => "toggle_all" )
input :type => "checkbox", :id => "collection_selection_toggle_all", :name => "collection_selection_toggle_all", :class => "toggle_all"
end
end

Expand Down
32 changes: 14 additions & 18 deletions spec/unit/views/components/batch_action_popover_spec.rb
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
require 'spec_helper'
require 'active_admin/batch_actions/views/batch_action_popover'
require 'active_admin/batch_actions/views/batch_action_selector'

describe ActiveAdmin::BatchActions::BatchActionPopover do
describe ActiveAdmin::BatchActions::BatchActionSelector do

let(:the_popover) do
render_arbre_component do
batch_action_popover do
action ActiveAdmin::BatchAction.new( :action_1, "Action 1" )
action ActiveAdmin::BatchAction.new( :action_2, "Action 2" )
action ActiveAdmin::BatchAction.new( :action_3, "Action 3" )
end
batch_action_selector [
ActiveAdmin::BatchAction.new(:action_1, "Action 1"),
ActiveAdmin::BatchAction.new(:action_2, "Action 2"),
ActiveAdmin::BatchAction.new(:action_3, "Action 3")
]
end
end

it "should have an id" do
the_popover.id.should == "batch_actions_popover"
end


describe "the action list" do
subject do
the_popover.find_by_class("popover_contents").first
the_popover.find_by_class("dropdown_menu_list").first
end

# This should pass...
its(:tag_name) { should eql("ul") }

its(:content){ should include("<li><a href=\"#\" class=\"batch_action\" data-action=\"action_1\">Action 1 Selected</a></li>") }
its(:content){ should include("<li><a href=\"#\" class=\"batch_action\" data-action=\"action_2\">Action 2 Selected</a></li>") }
its(:content){ should include("<li><a href=\"#\" class=\"batch_action\" data-action=\"action_3\">Action 3 Selected</a></li>") }


its(:content){ should include('<li><a href="#" class="batch_action" data-action="action_1">Action 1 Selected</a></li>') }
its(:content){ should include('<li><a href="#" class="batch_action" data-action="action_2">Action 2 Selected</a></li>') }
its(:content){ should include('<li><a href="#" class="batch_action" data-action="action_3">Action 3 Selected</a></li>') }
end

end