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
Tatuya Kamada
gitlab-ce
Commits
0e9c2e72
Commit
0e9c2e72
authored
May 04, 2016
by
Benedikt Huss
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feedback from stanhu
parent
655b2640
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
14 deletions
+26
-14
CHANGELOG
CHANGELOG
+1
-0
app/assets/javascripts/merge_request_widget.js.coffee
app/assets/javascripts/merge_request_widget.js.coffee
+8
-11
spec/javascripts/merge_request_widget_spec.js.coffee
spec/javascripts/merge_request_widget_spec.js.coffee
+17
-3
No files found.
CHANGELOG
View file @
0e9c2e72
...
@@ -22,6 +22,7 @@ v 8.8.0 (unreleased)
...
@@ -22,6 +22,7 @@ v 8.8.0 (unreleased)
- API support for the 'since' and 'until' operators on commit requests (Paco Guzman)
- API support for the 'since' and 'until' operators on commit requests (Paco Guzman)
- Fix Gravatar hint in user profile when Gravatar is disabled. !3988 (Artem Sidorenko)
- Fix Gravatar hint in user profile when Gravatar is disabled. !3988 (Artem Sidorenko)
- Expire repository exists? and has_visible_content? caches after a push if necessary
- Expire repository exists? and has_visible_content? caches after a push if necessary
- Merge request widget displays TeamCity build state and code coverage correctly again.
v 8.7.3
v 8.7.3
- Emails, Gitlab::Email::Message, Gitlab::Diff, and Premailer::Adapter::Nokogiri are now instrumented
- Emails, Gitlab::Email::Message, Gitlab::Diff, and Premailer::Adapter::Nokogiri are now instrumented
...
...
app/assets/javascripts/merge_request_widget.js.coffee
View file @
0e9c2e72
...
@@ -68,20 +68,18 @@ class @MergeRequestWidget
...
@@ -68,20 +68,18 @@ class @MergeRequestWidget
$
.
getJSON
@
opts
.
ci_status_url
,
(
data
)
=>
$
.
getJSON
@
opts
.
ci_status_url
,
(
data
)
=>
@
readyForCICheck
=
true
@
readyForCICheck
=
true
if
@
firstCICheck
||
@
opts
.
ci_status
is
''
if
data
.
status
is
''
if
@
firstCICheck
return
@
firstCICheck
=
false
@
opts
.
ci_status
=
data
.
status
@
showCIStatus
data
.
status
if
data
.
coverage
@
showCICoverage
data
.
coverage
if
data
.
status
isnt
@
opts
.
ci_status
and
data
.
status
?
if
@
firstCiCheck
||
data
.
status
isnt
@
opts
.
ci_status
and
data
.
status
?
@
opts
.
ci_status
=
data
.
status
@
showCIStatus
data
.
status
@
showCIStatus
data
.
status
if
data
.
coverage
if
data
.
coverage
@
showCICoverage
data
.
coverage
@
showCICoverage
data
.
coverage
if
showNotification
# The first check should only update the UI, a notification
# should only be displayed on status changes
if
showNotification
and
not
@
firstCiCheck
status
=
@
ciLabelForStatus
(
data
.
status
)
status
=
@
ciLabelForStatus
(
data
.
status
)
if
status
is
"preparing"
if
status
is
"preparing"
...
@@ -104,8 +102,7 @@ class @MergeRequestWidget
...
@@ -104,8 +102,7 @@ class @MergeRequestWidget
@
close
()
@
close
()
Turbolinks
.
visit
_this
.
opts
.
builds_path
Turbolinks
.
visit
_this
.
opts
.
builds_path
)
)
@
firstCiCheck
=
false
@
opts
.
ci_status
=
data
.
status
showCIStatus
:
(
state
)
->
showCIStatus
:
(
state
)
->
$
(
'.ci_widget'
).
hide
()
$
(
'.ci_widget'
).
hide
()
...
...
spec/javascripts/merge_request_widget_spec.js.coffee
View file @
0e9c2e72
...
@@ -4,7 +4,21 @@ describe 'MergeRequestWidget', ->
...
@@ -4,7 +4,21 @@ describe 'MergeRequestWidget', ->
beforeEach
->
beforeEach
->
window
.
notifyPermissions
=
()
->
window
.
notifyPermissions
=
()
->
@
opts
=
{
ci_status_url
:
"http://sampledomain.local/ci/getstatus"
,
ci_status
:
""
}
window
.
notify
=
()
->
@
opts
=
{
ci_status_url
:
"http://sampledomain.local/ci/getstatus"
,
ci_status
:
""
,
ci_message
:
{
normal
:
"Build {{status}} for
\"
{{title}}
\"
"
,
preparing
:
"{{status}} build for
\"
{{title}}
\"
"
},
ci_title
:
{
preparing
:
"{{status}} build"
,
normal
:
"Build {{status}}"
},
gitlab_icon
:
"gitlab_logo.png"
,
builds_path
:
"http://sampledomain.local/sampleBuildsPath"
}
@
class
=
new
MergeRequestWidget
(
@
opts
)
@
class
=
new
MergeRequestWidget
(
@
opts
)
@
ciStatusData
=
{
"title"
:
"Sample MR title"
,
"sha"
:
"12a34bc5"
,
"status"
:
"success"
,
"coverage"
:
98
}
@
ciStatusData
=
{
"title"
:
"Sample MR title"
,
"sha"
:
"12a34bc5"
,
"status"
:
"success"
,
"coverage"
:
98
}
...
@@ -25,11 +39,11 @@ describe 'MergeRequestWidget', ->
...
@@ -25,11 +39,11 @@ describe 'MergeRequestWidget', ->
it
'should call showCICoverage when the coverage rate is set'
,
->
it
'should call showCICoverage when the coverage rate is set'
,
->
spy
=
spyOn
(
@
class
,
'showCICoverage'
).
and
.
stub
()
spy
=
spyOn
(
@
class
,
'showCICoverage'
).
and
.
stub
()
@
class
.
getCIStatus
(
tru
e
)
@
class
.
getCIStatus
(
fals
e
)
expect
(
spy
).
toHaveBeenCalledWith
(
@
ciStatusData
.
coverage
)
expect
(
spy
).
toHaveBeenCalledWith
(
@
ciStatusData
.
coverage
)
it
'should not call showCICoverage when the coverage rate is not set'
,
->
it
'should not call showCICoverage when the coverage rate is not set'
,
->
@
ciStatusData
.
coverage
=
null
@
ciStatusData
.
coverage
=
null
spy
=
spyOn
(
@
class
,
'showCICoverage'
).
and
.
stub
()
spy
=
spyOn
(
@
class
,
'showCICoverage'
).
and
.
stub
()
@
class
.
getCIStatus
(
tru
e
)
@
class
.
getCIStatus
(
fals
e
)
expect
(
spy
).
not
.
toHaveBeenCalled
()
expect
(
spy
).
not
.
toHaveBeenCalled
()
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