Commit ebf05201 authored by Rydkin Maxim's avatar Rydkin Maxim

add tooltip on badge in pipelines index

parent 2d7bc695
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
computed: { computed: {
cssClasses() { cssClasses() {
return `ci-status ci-${this.pipeline.details.status.group}`; return `ci-status ci-${this.pipeline.details.status.group} has-tooltip`;
}, },
detailsPath() { detailsPath() {
...@@ -47,12 +47,17 @@ export default { ...@@ -47,12 +47,17 @@ export default {
content() { content() {
return `${this.svg} ${this.pipeline.details.status.text}`; return `${this.svg} ${this.pipeline.details.status.text}`;
}, },
tooltipTitle() {
return this.pipeline.details.status_tooltip;
}
}, },
template: ` template: `
<td class="commit-link"> <td class="commit-link">
<a <a
:class="cssClasses" :class="cssClasses"
:href="detailsPath" :href="detailsPath"
:title="tooltipTitle"
v-html="content"> v-html="content">
</a> </a>
</td> </td>
......
...@@ -13,6 +13,7 @@ class PipelineEntity < Grape::Entity ...@@ -13,6 +13,7 @@ class PipelineEntity < Grape::Entity
expose :details do expose :details do
expose :detailed_status, as: :status, with: StatusEntity expose :detailed_status, as: :status, with: StatusEntity
expose :status_tooltip
expose :duration expose :duration
expose :finished_at expose :finished_at
expose :stages, using: StageEntity expose :stages, using: StageEntity
...@@ -81,4 +82,8 @@ class PipelineEntity < Grape::Entity ...@@ -81,4 +82,8 @@ class PipelineEntity < Grape::Entity
def detailed_status def detailed_status
pipeline.detailed_status(request.user) pipeline.detailed_status(request.user)
end end
def status_tooltip
"This pipeline is redundant as a newer pipeline exists (canceled by ##{pipeline.auto_canceled_by_id} pipeline)" if pipeline.auto_canceled_by_id? && pipeline.canceled?
end
end end
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