diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 18:08:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 18:08:52 +0300 |
commit | 0ab47b994caa80c5587f33dc818626b66cfdafe2 (patch) | |
tree | 5ef3976d2f84e3368903a67ba2dbd87a74b9a43c /app/services/boards | |
parent | 1308dc5eb484ab0f8064989fc551ebdb4b1a7976 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/boards')
-rw-r--r-- | app/services/boards/list_service.rb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/app/services/boards/list_service.rb b/app/services/boards/list_service.rb index c6dfd62804f..729bca6580e 100644 --- a/app/services/boards/list_service.rb +++ b/app/services/boards/list_service.rb @@ -5,13 +5,7 @@ module Boards def execute(create_default_board: true) create_board! if create_default_board && parent.boards.empty? - if parent.multiple_issue_boards_available? - boards - else - # When multiple issue boards are not available - # a user is only allowed to view the default shown board - first_board - end + find_boards end private @@ -27,5 +21,18 @@ module Boards def create_board! Boards::CreateService.new(parent, current_user).execute end + + def find_boards + found = + if parent.multiple_issue_boards_available? + boards + else + # When multiple issue boards are not available + # a user is only allowed to view the default shown board + first_board + end + + params[:board_id].present? ? [found.find(params[:board_id])] : found + end end end |