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
Boxiang Sun
gitlab-ce
Commits
f668a785
Commit
f668a785
authored
Jun 29, 2016
by
Connor Shea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Starting work on the warn_on_failure feature for the MR build status.
parent
1d7ac164
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
5 deletions
+23
-5
app/assets/javascripts/merge_request_widget.js.coffee
app/assets/javascripts/merge_request_widget.js.coffee
+4
-2
app/assets/stylesheets/pages/merge_requests.scss
app/assets/stylesheets/pages/merge_requests.scss
+8
-0
app/assets/stylesheets/pages/status.scss
app/assets/stylesheets/pages/status.scss
+6
-2
app/helpers/ci_status_helper.rb
app/helpers/ci_status_helper.rb
+4
-0
app/views/projects/merge_requests/widget/_heading.html.haml
app/views/projects/merge_requests/widget/_heading.html.haml
+1
-1
No files found.
app/assets/javascripts/merge_request_widget.js.coffee
View file @
f668a785
...
@@ -57,6 +57,8 @@ class @MergeRequestWidget
...
@@ -57,6 +57,8 @@ class @MergeRequestWidget
ciLabelForStatus
:
(
status
)
->
ciLabelForStatus
:
(
status
)
->
if
status
is
'success'
if
status
is
'success'
'passed'
'passed'
else
if
status
is
'success_with_warnings'
'passed with warnings'
else
else
status
status
...
@@ -116,7 +118,7 @@ class @MergeRequestWidget
...
@@ -116,7 +118,7 @@ class @MergeRequestWidget
showCIStatus
:
(
state
)
->
showCIStatus
:
(
state
)
->
return
if
not
state
?
return
if
not
state
?
$
(
'.ci_widget'
).
hide
()
$
(
'.ci_widget'
).
hide
()
allowed_states
=
[
"failed"
,
"canceled"
,
"running"
,
"pending"
,
"success"
,
"skipped"
,
"not_found"
]
allowed_states
=
[
"failed"
,
"canceled"
,
"running"
,
"pending"
,
"success"
,
"s
uccess_with_warnings"
,
"s
kipped"
,
"not_found"
]
if
state
in
allowed_states
if
state
in
allowed_states
$
(
'.ci_widget.ci-'
+
state
).
show
()
$
(
'.ci_widget.ci-'
+
state
).
show
()
switch
state
switch
state
...
@@ -124,7 +126,7 @@ class @MergeRequestWidget
...
@@ -124,7 +126,7 @@ class @MergeRequestWidget
@
setMergeButtonClass
(
'btn-danger'
)
@
setMergeButtonClass
(
'btn-danger'
)
when
"running"
when
"running"
@
setMergeButtonClass
(
'btn-warning'
)
@
setMergeButtonClass
(
'btn-warning'
)
when
"success"
when
"success"
,
"success_with_warnings"
@
setMergeButtonClass
(
'btn-create'
)
@
setMergeButtonClass
(
'btn-create'
)
else
else
$
(
'.ci_widget.ci-error'
).
show
()
$
(
'.ci_widget.ci-error'
).
show
()
...
...
app/assets/stylesheets/pages/merge_requests.scss
View file @
f668a785
...
@@ -68,6 +68,14 @@
...
@@ -68,6 +68,14 @@
color
:
$gl-success
;
color
:
$gl-success
;
}
}
&
.ci-success_with_warnings
{
color
:
$gl-success
;
i
{
color
:
$gl-warning
;
}
}
&
.ci-skipped
{
&
.ci-skipped
{
background-color
:
#eee
;
background-color
:
#eee
;
color
:
#888
;
color
:
#888
;
...
...
app/assets/stylesheets/pages/status.scss
View file @
f668a785
...
@@ -15,7 +15,8 @@
...
@@ -15,7 +15,8 @@
border-color
:
$gl-danger
;
border-color
:
$gl-danger
;
}
}
&
.ci-success
{
&
.ci-success
,
&
.ci-success_with_warnings
{
color
:
$gl-success
;
color
:
$gl-success
;
border-color
:
$gl-success
;
border-color
:
$gl-success
;
}
}
...
@@ -49,9 +50,12 @@
...
@@ -49,9 +50,12 @@
.ci-status-icon-failed
{
.ci-status-icon-failed
{
color
:
$gl-danger
;
color
:
$gl-danger
;
}
}
.ci-status-icon-pending
{
.ci-status-icon-pending
,
.ci-status-icon-success_with_warning
{
color
:
$gl-warning
;
color
:
$gl-warning
;
}
}
.ci-status-icon-running
{
.ci-status-icon-running
{
color
:
$blue-normal
;
color
:
$blue-normal
;
}
}
...
...
app/helpers/ci_status_helper.rb
View file @
f668a785
...
@@ -17,6 +17,8 @@ module CiStatusHelper
...
@@ -17,6 +17,8 @@ module CiStatusHelper
def
ci_label_for_status
(
status
)
def
ci_label_for_status
(
status
)
if
status
==
'success'
if
status
==
'success'
'passed'
'passed'
elsif
status
==
'success_with_warnings'
'passed with warnings'
else
else
status
status
end
end
...
@@ -27,6 +29,8 @@ module CiStatusHelper
...
@@ -27,6 +29,8 @@ module CiStatusHelper
case
status
case
status
when
'success'
when
'success'
'check'
'check'
when
'success_with_warnings'
'exclamation-triangle'
when
'failed'
when
'failed'
'close'
'close'
when
'pending'
when
'pending'
...
...
app/views/projects/merge_requests/widget/_heading.html.haml
View file @
f668a785
-
if
@pipeline
-
if
@pipeline
.mr-widget-heading
.mr-widget-heading
-
%w[success skipped canceled failed running pending]
.
each
do
|
status
|
-
%w[success s
uccess_with_warnings s
kipped canceled failed running pending]
.
each
do
|
status
|
.ci_widget
{
class:
"ci-#{status}"
,
style:
(
"display:none"
unless
@pipeline
.
status
==
status
)
}
.ci_widget
{
class:
"ci-#{status}"
,
style:
(
"display:none"
unless
@pipeline
.
status
==
status
)
}
=
ci_icon_for_status
(
status
)
=
ci_icon_for_status
(
status
)
%span
%span
...
...
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