summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-01-24 11:25:27 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-01-27 14:27:07 +0000
commita0872833351bba7fb9f2f78101a6ba87f83c21b2 (patch)
treedc6a7672d0caef95e93db81086c037d00c7caea3
parentd777e6f1da98be64b872a2bea2222f3e037a3d4d (diff)
downloadgitlab-ce-a0872833351bba7fb9f2f78101a6ba87f83c21b2.tar.gz
Use new partial to render a badge without a link in the builds details. Preventing from having a link to itself.
Adds MR ID to CHANGELOG entry
-rw-r--r--app/views/admin/runners/show.html.haml2
-rw-r--r--app/views/ci/status/_badge.html.haml12
-rw-r--r--app/views/ci/status/_badge_link.html.haml11
-rw-r--r--app/views/projects/ci/builds/_build.html.haml2
-rw-r--r--app/views/projects/ci/pipelines/_pipeline.html.haml2
-rw-r--r--app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml2
-rw-r--r--app/views/projects/pipelines/_info.html.haml2
-rw-r--r--changelogs/unreleased/26947-build-status-self-link.yml4
8 files changed, 23 insertions, 14 deletions
diff --git a/app/views/admin/runners/show.html.haml b/app/views/admin/runners/show.html.haml
index 39e103e3062..28e1f2aba36 100644
--- a/app/views/admin/runners/show.html.haml
+++ b/app/views/admin/runners/show.html.haml
@@ -91,7 +91,7 @@
%strong ##{build.id}
%td.status
- = render 'ci/status/badge', status: build.detailed_status(current_user)
+ = render 'ci/status/badge_link', status: build.detailed_status(current_user)
%td.status
- if project
diff --git a/app/views/ci/status/_badge.html.haml b/app/views/ci/status/_badge.html.haml
index 601fb7f0f3f..a4f05fefc53 100644
--- a/app/views/ci/status/_badge.html.haml
+++ b/app/views/ci/status/_badge.html.haml
@@ -1,11 +1,5 @@
- status = local_assigns.fetch(:status)
-- css_classes = "ci-status ci-#{status.group}"
-- if status.has_details?
- = link_to status.details_path, class: css_classes do
- = custom_icon(status.icon)
- = status.text
-- else
- %span{ class: css_classes }
- = custom_icon(status.icon)
- = status.text
+%span{ class: "ci-status ci-#{status.group}" }
+ = custom_icon(status.icon)
+ = status.text
diff --git a/app/views/ci/status/_badge_link.html.haml b/app/views/ci/status/_badge_link.html.haml
new file mode 100644
index 00000000000..601fb7f0f3f
--- /dev/null
+++ b/app/views/ci/status/_badge_link.html.haml
@@ -0,0 +1,11 @@
+- status = local_assigns.fetch(:status)
+- css_classes = "ci-status ci-#{status.group}"
+
+- if status.has_details?
+ = link_to status.details_path, class: css_classes do
+ = custom_icon(status.icon)
+ = status.text
+- else
+ %span{ class: css_classes }
+ = custom_icon(status.icon)
+ = status.text
diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml
index c1e496455d1..fdf675f5f52 100644
--- a/app/views/projects/ci/builds/_build.html.haml
+++ b/app/views/projects/ci/builds/_build.html.haml
@@ -9,7 +9,7 @@
%tr.build.commit{ class: ('retried' if retried) }
%td.status
- = render "ci/status/badge", status: build.detailed_status(current_user)
+ = render "ci/status/badge_link", status: build.detailed_status(current_user)
%td.branch-commit
- if can?(current_user, :read_build, build)
diff --git a/app/views/projects/ci/pipelines/_pipeline.html.haml b/app/views/projects/ci/pipelines/_pipeline.html.haml
index 818a70f38f1..1d11d1aa931 100644
--- a/app/views/projects/ci/pipelines/_pipeline.html.haml
+++ b/app/views/projects/ci/pipelines/_pipeline.html.haml
@@ -4,7 +4,7 @@
%tr.commit
%td.commit-link
- = render 'ci/status/badge', status: pipeline.detailed_status(current_user)
+ = render 'ci/status/badge_link', status: pipeline.detailed_status(current_user)
%td
= link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id) do
diff --git a/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml b/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
index 07fb80750d6..55a9899280f 100644
--- a/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
+++ b/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
@@ -8,7 +8,7 @@
%tr.generic_commit_status{ class: ('retried' if retried) }
%td.status
- = render 'ci/status/badge', status: generic_commit_status.detailed_status(current_user)
+ = render 'ci/status/badge_link', status: generic_commit_status.detailed_status(current_user)
%td.generic_commit_status-link
- if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url
diff --git a/app/views/projects/pipelines/_info.html.haml b/app/views/projects/pipelines/_info.html.haml
index ca76f13ef5e..3bd822ead76 100644
--- a/app/views/projects/pipelines/_info.html.haml
+++ b/app/views/projects/pipelines/_info.html.haml
@@ -1,6 +1,6 @@
.page-content-header
.header-main-content
- = render 'ci/status/badge', status: @pipeline.detailed_status(current_user)
+ = render 'ci/status/badge_link', status: @pipeline.detailed_status(current_user)
%strong Pipeline ##{@commit.pipelines.last.id}
triggered #{time_ago_with_tooltip(@commit.authored_date)} by
= author_avatar(@commit, size: 24)
diff --git a/changelogs/unreleased/26947-build-status-self-link.yml b/changelogs/unreleased/26947-build-status-self-link.yml
new file mode 100644
index 00000000000..5a165d5b96e
--- /dev/null
+++ b/changelogs/unreleased/26947-build-status-self-link.yml
@@ -0,0 +1,4 @@
+---
+title: Add new ci status partial to render a badge without a link
+merge_request:
+author: 8740