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
ed4ec0da
Commit
ed4ec0da
authored
Dec 05, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for detailed status to status helpers
parent
5e3cfe2f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
24 deletions
+36
-24
app/helpers/ci_status_helper.rb
app/helpers/ci_status_helper.rb
+32
-21
app/views/projects/ci/pipelines/_pipeline.html.haml
app/views/projects/ci/pipelines/_pipeline.html.haml
+3
-2
app/views/projects/pipelines/_info.html.haml
app/views/projects/pipelines/_info.html.haml
+1
-1
No files found.
app/helpers/ci_status_helper.rb
View file @
ed4ec0da
...
...
@@ -6,7 +6,8 @@ module CiStatusHelper
def
ci_status_with_icon
(
status
,
target
=
nil
)
content
=
ci_icon_for_status
(
status
)
+
ci_label_for_status
(
status
)
klass
=
"ci-status ci-
#{
status
}
"
klass
=
"ci-status ci-
#{
status
}
"
# TODO, add support for detailed status
if
target
link_to
content
,
target
,
class:
klass
else
...
...
@@ -15,11 +16,13 @@ module CiStatusHelper
end
def
ci_label_for_status
(
status
)
if
detailed_status?
(
status
)
return
status
.
label
end
case
status
when
'success'
'passed'
when
'success_with_warnings'
'passed with warnings'
else
status
end
...
...
@@ -32,11 +35,12 @@ module CiStatusHelper
def
ci_icon_for_status
(
status
)
icon_name
=
if
detailed_status?
(
status
)
status
.
icon
else
case
status
when
'success'
'icon_status_success'
when
'success_with_warnings'
'icon_status_warning'
when
'failed'
'icon_status_failed'
when
'pending'
...
...
@@ -52,6 +56,7 @@ module CiStatusHelper
else
'icon_status_canceled'
end
end
custom_icon
(
icon_name
)
end
...
...
@@ -94,4 +99,10 @@ module CiStatusHelper
class:
klass
,
title:
title
,
data:
data
end
end
def
detailed_status?
(
status
)
status
.
respond_to?
(
:text
)
&&
status
.
respond_to?
(
:label
)
&&
status
.
respond_to?
(
:icon
)
end
end
app/views/projects/ci/pipelines/_pipeline.html.haml
View file @
ed4ec0da
-
status
=
pipeline
.
status
-
detailed_status
=
pipeline
.
detailed_status
-
show_commit
=
local_assigns
.
fetch
(
:show_commit
,
true
)
-
show_branch
=
local_assigns
.
fetch
(
:show_branch
,
true
)
%tr
.commit
%td
.commit-link
=
link_to
namespace_project_pipeline_path
(
pipeline
.
project
.
namespace
,
pipeline
.
project
,
pipeline
.
id
),
class:
"ci-status ci-
#{
status
}
"
do
=
ci_icon_for_status
(
status
)
=
ci_label_for_status
(
status
)
=
ci_icon_for_status
(
detailed_
status
)
=
ci_label_for_status
(
detailed_
status
)
%td
=
link_to
namespace_project_pipeline_path
(
pipeline
.
project
.
namespace
,
pipeline
.
project
,
pipeline
.
id
)
do
...
...
app/views/projects/pipelines/_info.html.haml
View file @
ed4ec0da
.page-content-header
.header-main-content
=
ci_status_with_icon
(
@pipeline
.
status
)
=
ci_status_with_icon
(
@pipeline
.
detailed_
status
)
%strong
Pipeline ##{@commit.pipelines.last.id}
triggered
#{
time_ago_with_tooltip
(
@commit
.
authored_date
)
}
by
=
author_avatar
(
@commit
,
size:
24
)
...
...
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