Commit 595a379e authored by Sean McGivern's avatar Sean McGivern

Add feature categories to controllers beginning with D

parent 9ccf1d80
......@@ -5,6 +5,8 @@ class Dashboard::GroupsController < Dashboard::ApplicationController
skip_cross_project_access_check :index
feature_category :subgroups, only: [:index]
def index
groups = GroupsFinder.new(current_user, all_available: false).execute
render_group_tree(groups)
......
# frozen_string_literal: true
class Dashboard::LabelsController < Dashboard::ApplicationController
feature_category :issue_tracking, only: [:index]
def index
respond_to do |format|
format.json { render json: LabelSerializer.new.represent_appearance(labels) }
......
......@@ -4,6 +4,8 @@ class Dashboard::MilestonesController < Dashboard::ApplicationController
before_action :projects
before_action :groups, only: :index
feature_category :issue_tracking, only: [:index]
def index
respond_to do |format|
format.html do
......
......@@ -14,6 +14,8 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
before_action :projects, only: [:index]
skip_cross_project_access_check :index, :starred
feature_category :projects, only: [:index, :starred, :removed]
def index
respond_to do |format|
format.html do
......
......@@ -7,6 +7,8 @@ class Dashboard::SnippetsController < Dashboard::ApplicationController
skip_cross_project_access_check :index
feature_category :snippets, only: [:index]
def index
@snippet_counts = Snippets::CountService
.new(current_user, author: current_user)
......
......@@ -9,6 +9,8 @@ class Dashboard::TodosController < Dashboard::ApplicationController
before_action :authorize_read_group!, only: :index
before_action :find_todos, only: [:index, :destroy_all]
feature_category :issue_tracking, only: [:index, :destroy, :destroy_all, :restore, :bulk_restore]
def index
@sort = params[:sort]
@todos = @todos.page(params[:page])
......
......@@ -15,6 +15,10 @@ class DashboardController < Dashboard::ApplicationController
respond_to :html
feature_category :audit_events, only: [:activity] # TODO: can't find a better match
feature_category :issue_tracking, only: [:issues, :issues_calendar]
feature_category :code_review, only: [:merge_requests]
def activity
respond_to do |format|
format.html
......
......@@ -17,13 +17,14 @@ RSpec.describe "Every controller" do
.compact
.select { |route| route[:controller].present? && route[:action].present? }
.map { |route| [constantize_controller(route[:controller]), route[:action]] }
.reject { |route| route.first.nil? || !route.first.include?(ControllerWithFeatureCategory) }
.select { |(controller, action)| controller&.include?(ControllerWithFeatureCategory) }
.reject { |(controller, action)| controller == Devise::UnlocksController }
end
let_it_be(:routes_without_category) do
controller_actions.map do |controller, action|
next if controller.feature_category_for_action(action)
next unless controller.to_s.start_with?('B', 'C')
next unless controller.to_s.start_with?('B', 'C', 'D')
"#{controller}##{action}"
end.compact
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment