Merge branch 'ce_backport_issue_5128' into 'master'

CE backport - Allow viewing only one board when multiple issue boards is not enabled

See merge request gitlab-org/gitlab-ce!19068
This commit is contained in:
Rémy Coutable 2018-05-23 12:57:36 +00:00
commit a2dbca4a27
2 changed files with 14 additions and 6 deletions

View file

@ -2,19 +2,24 @@ class Groups::BoardsController < Groups::ApplicationController
include BoardsResponses
before_action :assign_endpoint_vars
before_action :boards, only: :index
def index
@boards = Boards::ListService.new(group, current_user).execute
respond_with_boards
end
def show
@board = group.boards.find(params[:id])
@board = boards.find(params[:id])
respond_with_board
end
private
def boards
@boards ||= Boards::ListService.new(group, current_user).execute
end
def assign_endpoint_vars
@boards_endpoint = group_boards_url(group)
@namespace_path = group.to_param

View file

@ -4,22 +4,25 @@ class Projects::BoardsController < Projects::ApplicationController
before_action :check_issues_available!
before_action :authorize_read_board!, only: [:index, :show]
before_action :boards, only: :index
before_action :assign_endpoint_vars
def index
@boards = Boards::ListService.new(project, current_user).execute
respond_with_boards
end
def show
@board = project.boards.find(params[:id])
@board = boards.find(params[:id])
respond_with_board
end
private
def boards
@boards ||= Boards::ListService.new(project, current_user).execute
end
def assign_endpoint_vars
@boards_endpoint = project_boards_path(project)
@bulk_issues_path = bulk_update_project_issues_path(project)