diff options
author | Scott Hampton <shampton@gitlab.com> | 2019-02-26 20:59:41 +0300 |
---|---|---|
committer | Scott Hampton <shampton@gitlab.com> | 2019-02-26 20:59:41 +0300 |
commit | 2b51745394e8568cf91ce6ee95574f84fc38722e (patch) | |
tree | a79f06ab99d1985bee0458894d69d0a68867b2b0 /app/views | |
parent | 506ac78d48b6a96081b02818c432650b8508913a (diff) |
Removed other deprecated status helpers
Updating a couple other places that were still using deprecated status.
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/ci/status/_icon.html.haml | 13 | ||||
-rw-r--r-- | app/views/projects/commits/_commit.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/issues/_merge_requests.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/issues/_related_branches.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/merge_requests/_merge_request.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/projects/_project.html.haml | 2 |
6 files changed, 11 insertions, 14 deletions
diff --git a/app/views/ci/status/_icon.html.haml b/app/views/ci/status/_icon.html.haml index 1fd34eacdf7..1fcbd9e7545 100644 --- a/app/views/ci/status/_icon.html.haml +++ b/app/views/ci/status/_icon.html.haml @@ -1,13 +1,10 @@ - status = local_assigns.fetch(:status) - size = local_assigns.fetch(:size, 16) -- link = local_assigns.fetch(:link, true) -- title = local_assigns.fetch(:title, "Pipeline: #{status.label}") +- type = local_assigns.fetch(:type, 'pipeline') +- title = local_assigns.fetch(:title, "#{type.titleize}: #{status.label}") - tooltip_placement = local_assigns.fetch(:tooltip_placement, "left") -- css_classes = "ci-status-link ci-status-icon ci-status-icon-#{status.group} #{'has-tooltip' if title.present?}" +- css_classes = "ci-status-link ci-status-icon ci-status-icon-#{status.group} has-tooltip" -- if link && status.has_details? - = link_to status.details_path, class: css_classes, title: title, data: { html: title.present?, placement: tooltip_placement } do - = sprite_icon(status.icon, size: size) -- else - %span{ class: css_classes, title: title, data: { html: title.present?, placement: tooltip_placement } } +- if status.has_details? + = link_to status.details_path, class: css_classes, title: title, data: { html: true, placement: tooltip_placement } do = sprite_icon(status.icon, size: size) diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index 0d3c6e7027c..1d7890f1c47 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -25,7 +25,7 @@ = commit.short_id - if commit_status .d-block.d-sm-none - = render_commit_status(commit, ref: ref) + = render 'ci/status/icon', status: commit.last_pipeline.detailed_status(current_user), type: 'commit', size: 24 - if commit.description? %button.text-expander.js-toggle-button = sprite_icon('ellipsis_h', size: 12) @@ -47,7 +47,7 @@ = render partial: 'projects/commit/ajax_signature', locals: { commit: commit } - if commit_status - = render_commit_status(commit, ref: ref) + = render 'ci/status/icon', status: commit.last_pipeline.detailed_status(current_user), type: 'commit', size: 24 .js-commit-pipeline-status{ data: { endpoint: pipelines_project_commit_path(project, commit.id, ref: ref) } } diff --git a/app/views/projects/issues/_merge_requests.html.haml b/app/views/projects/issues/_merge_requests.html.haml index 7468217418d..6a66c2e57cc 100644 --- a/app/views/projects/issues/_merge_requests.html.haml +++ b/app/views/projects/issues/_merge_requests.html.haml @@ -27,7 +27,7 @@ = merge_request.to_reference %span.mr-ci-status.flex-md-grow-1.justify-content-end.d-flex.ml-md-2 - if merge_request.can_read_pipeline? - = render 'ci/status/icon', status: merge_request.head_pipeline.detailed_status(current_user), link: true, tooltip_placement: 'bottom' + = render 'ci/status/icon', status: merge_request.head_pipeline.detailed_status(current_user), tooltip_placement: 'bottom' - elsif has_any_head_pipeline = icon('blank fw') diff --git a/app/views/projects/issues/_related_branches.html.haml b/app/views/projects/issues/_related_branches.html.haml index f8d1d64100a..6da4956a036 100644 --- a/app/views/projects/issues/_related_branches.html.haml +++ b/app/views/projects/issues/_related_branches.html.haml @@ -8,7 +8,7 @@ - pipeline = @project.pipeline_for(branch, target.sha) if target - if can?(current_user, :read_pipeline, pipeline) %span.related-branch-ci-status - = render 'ci/status/icon', status: pipeline.detailed_status(current_user), link: true + = render 'ci/status/icon', status: pipeline.detailed_status(current_user) %span.related-branch-info %strong = link_to branch, project_compare_path(@project, from: @project.default_branch, to: branch), class: "ref-name" diff --git a/app/views/projects/merge_requests/_merge_request.html.haml b/app/views/projects/merge_requests/_merge_request.html.haml index 4111e823701..bfa5a471886 100644 --- a/app/views/projects/merge_requests/_merge_request.html.haml +++ b/app/views/projects/merge_requests/_merge_request.html.haml @@ -48,7 +48,7 @@ CLOSED - if can?(current_user, :read_pipeline, merge_request.head_pipeline) %li.issuable-pipeline-status.d-none.d-sm-inline-block - = render 'ci/status/icon', status: merge_request.head_pipeline.detailed_status(current_user), link: true + = render 'ci/status/icon', status: merge_request.head_pipeline.detailed_status(current_user) - if merge_request.open? && merge_request.broken? %li.issuable-pipeline-broken.d-none.d-sm-inline-block = link_to merge_request_path(merge_request), class: "has-tooltip", title: _('Cannot be merged automatically') do diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml index df17ae95e2a..2a38dce4896 100644 --- a/app/views/shared/projects/_project.html.haml +++ b/app/views/shared/projects/_project.html.haml @@ -85,6 +85,6 @@ = number_with_delimiter(project.open_issues_count) - if pipeline_status && can?(current_user, :read_cross_project) && project.pipeline_status.has_status? && can?(current_user, :read_build, project) %span.icon-wrapper.pipeline-status - = render_project_pipeline_status(project.pipeline_status, tooltip_placement: 'top') + = render 'ci/status/icon', status: project.commit.last_pipeline.detailed_status(current_user), type: 'commit', tooltip_placement: 'top' .updated-note %span Updated #{updated_tooltip} |