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
9a7951f7
Commit
9a7951f7
authored
Apr 22, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed potential issue with 2 ci status polling events happening
parent
f2caad24
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
app/assets/javascripts/merge_request_widget.js.coffee
app/assets/javascripts/merge_request_widget.js.coffee
+9
-1
app/views/projects/merge_requests/widget/_show.html.haml
app/views/projects/merge_requests/widget/_show.html.haml
+7
-1
No files found.
app/assets/javascripts/merge_request_widget.js.coffee
View file @
9a7951f7
...
...
@@ -10,6 +10,7 @@ class @MergeRequestWidget
$
(
'#modal_merge_info'
).
modal
(
show
:
false
)
@
firstCICheck
=
true
@
readyForCICheck
=
false
@
cancel
=
false
clearInterval
@
fetchBuildStatusInterval
@
clearEventListeners
()
...
...
@@ -21,10 +22,16 @@ class @MergeRequestWidget
clearEventListeners
:
->
$
(
document
).
off
'page:change.merge_request'
cancelPolling
:
->
@
cancel
=
true
addEventListeners
:
->
allowedPages
=
[
'show'
,
'commits'
,
'builds'
,
'changes'
]
$
(
document
).
on
'page:change.merge_request'
,
=>
if
$
(
'body'
).
data
(
'page'
)
isnt
'projects:merge_requests:show'
page
=
$
(
'body'
).
data
(
'page'
).
split
(
':'
).
last
()
if
allowedPages
.
indexOf
(
page
)
<
0
clearInterval
@
fetchBuildStatusInterval
@
cancelPolling
()
@
clearEventListeners
()
mergeInProgress
:
(
deleteSourceBranch
=
false
)
->
...
...
@@ -67,6 +74,7 @@ class @MergeRequestWidget
$
(
'.ci-widget-fetching'
).
show
()
$
.
getJSON
@
opts
.
ci_status_url
,
(
data
)
=>
return
if
@
cancel
@
readyForCICheck
=
true
if
data
.
status
is
''
...
...
app/views/projects/merge_requests/widget/_show.html.haml
View file @
9a7951f7
...
...
@@ -13,7 +13,7 @@
check_enable
:
#{
@merge_request
.
unchecked?
?
"true"
:
"false"
}
,
ci_status_url
:
"
#{
ci_status_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
}
"
,
gitlab_icon
:
"
#{
asset_path
'gitlab_logo.png'
}
"
,
ci_status
:
""
,
ci_status
:
"
#{
@merge_request
.
ci_commit
?
@merge_request
.
ci_commit
.
status
:
''
}
"
,
ci_message
:
{
normal
:
"
Build {{status}} for
\"
{{title}}
\"
"
,
preparing
:
"
{{status}} build for
\"
{{title}}
\"
"
...
...
@@ -26,4 +26,10 @@
builds_path
:
"
#{
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
}
"
};
if
(
typeof
merge_request_widget
!==
'
undefined
'
)
{
clearInterval
(
merge_request_widget
.
fetchBuildStatusInterval
);
merge_request_widget
.
cancelPolling
();
merge_request_widget
.
clearEventListeners
();
}
merge_request_widget
=
new
MergeRequestWidget
(
opts
);
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