Taskboard is a resource different from sprint

pull/6827/head
Mark Maglana 14 years ago
parent 612b86ae7d
commit 4c322e1dbe
  1. 9
      app/controllers/rb_application_controller.rb
  2. 23
      app/controllers/rb_sprints_controller.rb
  3. 17
      app/controllers/rb_taskboards_controller.rb
  4. 2
      app/views/rb_master_backlogs/_backlog.html.erb
  5. 3
      app/views/rb_sprints/_sprint.html.erb
  6. 0
      app/views/rb_taskboards/show.html.erb
  7. 1
      config/routes.rb
  8. 12
      features/step_definitions/_given_steps.rb
  9. 22
      init.rb

@ -10,9 +10,11 @@ class RbApplicationController < ApplicationController
# determine if User.current has permission to invoke the method in question.
def load_project
@project = if ['rb_sprints',
'rb_taskboards',
'rb_burndown_charts',
'rb_wikis'].include? params[:controller]
Sprint.find(params[:id]).project
load_sprint
@sprint.project
elsif ['rb_queries',
'rb_master_backlogs',
@ -34,5 +36,8 @@ class RbApplicationController < ApplicationController
end
end
end
def load_sprint
@sprint = Sprint.find(params[:id])
end
end

@ -1,21 +1,12 @@
include RbCommonHelper
# Responsible for exposing sprint CRUD. It SHOULD NOT be used
# for displaying the taskboard since the taskboard is a management
# interface used for managing objects within a sprint. For
# info about the taskboard, see RbTaskboardsController
class RbSprintsController < RbApplicationController
unloadable
before_filter :load_sprint
def show
@statuses = Tracker.find_by_id(Task.tracker).issue_statuses
@story_ids = @sprint.stories.map{|s| s.id}
@last_updated = Task.find(:first,
:conditions => ["parent_id in (?)", @story_ids],
:order => "updated_on DESC")
respond_to do |format|
format.html { render :layout => "backlogs" }
end
end
def update
attribs = params.select{|k,v| k != 'id' and Sprint.column_names.include? k }
attribs = Hash[*attribs.flatten]
@ -26,11 +17,5 @@ class RbSprintsController < RbApplicationController
format.html { render :text => status, :status => status }
end
end
private
def load_sprint
@sprint = Sprint.find(params[:id])
end
end

@ -0,0 +1,17 @@
include RbCommonHelper
class RbTaskboardsController < RbApplicationController
unloadable
def show
@statuses = Tracker.find_by_id(Task.tracker).issue_statuses
@story_ids = @sprint.stories.map{|s| s.id}
@last_updated = Task.find(:first,
:conditions => ["parent_id in (?)", @story_ids],
:order => "updated_on DESC")
respond_to do |format|
format.html { render :layout => "backlogs" }
end
end
end

@ -14,7 +14,7 @@
[
{
:item => menu_link(l(:label_task_board), {
:controller => 'rb_sprints',
:controller => 'rb_taskboards',
:action => 'show',
:id => backlog }),
:for => :sprint

@ -0,0 +1,3 @@
<div class="sprint">
### TODO ###
</div>

@ -15,6 +15,7 @@ ActionController::Routing::Routes.draw do |map|
rb.resources :stories, :only => :index, :controller => :rb_stories, :as => "stories/:project_id"
rb.resources :sprints, :only => [:show, :update], :controller => :rb_sprints
rb.resources :server_variables, :only => :show, :controller => :rb_server_variables
rb.resources :taskboards, :only => :show, :controller => :rb_taskboards
rb.resources :master_backlogs, :only => :show, :controller => :rb_master_backlogs
end

@ -10,14 +10,14 @@ end
Given /^I am a scrum master of the project$/ do
role = Role.find(:first, :conditions => "name='Manager'")
role.permissions << :view_master_backlog
role.permissions << :view_sprints
role.permissions << :view_taskboards
role.permissions << :update_sprints
role.permissions << :update_stories
role.permissions << :subscribe_to_calendar
role.permissions << :edit_wiki_pages
role.permissions << :view_wiki_pages
role.permissions << :create_impediments
role.permissions << :update_impediments
role.permissions << :subscribe_to_calendars
role.permissions << :view_wiki_pages # NOTE: This is a Redmine core permission
role.permissions << :edit_wiki_pages # NOTE: This is a Redmine core permission
role.save!
login_as_scrum_master
end
@ -25,7 +25,7 @@ end
Given /^I am a team member of the project$/ do
role = Role.find(:first, :conditions => "name='Manager'")
role.permissions << :view_master_backlog
role.permissions << :view_sprints
role.permissions << :view_taskboards
role.permissions << :create_tasks
role.permissions << :update_tasks
role.save!
@ -49,7 +49,7 @@ end
Given /^I am viewing the taskboard for (.+)$/ do |sprint_name|
@sprint = Sprint.find(:first, :conditions => "name='#{sprint_name}'")
visit url_for(:controller => :rb_sprints, :action => :show, :id => @sprint.id)
visit url_for(:controller => :rb_taskboards, :action => :show, :id => @sprint.id)
page.driver.response.status.should == 200
end

@ -37,6 +37,8 @@ Redmine::Plugin.register :redmine_backlogs do
# Master backlog permissions
permission :view_master_backlog, {
:rb_master_backlogs => :show,
:rb_sprints => [:index, :show],
:rb_wikis => :show,
:rb_stories => [:index, :show],
:rb_queries => :show,
:rb_server_variables => :show,
@ -44,19 +46,24 @@ Redmine::Plugin.register :redmine_backlogs do
:rb_updated_items => :show
}
# Sprint permissions
permission :view_sprints, {
permission :view_taskboards, {
:rb_taskboards => :show,
:rb_sprints => :show,
:rb_stories => [:index, :show],
:rb_tasks => [:index, :show],
:rb_impediments => [:index, :show],
:rb_wikis => :show,
:rb_server_variables => :show,
:rb_burndown_charts => :show,
:rb_updated_items => :show
}
# Sprint permissions
# :show_sprints and :list_sprints are implicit in :view_master_backlog permission
permission :update_sprints, {
:rb_sprints => [:edit, :update],
:rb_wikis => [:show, :edit]
}
:rb_wikis => [:edit, :update]
}
# Story permissions
# :show_stories and :list_stories are implicit in :view_master_backlog permission
@ -73,11 +80,8 @@ Redmine::Plugin.register :redmine_backlogs do
permission :create_impediments, { :rb_impediments => [:new, :create] }
permission :update_impediments, { :rb_impediments => [:edit, :update] }
permission :subscribe_to_calendar, { :rb_calendars => :show }
permission :view_scrum_statistics, { :rb_statistics => :show }
# Let Redmine wiki permissions take care of this since rb_wiki just does a redirect
permission :view_sprint_wiki, { :rb_wikis => :all }, :public => true
permission :subscribe_to_calendars, { :rb_calendars => :show }
permission :view_scrum_statistics, { :rb_statistics => :show }
end
menu :project_menu, :backlogs, { :controller => :rb_master_backlogs, :action => :show }, :caption => :label_backlogs, :after => :issues, :params => :project_id

Loading…
Cancel
Save