Commit 8ec1dcf2 authored by Yorick Peterse's avatar Yorick Peterse

Revert "Merge branch 'fix-build-notification-on-merge-page-change' into 'master'

This reverts commit d1ba0986.
parent 0dc34317
......@@ -9,6 +9,7 @@ v 8.7.4
- Running rake gitlab:db:drop_tables now drops tables with cascade !4020
- Running rake gitlab:db:drop_tables uses "IF EXISTS" as a precaution !4100
- Use a case-insensitive comparison in sanitizing URI schemes
- Links for Redmine issue references are generated correctly again (Benedikt Huss)
v 8.7.3
- Emails, Gitlab::Email::Message, Gitlab::Diff, and Premailer::Adapter::Nokogiri are now instrumented
......
......@@ -9,12 +9,11 @@ class @MergeRequestWidget
constructor: (@opts) ->
$('#modal_merge_info').modal(show: false)
@firstCICheck = true
@readyForCICheck = false
@readyForCICheck = true
clearInterval @fetchBuildStatusInterval
@clearEventListeners()
@addEventListeners()
@getCIStatus(false)
@pollCIStatus()
notifyPermissions()
......@@ -72,7 +71,7 @@ class @MergeRequestWidget
if data.status is ''
return
if @firstCICheck || 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
if data.coverage
......@@ -80,7 +79,7 @@ class @MergeRequestWidget
# The first check should only update the UI, a notification
# should only be displayed on status changes
if showNotification and not @firstCICheck
if showNotification and not @firstCiCheck
status = @ciLabelForStatus(data.status)
if status is "preparing"
......@@ -103,7 +102,7 @@ class @MergeRequestWidget
@close()
Turbolinks.visit _this.opts.builds_path
)
@firstCICheck = false
@firstCiCheck = false
showCIStatus: (state) ->
$('.ci_widget').hide()
......
......@@ -42,3 +42,8 @@
.ci_widget.ci-error{style: "display:none"}
= icon("times-circle")
Could not connect to the CI server. Please check your settings and try again.
:javascript
$(function() {
merge_request_widget.getCIStatus(false);
});
......@@ -47,9 +47,3 @@ describe 'MergeRequestWidget', ->
spy = spyOn(@class, 'showCICoverage').and.stub()
@class.getCIStatus(false)
expect(spy).not.toHaveBeenCalled()
it 'should not display a notification on the first check after the widget has been created', ->
spy = spyOn(window, 'notify')
@class = new MergeRequestWidget(@opts)
@class.getCIStatus(true)
expect(spy).not.toHaveBeenCalled()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment