2018-09-25 23:45:43 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-01 12:09:41 -04:00
|
|
|
class Projects::BoardsController < Projects::ApplicationController
|
2019-06-17 08:58:48 -04:00
|
|
|
include MultipleBoardsActions
|
2017-08-31 13:48:57 -04:00
|
|
|
include IssuableCollections
|
2016-08-15 18:50:23 -04:00
|
|
|
|
2018-01-08 04:06:25 -05:00
|
|
|
before_action :check_issues_available!
|
2017-08-28 17:56:49 -04:00
|
|
|
before_action :assign_endpoint_vars
|
2020-11-30 16:09:16 -05:00
|
|
|
before_action do
|
2022-05-06 11:09:03 -04:00
|
|
|
push_frontend_feature_flag(:board_multi_select, project)
|
|
|
|
push_frontend_feature_flag(:realtime_labels, project&.group)
|
2021-11-02 08:12:25 -04:00
|
|
|
experiment(:prominent_create_board_btn, subject: current_user) do |e|
|
2022-02-04 16:16:06 -05:00
|
|
|
e.control { }
|
|
|
|
e.candidate { }
|
2021-11-02 08:12:25 -04:00
|
|
|
end.run
|
2020-11-30 16:09:16 -05:00
|
|
|
end
|
2016-08-08 18:03:41 -04:00
|
|
|
|
2021-10-27 11:13:41 -04:00
|
|
|
feature_category :team_planning
|
2022-05-13 11:07:43 -04:00
|
|
|
urgency :low
|
2020-10-08 14:08:32 -04:00
|
|
|
|
2016-08-08 18:03:41 -04:00
|
|
|
private
|
|
|
|
|
2021-02-12 04:08:48 -05:00
|
|
|
def board_klass
|
|
|
|
Board
|
|
|
|
end
|
|
|
|
|
|
|
|
def boards_finder
|
|
|
|
strong_memoize :boards_finder do
|
2021-03-05 04:09:07 -05:00
|
|
|
Boards::BoardsFinder.new(parent, current_user)
|
2021-02-12 04:08:48 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def board_finder
|
|
|
|
strong_memoize :board_finder do
|
2021-03-05 04:09:07 -05:00
|
|
|
Boards::BoardsFinder.new(parent, current_user, board_id: params[:id])
|
2021-02-12 04:08:48 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def board_create_service
|
|
|
|
strong_memoize :board_create_service do
|
|
|
|
Boards::CreateService.new(parent, current_user)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-08-28 17:56:49 -04:00
|
|
|
def assign_endpoint_vars
|
2017-12-03 13:46:07 -05:00
|
|
|
@boards_endpoint = project_boards_path(project)
|
2017-08-28 17:56:49 -04:00
|
|
|
@bulk_issues_path = bulk_update_project_issues_path(project)
|
|
|
|
end
|
|
|
|
|
2016-08-08 18:03:41 -04:00
|
|
|
def authorize_read_board!
|
2021-03-02 19:10:50 -05:00
|
|
|
access_denied! unless can?(current_user, :read_issue_board, project)
|
2016-08-08 18:03:41 -04:00
|
|
|
end
|
2016-08-01 12:09:41 -04:00
|
|
|
end
|
2022-04-08 17:09:52 -04:00
|
|
|
|
|
|
|
Projects::BoardsController.prepend_mod
|