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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
71c6369c
Commit
71c6369c
authored
Oct 26, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
693cbd0f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
2 deletions
+43
-2
app/controllers/concerns/routable_actions.rb
app/controllers/concerns/routable_actions.rb
+1
-1
changelogs/unreleased/32198-banner-alerting-of-project-move-is-showing-up-everywhere.yml
...ner-alerting-of-project-move-is-showing-up-everywhere.yml
+5
-0
doc/user/project/milestones/index.md
doc/user/project/milestones/index.md
+1
-1
spec/controllers/groups/milestones_controller_spec.rb
spec/controllers/groups/milestones_controller_spec.rb
+18
-0
spec/controllers/projects/labels_controller_spec.rb
spec/controllers/projects/labels_controller_spec.rb
+18
-0
No files found.
app/controllers/concerns/routable_actions.rb
View file @
71c6369c
...
...
@@ -47,7 +47,7 @@ module RoutableActions
canonical_path
=
routable
.
full_path
if
canonical_path
!=
requested_full_path
if
canonical_path
.
casecmp
(
requested_full_path
)
!=
0
if
!
request
.
xhr?
&&
request
.
format
.
html?
&&
canonical_path
.
casecmp
(
requested_full_path
)
!=
0
flash
[
:notice
]
=
"
#{
routable
.
class
.
to_s
.
titleize
}
'
#{
requested_full_path
}
' was moved to '
#{
canonical_path
}
'. Please update any links and bookmarks that may still have the old path."
end
...
...
changelogs/unreleased/32198-banner-alerting-of-project-move-is-showing-up-everywhere.yml
0 → 100644
View file @
71c6369c
---
title
:
Fix "project or group was moved" alerts showing up in the wrong pages
merge_request
:
18985
author
:
type
:
fixed
doc/user/project/milestones/index.md
View file @
71c6369c
...
...
@@ -107,7 +107,7 @@ Not all features in the project milestone view are available in the group milest
| Feature | Project milestone view | Group milestone view |
|--------------------------------------|:----------------------:|:--------------------:|
| Title an
description
| ✓ | ✓ |
| Title an
d description
| ✓ | ✓ |
| Issues assigned to milestone | ✓ | |
| Merge requests assigned to milestone | ✓ | |
| Participants and labels used | ✓ | |
...
...
spec/controllers/groups/milestones_controller_spec.rb
View file @
71c6369c
...
...
@@ -314,6 +314,24 @@ describe Groups::MilestonesController do
expect
(
controller
).
to
set_flash
[
:notice
].
to
(
group_moved_message
(
redirect_route
,
group
))
end
context
'with an AJAX request'
do
it
'redirects to the canonical path but does not set flash message'
do
get
:merge_requests
,
params:
{
group_id:
redirect_route
.
path
,
id:
title
},
xhr:
true
expect
(
response
).
to
redirect_to
(
merge_requests_group_milestone_path
(
group
.
to_param
,
title
))
expect
(
controller
).
not_to
set_flash
[
:notice
]
end
end
context
'with JSON format'
do
it
'redirects to the canonical path but does not set flash message'
do
get
:merge_requests
,
params:
{
group_id:
redirect_route
.
path
,
id:
title
},
format: :json
expect
(
response
).
to
redirect_to
(
merge_requests_group_milestone_path
(
group
.
to_param
,
title
,
format: :json
))
expect
(
controller
).
not_to
set_flash
[
:notice
]
end
end
context
'when the old group path is a substring of the scheme or host'
do
let
(
:redirect_route
)
{
group
.
redirect_routes
.
create
(
path:
'http'
)
}
...
...
spec/controllers/projects/labels_controller_spec.rb
View file @
71c6369c
...
...
@@ -204,6 +204,24 @@ describe Projects::LabelsController do
expect
(
response
).
to
redirect_to
(
project_labels_path
(
project
))
expect
(
controller
).
to
set_flash
[
:notice
].
to
(
project_moved_message
(
redirect_route
,
project
))
end
context
'with an AJAX request'
do
it
'redirects to the canonical path but does not set flash message'
do
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
.
to_param
+
'old'
},
xhr:
true
expect
(
response
).
to
redirect_to
(
project_labels_path
(
project
))
expect
(
controller
).
not_to
set_flash
[
:notice
]
end
end
context
'with JSON format'
do
it
'redirects to the canonical path but does not set flash message'
do
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
.
to_param
+
'old'
},
format: :json
expect
(
response
).
to
redirect_to
(
project_labels_path
(
project
,
format: :json
))
expect
(
controller
).
not_to
set_flash
[
:notice
]
end
end
end
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