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
20920bc1
Commit
20920bc1
authored
Apr 22, 2020
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move global autocomplete routes to /-/ scope
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
ba432ca6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
13 deletions
+55
-13
changelogs/unreleased/dz-scope-autocomplete-routing.yml
changelogs/unreleased/dz-scope-autocomplete-routing.yml
+5
-0
config/routes.rb
config/routes.rb
+26
-13
spec/routing/routing_spec.rb
spec/routing/routing_spec.rb
+24
-0
No files found.
changelogs/unreleased/dz-scope-autocomplete-routing.yml
0 → 100644
View file @
20920bc1
---
title
:
Move global autocomplete routes to /-/ scope
merge_request
:
30173
author
:
type
:
changed
config/routes.rb
View file @
20920bc1
...
...
@@ -44,19 +44,6 @@ Rails.application.routes.draw do
use_doorkeeper_openid_connect
# Autocomplete
get
'/autocomplete/users'
=>
'autocomplete#users'
get
'/autocomplete/users/:id'
=>
'autocomplete#user'
get
'/autocomplete/projects'
=>
'autocomplete#projects'
get
'/autocomplete/award_emojis'
=>
'autocomplete#award_emojis'
get
'/autocomplete/merge_request_target_branches'
=>
'autocomplete#merge_request_target_branches'
Gitlab
.
ee
do
get
'/autocomplete/project_groups'
=>
'autocomplete#project_groups'
get
'/autocomplete/project_routes'
=>
'autocomplete#project_routes'
get
'/autocomplete/namespace_routes'
=>
'autocomplete#namespace_routes'
end
# Sign up
get
'users/sign_up/welcome'
=>
'registrations#welcome'
patch
'users/sign_up/update_registration'
=>
'registrations#update_registration'
...
...
@@ -75,6 +62,19 @@ Rails.application.routes.draw do
# Begin of the /-/ scope.
# Use this scope for all new global routes.
scope
path:
'-'
do
# Autocomplete
get
'/autocomplete/users'
=>
'autocomplete#users'
get
'/autocomplete/users/:id'
=>
'autocomplete#user'
get
'/autocomplete/projects'
=>
'autocomplete#projects'
get
'/autocomplete/award_emojis'
=>
'autocomplete#award_emojis'
get
'/autocomplete/merge_request_target_branches'
=>
'autocomplete#merge_request_target_branches'
Gitlab
.
ee
do
get
'/autocomplete/project_groups'
=>
'autocomplete#project_groups'
get
'/autocomplete/project_routes'
=>
'autocomplete#project_routes'
get
'/autocomplete/namespace_routes'
=>
'autocomplete#namespace_routes'
end
# '/-/health' implemented by BasicHealthCheck middleware
get
'liveness'
=>
'health#liveness'
get
'readiness'
=>
'health#readiness'
...
...
@@ -199,6 +199,19 @@ Rails.application.routes.draw do
# Deprecated routes.
# Will be removed as part of https://gitlab.com/gitlab-org/gitlab/-/issues/210024
scope
as: :deprecated
do
# Autocomplete
get
'/autocomplete/users'
=>
'autocomplete#users'
get
'/autocomplete/users/:id'
=>
'autocomplete#user'
get
'/autocomplete/projects'
=>
'autocomplete#projects'
get
'/autocomplete/award_emojis'
=>
'autocomplete#award_emojis'
get
'/autocomplete/merge_request_target_branches'
=>
'autocomplete#merge_request_target_branches'
Gitlab
.
ee
do
get
'/autocomplete/project_groups'
=>
'autocomplete#project_groups'
get
'/autocomplete/project_routes'
=>
'autocomplete#project_routes'
get
'/autocomplete/namespace_routes'
=>
'autocomplete#namespace_routes'
end
resources
:invites
,
only:
[
:show
],
constraints:
{
id:
/[A-Za-z0-9_-]+/
}
do
member
do
post
:accept
...
...
spec/routing/routing_spec.rb
View file @
20920bc1
...
...
@@ -344,3 +344,27 @@ describe SentNotificationsController, 'routing' do
.
to
route_to
(
'sent_notifications#unsubscribe'
,
id:
'4bee17d4a63ed60cf5db53417e9aeb4c'
)
end
end
describe
AutocompleteController
,
'routing'
do
it
'to #users'
do
expect
(
get
(
"/-/autocomplete/users"
)).
to
route_to
(
'autocomplete#users'
)
end
it
'to #projects'
do
expect
(
get
(
"/-/autocomplete/projects"
)).
to
route_to
(
'autocomplete#projects'
)
end
it
'to #award_emojis'
do
expect
(
get
(
"/-/autocomplete/award_emojis"
)).
to
route_to
(
'autocomplete#award_emojis'
)
end
it
'to #merge_request_target_branches'
do
expect
(
get
(
"/-/autocomplete/merge_request_target_branches"
)).
to
route_to
(
'autocomplete#merge_request_target_branches'
)
end
it
'to legacy route'
do
expect
(
get
(
"/autocomplete/users"
)).
to
route_to
(
'autocomplete#users'
)
expect
(
get
(
"/autocomplete/projects"
)).
to
route_to
(
'autocomplete#projects'
)
expect
(
get
(
"/autocomplete/award_emojis"
)).
to
route_to
(
'autocomplete#award_emojis'
)
end
end
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