Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
595a379e
Commit
595a379e
authored
Sep 29, 2020
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature categories to controllers beginning with D
parent
9ccf1d80
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
19 additions
and
2 deletions
+19
-2
app/controllers/dashboard/groups_controller.rb
app/controllers/dashboard/groups_controller.rb
+2
-0
app/controllers/dashboard/labels_controller.rb
app/controllers/dashboard/labels_controller.rb
+2
-0
app/controllers/dashboard/milestones_controller.rb
app/controllers/dashboard/milestones_controller.rb
+2
-0
app/controllers/dashboard/projects_controller.rb
app/controllers/dashboard/projects_controller.rb
+2
-0
app/controllers/dashboard/snippets_controller.rb
app/controllers/dashboard/snippets_controller.rb
+2
-0
app/controllers/dashboard/todos_controller.rb
app/controllers/dashboard/todos_controller.rb
+2
-0
app/controllers/dashboard_controller.rb
app/controllers/dashboard_controller.rb
+4
-0
spec/controllers/every_controller_spec.rb
spec/controllers/every_controller_spec.rb
+3
-2
No files found.
app/controllers/dashboard/groups_controller.rb
View file @
595a379e
...
@@ -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
)
...
...
app/controllers/dashboard/labels_controller.rb
View file @
595a379e
# 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
)
}
...
...
app/controllers/dashboard/milestones_controller.rb
View file @
595a379e
...
@@ -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
...
...
app/controllers/dashboard/projects_controller.rb
View file @
595a379e
...
@@ -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
...
...
app/controllers/dashboard/snippets_controller.rb
View file @
595a379e
...
@@ -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
)
...
...
app/controllers/dashboard/todos_controller.rb
View file @
595a379e
...
@@ -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
])
...
...
app/controllers/dashboard_controller.rb
View file @
595a379e
...
@@ -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
...
...
spec/controllers/every_controller_spec.rb
View file @
595a379e
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment