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
This commit is contained in:
parent
d777e6f1da
commit
a087283335
8 changed files with 23 additions and 14 deletions
|
@ -91,7 +91,7 @@
|
||||||
%strong ##{build.id}
|
%strong ##{build.id}
|
||||||
|
|
||||||
%td.status
|
%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
|
%td.status
|
||||||
- if project
|
- if project
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
- status = local_assigns.fetch(:status)
|
- status = local_assigns.fetch(:status)
|
||||||
- css_classes = "ci-status ci-#{status.group}"
|
|
||||||
|
|
||||||
- if status.has_details?
|
%span{ class: "ci-status ci-#{status.group}" }
|
||||||
= link_to status.details_path, class: css_classes do
|
|
||||||
= custom_icon(status.icon)
|
|
||||||
= status.text
|
|
||||||
- else
|
|
||||||
%span{ class: css_classes }
|
|
||||||
= custom_icon(status.icon)
|
= custom_icon(status.icon)
|
||||||
= status.text
|
= status.text
|
||||||
|
|
11
app/views/ci/status/_badge_link.html.haml
Normal file
11
app/views/ci/status/_badge_link.html.haml
Normal file
|
@ -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
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
%tr.build.commit{ class: ('retried' if retried) }
|
%tr.build.commit{ class: ('retried' if retried) }
|
||||||
%td.status
|
%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
|
%td.branch-commit
|
||||||
- if can?(current_user, :read_build, build)
|
- if can?(current_user, :read_build, build)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
%tr.commit
|
%tr.commit
|
||||||
%td.commit-link
|
%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
|
%td
|
||||||
= link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id) do
|
= link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id) do
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
%tr.generic_commit_status{ class: ('retried' if retried) }
|
%tr.generic_commit_status{ class: ('retried' if retried) }
|
||||||
%td.status
|
%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
|
%td.generic_commit_status-link
|
||||||
- if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url
|
- if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
.page-content-header
|
.page-content-header
|
||||||
.header-main-content
|
.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}
|
%strong Pipeline ##{@commit.pipelines.last.id}
|
||||||
triggered #{time_ago_with_tooltip(@commit.authored_date)} by
|
triggered #{time_ago_with_tooltip(@commit.authored_date)} by
|
||||||
= author_avatar(@commit, size: 24)
|
= author_avatar(@commit, size: 24)
|
||||||
|
|
4
changelogs/unreleased/26947-build-status-self-link.yml
Normal file
4
changelogs/unreleased/26947-build-status-self-link.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Add new ci status partial to render a badge without a link
|
||||||
|
merge_request:
|
||||||
|
author: 8740
|
Loading…
Reference in a new issue