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 ...@@ -5,6 +5,8 @@ class Dashboard::GroupsController < Dashboard::ApplicationController
skip_cross_project_access_check :index skip_cross_project_access_check :index
feature_category :subgroups, only: [:index]
def index def index
groups = GroupsFinder.new(current_user, all_available: false).execute groups = GroupsFinder.new(current_user, all_available: false).execute
render_group_tree(groups) render_group_tree(groups)
......
# frozen_string_literal: true # frozen_string_literal: true
class Dashboard::LabelsController < Dashboard::ApplicationController class Dashboard::LabelsController < Dashboard::ApplicationController
feature_category :issue_tracking, only: [:index]
def index def index
respond_to do |format| respond_to do |format|
format.json { render json: LabelSerializer.new.represent_appearance(labels) } format.json { render json: LabelSerializer.new.represent_appearance(labels) }
......
...@@ -4,6 +4,8 @@ class Dashboard::MilestonesController < Dashboard::ApplicationController ...@@ -4,6 +4,8 @@ class Dashboard::MilestonesController < Dashboard::ApplicationController
before_action :projects before_action :projects
before_action :groups, only: :index before_action :groups, only: :index
feature_category :issue_tracking, only: [:index]
def index def index
respond_to do |format| respond_to do |format|
format.html do format.html do
......
...@@ -14,6 +14,8 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController ...@@ -14,6 +14,8 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
before_action :projects, only: [:index] before_action :projects, only: [:index]
skip_cross_project_access_check :index, :starred skip_cross_project_access_check :index, :starred
feature_category :projects, only: [:index, :starred, :removed]
def index def index
respond_to do |format| respond_to do |format|
format.html do format.html do
......
...@@ -7,6 +7,8 @@ class Dashboard::SnippetsController < Dashboard::ApplicationController ...@@ -7,6 +7,8 @@ class Dashboard::SnippetsController < Dashboard::ApplicationController
skip_cross_project_access_check :index skip_cross_project_access_check :index
feature_category :snippets, only: [:index]
def index def index
@snippet_counts = Snippets::CountService @snippet_counts = Snippets::CountService
.new(current_user, author: current_user) .new(current_user, author: current_user)
......
...@@ -9,6 +9,8 @@ class Dashboard::TodosController < Dashboard::ApplicationController ...@@ -9,6 +9,8 @@ class Dashboard::TodosController < Dashboard::ApplicationController
before_action :authorize_read_group!, only: :index before_action :authorize_read_group!, only: :index
before_action :find_todos, only: [:index, :destroy_all] before_action :find_todos, only: [:index, :destroy_all]
feature_category :issue_tracking, only: [:index, :destroy, :destroy_all, :restore, :bulk_restore]
def index def index
@sort = params[:sort] @sort = params[:sort]
@todos = @todos.page(params[:page]) @todos = @todos.page(params[:page])
......
...@@ -15,6 +15,10 @@ class DashboardController < Dashboard::ApplicationController ...@@ -15,6 +15,10 @@ class DashboardController < Dashboard::ApplicationController
respond_to :html 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 def activity
respond_to do |format| respond_to do |format|
format.html format.html
......
...@@ -17,13 +17,14 @@ RSpec.describe "Every controller" do ...@@ -17,13 +17,14 @@ RSpec.describe "Every controller" do
.compact .compact
.select { |route| route[:controller].present? && route[:action].present? } .select { |route| route[:controller].present? && route[:action].present? }
.map { |route| [constantize_controller(route[:controller]), route[:action]] } .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 end
let_it_be(:routes_without_category) do let_it_be(:routes_without_category) do
controller_actions.map do |controller, action| controller_actions.map do |controller, action|
next if controller.feature_category_for_action(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}" "#{controller}##{action}"
end.compact 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