gitlab-org--gitlab-foss/app/services/boards/create_service.rb
Phil Hughes f452c1aa7d Expand/collapse close & backlog lists in issue boards
The closed & backlog lists in issue boards are no collapsible. They can
be collapsed independently of each other & this selection is then saved
to the browser through localStorage. When the page loads, the code gets
the data from localStorage & determines whether to show or hide the list

Closes #23917
2017-05-31 12:34:54 +01:00

21 lines
371 B
Ruby

module Boards
class CreateService < BaseService
def execute
if project.boards.empty?
create_board!
else
project.boards.first
end
end
private
def create_board!
board = project.boards.create
board.lists.create(list_type: :backlog)
board.lists.create(list_type: :closed)
board
end
end
end