Skip to content

Commit

Permalink
[#5746] Hide incoming projects on the Kanban Overview page
Browse files Browse the repository at this point in the history
  • Loading branch information
edavis10 committed Jun 1, 2011
1 parent 6d46d2c commit 7597f60
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/controllers/kanban_overviews_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def show

@projects_sorted_by_tree = []
Project.project_tree(@kanban.projects) do |project, level|
next if kanban_settings['incoming_projects'].present? && kanban_settings['incoming_projects'].include?(project.id.to_s)
@projects_sorted_by_tree << project
end

Expand Down
14 changes: 14 additions & 0 deletions app/views/settings/_kanban_general.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,17 @@
<br />
<%= content_tag(:span, l(:kanban_text_simple_issue_popup_form_help)) %>
</p>

<p>
<%= content_tag(:label, l(:kanban_label_incoming_projects)) %>
<% incoming_projects = @settings['incoming_projects'] || []
incoming_projects.collect!(&:to_i) if incoming_projects.present?
%>
<%= select_tag("settings[incoming_projects]",
content_tag(:option, '') +
options_from_collection_for_select(Project.all,
:id,
:name,
incoming_projects),
:multiple => true) %>
</p>
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ en:
text_assigned_kanban_title: "My Assignments"
text_assigned_to_user_kanban_title: "{{user}}'s Assignments"
label_switch_assignee: "Switch Assignee"
kanban_label_incoming_projects: "Incoming projects"

3 changes: 2 additions & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
'overview' => {
'subissues_take_higher_priority' => 0
}
}
},
'incoming_projects' => []
})

menu(:top_menu,
Expand Down
12 changes: 12 additions & 0 deletions test/integration/kanban_overview_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ def setup

assert_select "#kanban div.project-lane.horizontal-lane", :text => /#{@project.name}/i
end

should "skip the Incoming Projects" do
@incoming_project = incoming_project
Member.generate!({:principal => @user, :project => @incoming_project, :roles => [@role, Role.find_by_name('KanbanRole')]})

reconfigure_plugin({'incoming_projects' => [@incoming_project.id.to_s]})

login_as
visit_kanban_overview

assert_select "#kanban", :text => /#{@incoming_project.name}/i, :count => 0
end

should "have a row for each project's user" do
login_as
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def make_users(count = 3)
end
end

def make_project
def incoming_project
incoming_project = Project.generate!(:name => 'Incoming project')
tracker = Tracker.generate!(:name => 'Feature')
incoming_project.trackers << tracker
Expand Down

0 comments on commit 7597f60

Please sign in to comment.