2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
class Groups::BoardsController < Groups::ApplicationController
|
2019-07-07 11:18:12 +05:30
|
|
|
include BoardsActions
|
2019-03-02 22:35:43 +05:30
|
|
|
include RecordUserLastActivity
|
2021-03-11 19:13:27 +05:30
|
|
|
include Gitlab::Utils::StrongMemoize
|
2018-03-27 19:54:05 +05:30
|
|
|
|
|
|
|
before_action :assign_endpoint_vars
|
2019-12-21 20:55:43 +05:30
|
|
|
before_action do
|
2021-09-04 01:27:46 +05:30
|
|
|
push_frontend_feature_flag(:board_multi_select, group, default_enabled: :yaml)
|
|
|
|
push_frontend_feature_flag(:iteration_cadences, group, default_enabled: :yaml)
|
2021-12-11 22:18:48 +05:30
|
|
|
experiment(:prominent_create_board_btn, subject: current_user) do |e|
|
2022-04-04 11:22:00 +05:30
|
|
|
e.control { }
|
|
|
|
e.candidate { }
|
2021-12-11 22:18:48 +05:30
|
|
|
end.run
|
2019-12-21 20:55:43 +05:30
|
|
|
end
|
2018-03-27 19:54:05 +05:30
|
|
|
|
2021-12-11 22:18:48 +05:30
|
|
|
feature_category :team_planning
|
2021-01-03 14:25:43 +05:30
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
private
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
def board_klass
|
|
|
|
Board
|
|
|
|
end
|
|
|
|
|
|
|
|
def boards_finder
|
|
|
|
strong_memoize :boards_finder do
|
2021-04-17 20:07:23 +05:30
|
|
|
Boards::BoardsFinder.new(parent, current_user)
|
2021-03-11 19:13:27 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def board_finder
|
|
|
|
strong_memoize :board_finder do
|
2021-04-17 20:07:23 +05:30
|
|
|
Boards::BoardsFinder.new(parent, current_user, board_id: params[:id])
|
2021-03-11 19:13:27 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def board_create_service
|
|
|
|
strong_memoize :board_create_service do
|
|
|
|
Boards::CreateService.new(parent, current_user)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
def assign_endpoint_vars
|
2021-03-11 19:13:27 +05:30
|
|
|
@boards_endpoint = group_boards_path(group)
|
2018-03-27 19:54:05 +05:30
|
|
|
@namespace_path = group.to_param
|
2021-03-11 19:13:27 +05:30
|
|
|
@labels_endpoint = group_labels_path(group)
|
2018-03-27 19:54:05 +05:30
|
|
|
end
|
2020-03-13 15:44:24 +05:30
|
|
|
|
|
|
|
def authorize_read_board!
|
2021-04-17 20:07:23 +05:30
|
|
|
access_denied! unless can?(current_user, :read_issue_board, group)
|
2020-03-13 15:44:24 +05:30
|
|
|
end
|
2018-03-27 19:54:05 +05:30
|
|
|
end
|