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
Kazuhiko Shiozaki
gitlab-ce
Commits
6909b309
Commit
6909b309
authored
Oct 16, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix missing commit status for widget when no CI service is enabled
parent
e10f5f4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
37 deletions
+36
-37
app/views/projects/merge_requests/widget/_heading.html.haml
app/views/projects/merge_requests/widget/_heading.html.haml
+36
-37
No files found.
app/views/projects/merge_requests/widget/_heading.html.haml
View file @
6909b309
-
if
@merge_request
.
has_ci?
-
ci_commit
=
@merge_request
.
source_project
.
ci_commit
(
@merge_request
.
source_sha
)
-
if
ci_commit
-
status
=
ci_commit
.
status
.mr-widget-heading
.ci_widget
{
class:
"ci-#{status}"
}
=
ci_status_icon
(
ci_commit
)
-
ci_commit
=
@merge_request
.
source_project
.
ci_commit
(
@merge_request
.
source_sha
)
-
if
ci_commit
-
status
=
ci_commit
.
status
.mr-widget-heading
.ci_widget
{
class:
"ci-#{status}"
}
=
ci_status_icon
(
ci_commit
)
%span
CI build
#{
status
}
for
#{
@merge_request
.
last_commit_short_sha
}
.
%span
.ci-coverage
=
link_to
"View build details"
,
ci_status_path
(
ci_commit
)
-
elsif
@merge_request
.
has_ci?
-
# Compatibility with old CI integrations (ex jenkins) when you request status from CI server via AJAX
-
# Remove in later versions when services like Jenkins will set CI status via Commit status API
.mr-widget-heading
-
[
:success
,
:skipped
,
:canceled
,
:failed
,
:running
,
:pending
].
each
do
|
status
|
.ci_widget
{
class:
"ci-#{status}"
,
style:
"display:none"
}
-
if
status
==
:success
-
status
=
"passed"
=
icon
(
"check-circle"
)
-
else
=
icon
(
"circle"
)
%span
CI build
#{
status
}
for
#{
@merge_request
.
last_commit_short_sha
}
.
%span
.ci-coverage
=
link_to
"View build details"
,
ci_status_path
(
ci_commit
)
-
else
-
# Compatibility with old CI integrations (ex jenkins) when you request status from CI server via AJAX
-
# Remove in later versions when services like Jenkins will set CI status via Commit status API
.mr-widget-heading
-
[
:success
,
:skipped
,
:canceled
,
:failed
,
:running
,
:pending
].
each
do
|
status
|
.ci_widget
{
class:
"ci-#{status}"
,
style:
"display:none"
}
-
if
status
==
:success
-
status
=
"passed"
=
icon
(
"check-circle"
)
-
else
=
icon
(
"circle"
)
%span
CI build
#{
status
}
for
#{
@merge_request
.
last_commit_short_sha
}
.
%span
.ci-coverage
-
if
ci_build_details_path
(
@merge_request
)
=
link_to
"View build details"
,
ci_build_details_path
(
@merge_request
),
:"data-no-turbolink"
=>
"data-no-turbolink"
-
if
ci_build_details_path
(
@merge_request
)
=
link_to
"View build details"
,
ci_build_details_path
(
@merge_request
),
:"data-no-turbolink"
=>
"data-no-turbolink"
.ci_widget
=
icon
(
"spinner spin"
)
Checking CI status for
#{
@merge_request
.
last_commit_short_sha
}
…
.ci_widget
=
icon
(
"spinner spin"
)
Checking CI status for
#{
@merge_request
.
last_commit_short_sha
}
…
.ci_widget.ci-not_found
{
style:
"display:none"
}
=
icon
(
"times-circle"
)
Could not find CI status for
#{
@merge_request
.
last_commit_short_sha
}
.
.ci_widget.ci-not_found
{
style:
"display:none"
}
=
icon
(
"times-circle"
)
Could not find CI status for
#{
@merge_request
.
last_commit_short_sha
}
.
.ci_widget.ci-error
{
style:
"display:none"
}
=
icon
(
"times-circle"
)
Could not connect to the CI server. Please check your settings and try again.
.ci_widget.ci-error
{
style:
"display:none"
}
=
icon
(
"times-circle"
)
Could not connect to the CI server. Please check your settings and try again.
:coffeescript
$ ->
merge_request_widget.getCiStatus()
:coffeescript
$ ->
merge_request_widget.getCiStatus()
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