2018-09-23 15:44:14 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-02-19 14:06:16 -05:00
|
|
|
class Groups::BoardsController < Groups::ApplicationController
|
2019-02-26 12:26:26 -05:00
|
|
|
include BoardsActions
|
2019-02-05 09:55:31 -05:00
|
|
|
include RecordUserLastActivity
|
2021-02-12 04:08:48 -05:00
|
|
|
include Gitlab::Utils::StrongMemoize
|
2018-02-19 14:06:16 -05:00
|
|
|
|
|
|
|
before_action :assign_endpoint_vars
|
2019-10-15 05:06:09 -04:00
|
|
|
before_action do
|
2020-08-24 08:10:17 -04:00
|
|
|
push_frontend_feature_flag(:graphql_board_lists, group, default_enabled: false)
|
2021-05-27 14:10:52 -04:00
|
|
|
push_frontend_feature_flag(:board_multi_select, group, default_enabled: :yaml)
|
2021-03-18 14:09:09 -04:00
|
|
|
push_frontend_feature_flag(:swimlanes_buffered_rendering, group, default_enabled: :yaml)
|
2021-06-14 11:09:48 -04:00
|
|
|
push_frontend_feature_flag(:iteration_cadences, group, default_enabled: :yaml)
|
2019-10-15 05:06:09 -04:00
|
|
|
end
|
2018-02-19 14:06:16 -05:00
|
|
|
|
2020-10-06 08:08:38 -04:00
|
|
|
feature_category :boards
|
|
|
|
|
2018-05-16 16:36:25 -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
|
|
|
|
|
2018-02-19 14:06:16 -05:00
|
|
|
def assign_endpoint_vars
|
2021-02-11 04:09:18 -05:00
|
|
|
@boards_endpoint = group_boards_path(group)
|
2018-02-19 14:06:16 -05:00
|
|
|
@namespace_path = group.to_param
|
2021-02-11 04:09:18 -05:00
|
|
|
@labels_endpoint = group_labels_path(group)
|
2018-02-19 14:06:16 -05:00
|
|
|
end
|
2020-02-10 22:09:13 -05:00
|
|
|
|
|
|
|
def authorize_read_board!
|
2021-03-02 19:10:50 -05:00
|
|
|
access_denied! unless can?(current_user, :read_issue_board, group)
|
2020-02-10 22:09:13 -05:00
|
|
|
end
|
2018-02-19 14:06:16 -05:00
|
|
|
end
|