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
98b921bd
Commit
98b921bd
authored
May 13, 2020
by
Donald Cook
Committed by
Natalia Tepluhina
May 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated redirect logic to not take route changes into account
parent
3aeef74f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
app/assets/javascripts/issue_show/components/app.vue
app/assets/javascripts/issue_show/components/app.vue
+1
-1
spec/frontend/issue_show/components/app_spec.js
spec/frontend/issue_show/components/app_spec.js
+13
-0
No files found.
app/assets/javascripts/issue_show/components/app.vue
View file @
98b921bd
...
...
@@ -295,7 +295,7 @@ export default {
.
then
(
res
=>
res
.
data
)
.
then
(
data
=>
this
.
checkForSpam
(
data
))
.
then
(
data
=>
{
if
(
window
.
location
.
pathname
!==
data
.
web_url
)
{
if
(
!
window
.
location
.
pathname
.
includes
(
data
.
web_url
)
)
{
visitUrl
(
data
.
web_url
);
}
})
...
...
spec/frontend/issue_show/components/app_spec.js
View file @
98b921bd
...
...
@@ -221,6 +221,19 @@ describe('Issuable output', () => {
});
});
it
(
'
does not redirect if issue has not moved and user has switched tabs
'
,
()
=>
{
jest
.
spyOn
(
vm
.
service
,
'
updateIssuable
'
).
mockResolvedValue
({
data
:
{
web_url
:
''
,
confidential
:
vm
.
isConfidential
,
},
});
return
vm
.
updateIssuable
().
then
(()
=>
{
expect
(
visitUrl
).
not
.
toHaveBeenCalled
();
});
});
it
(
'
redirects if returned web_url has changed
'
,
()
=>
{
jest
.
spyOn
(
vm
.
service
,
'
updateIssuable
'
).
mockResolvedValue
({
data
:
{
...
...
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