diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-01-27 14:20:57 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-01-27 14:36:46 +0000 |
commit | 6679a9062ad9f3ee9092655a5129feba1bcdd9d7 (patch) | |
tree | 3bb0840040c3c0be97d6155381e4d3b574df8b74 | |
parent | 4ab83117fb5496be8c850925c78f32823593d5b2 (diff) | |
download | gitlab-ce-6679a9062ad9f3ee9092655a5129feba1bcdd9d7.tar.gz |
Use badge partial as single source of truth instead of having 2 partials doing the same26947-build-status-self-link
Update changelog description
Changes after review
-rw-r--r-- | app/views/admin/runners/show.html.haml | 2 | ||||
-rw-r--r-- | app/views/ci/status/_badge.html.haml | 13 | ||||
-rw-r--r-- | app/views/ci/status/_badge_link.html.haml | 9 | ||||
-rw-r--r-- | app/views/projects/builds/_header.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/ci/builds/_build.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/ci/pipelines/_pipeline.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/pipelines/_info.html.haml | 2 | ||||
-rw-r--r-- | changelogs/unreleased/26947-build-status-self-link.yml | 2 |
9 files changed, 17 insertions, 19 deletions
diff --git a/app/views/admin/runners/show.html.haml b/app/views/admin/runners/show.html.haml index 28e1f2aba36..39e103e3062 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_link', status: build.detailed_status(current_user) + = render 'ci/status/badge', 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 a4f05fefc53..c00c7f7407e 100644 --- a/app/views/ci/status/_badge.html.haml +++ b/app/views/ci/status/_badge.html.haml @@ -1,5 +1,12 @@ - status = local_assigns.fetch(:status) +- link = local_assigns.fetch(:link, true) +- css_classes = "ci-status ci-#{status.group}" -%span{ class: "ci-status ci-#{status.group}" } - = custom_icon(status.icon) - = status.text +- if link && 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/ci/status/_badge_link.html.haml b/app/views/ci/status/_badge_link.html.haml deleted file mode 100644 index 27011fe7478..00000000000 --- a/app/views/ci/status/_badge_link.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -- 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 - = render "ci/status/badge", status: status diff --git a/app/views/projects/builds/_header.html.haml b/app/views/projects/builds/_header.html.haml index 91eeee1800e..736b485bf06 100644 --- a/app/views/projects/builds/_header.html.haml +++ b/app/views/projects/builds/_header.html.haml @@ -1,6 +1,6 @@ .content-block.build-header .header-content - = render 'ci/status/badge', status: @build.detailed_status(current_user) + = render 'ci/status/badge', status: @build.detailed_status(current_user), link: false Build %strong.js-build-id ##{@build.id} in pipeline diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml index fdf675f5f52..c1e496455d1 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_link", status: build.detailed_status(current_user) + = render "ci/status/badge", 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 1d11d1aa931..818a70f38f1 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_link', status: pipeline.detailed_status(current_user) + = render 'ci/status/badge', 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 55a9899280f..07fb80750d6 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_link', status: generic_commit_status.detailed_status(current_user) + = render 'ci/status/badge', 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 3bd822ead76..ca76f13ef5e 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_link', status: @pipeline.detailed_status(current_user) + = render 'ci/status/badge', 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 index a6444eef838..15c5821874e 100644 --- a/changelogs/unreleased/26947-build-status-self-link.yml +++ b/changelogs/unreleased/26947-build-status-self-link.yml @@ -1,4 +1,4 @@ --- -title: Add new ci status partial to render a badge without a link +title: Add link verification to badge partial in order to render a badge without a link merge_request: 8740 author: |