2018-09-23 19:44:14 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-02-19 19:06:16 +00:00
|
|
|
class Groups::BoardsController < Groups::ApplicationController
|
2019-02-26 17:26:26 +00:00
|
|
|
include BoardsActions
|
2019-02-05 14:55:31 +00:00
|
|
|
include RecordUserLastActivity
|
2021-02-12 09:08:48 +00:00
|
|
|
include Gitlab::Utils::StrongMemoize
|
2018-02-19 19:06:16 +00:00
|
|
|
|
|
|
|
before_action :assign_endpoint_vars
|
2019-10-15 09:06:09 +00:00
|
|
|
before_action do
|
2021-07-21 03:09:46 +00:00
|
|
|
push_frontend_feature_flag(:graphql_board_lists, group, default_enabled: :yaml)
|
2021-07-14 03:08:27 +00:00
|
|
|
push_frontend_feature_flag(:issue_boards_filtered_search, group, default_enabled: :yaml)
|
2021-05-27 18:10:52 +00:00
|
|
|
push_frontend_feature_flag(:board_multi_select, group, default_enabled: :yaml)
|
2021-03-18 18:09:09 +00:00
|
|
|
push_frontend_feature_flag(:swimlanes_buffered_rendering, group, default_enabled: :yaml)
|
2021-06-14 15:09:48 +00:00
|
|
|
push_frontend_feature_flag(:iteration_cadences, group, default_enabled: :yaml)
|
2019-10-15 09:06:09 +00:00
|
|
|
end
|
2018-02-19 19:06:16 +00:00
|
|
|
|
2020-10-06 12:08:38 +00:00
|
|
|
feature_category :boards
|
|
|
|
|
2018-05-16 20:36:25 +00:00
|
|
|
private
|
|
|
|
|
2021-02-12 09:08:48 +00:00
|
|
|
def board_klass
|
|
|
|
Board
|
|
|
|
end
|
|
|
|
|
|
|
|
def boards_finder
|
|
|
|
strong_memoize :boards_finder do
|
2021-03-05 09:09:07 +00:00
|
|
|
Boards::BoardsFinder.new(parent, current_user)
|
2021-02-12 09:08:48 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def board_finder
|
|
|
|
strong_memoize :board_finder do
|
2021-03-05 09:09:07 +00:00
|
|
|
Boards::BoardsFinder.new(parent, current_user, board_id: params[:id])
|
2021-02-12 09:08:48 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def board_create_service
|
|
|
|
strong_memoize :board_create_service do
|
|
|
|
Boards::CreateService.new(parent, current_user)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-02-19 19:06:16 +00:00
|
|
|
def assign_endpoint_vars
|
2021-02-11 09:09:18 +00:00
|
|
|
@boards_endpoint = group_boards_path(group)
|
2018-02-19 19:06:16 +00:00
|
|
|
@namespace_path = group.to_param
|
2021-02-11 09:09:18 +00:00
|
|
|
@labels_endpoint = group_labels_path(group)
|
2018-02-19 19:06:16 +00:00
|
|
|
end
|
2020-02-11 03:09:13 +00:00
|
|
|
|
|
|
|
def authorize_read_board!
|
2021-03-03 00:10:50 +00:00
|
|
|
access_denied! unless can?(current_user, :read_issue_board, group)
|
2020-02-11 03:09:13 +00:00
|
|
|
end
|
2018-02-19 19:06:16 +00:00
|
|
|
end
|