summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorScott Hampton <shampton@gitlab.com>2019-02-26 14:10:24 -0700
committerScott Hampton <shampton@gitlab.com>2019-02-26 14:10:24 -0700
commit40d15136352958206685197d4176f15781089849 (patch)
treea9f5dc43b3e13aaeb3ae9feca6833aa6e1eabbac /app/views
parent2b51745394e8568cf91ce6ee95574f84fc38722e (diff)
downloadgitlab-ce-40d15136352958206685197d4176f15781089849.tar.gz
Adding ability to pass in path to status icon
Project passed a very specific details path. Also reverted a change.
Diffstat (limited to 'app/views')
-rw-r--r--app/views/ci/status/_icon.html.haml6
-rw-r--r--app/views/projects/commits/_commit.html.haml4
-rw-r--r--app/views/shared/projects/_project.html.haml3
3 files changed, 9 insertions, 4 deletions
diff --git a/app/views/ci/status/_icon.html.haml b/app/views/ci/status/_icon.html.haml
index 1fcbd9e7545..f406eb4b5a3 100644
--- a/app/views/ci/status/_icon.html.haml
+++ b/app/views/ci/status/_icon.html.haml
@@ -3,8 +3,12 @@
- type = local_assigns.fetch(:type, 'pipeline')
- title = local_assigns.fetch(:title, "#{type.titleize}: #{status.label}")
- tooltip_placement = local_assigns.fetch(:tooltip_placement, "left")
+- path = local_assigns.fetch(:path, status.has_details? ? status.details_path : nil)
- css_classes = "ci-status-link ci-status-icon ci-status-icon-#{status.group} has-tooltip"
- if status.has_details?
- = link_to status.details_path, class: css_classes, title: title, data: { html: true, placement: tooltip_placement } do
+ = link_to path, class: css_classes, title: title, data: { html: true, placement: tooltip_placement } do
+ = sprite_icon(status.icon, size: size)
+- else
+ %span{ class: css_classes, title: title, data: { html: true, placement: tooltip_placement } }
= 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 1d7890f1c47..0d3c6e7027c 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 'ci/status/icon', status: commit.last_pipeline.detailed_status(current_user), type: 'commit', size: 24
+ = render_commit_status(commit, ref: ref)
- 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 'ci/status/icon', status: commit.last_pipeline.detailed_status(current_user), type: 'commit', size: 24
+ = render_commit_status(commit, ref: ref)
.js-commit-pipeline-status{ data: { endpoint: pipelines_project_commit_path(project, commit.id, ref: ref) } }
diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml
index 2a38dce4896..8ff676c3cf8 100644
--- a/app/views/shared/projects/_project.html.haml
+++ b/app/views/shared/projects/_project.html.haml
@@ -84,7 +84,8 @@
= sprite_icon('issues', size: 14, css_class: 'append-right-4')
= 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)
+ - pipeline_path = pipelines_project_commit_path(project.pipeline_status.project, project.pipeline_status.sha, ref: project.pipeline_status.ref)
%span.icon-wrapper.pipeline-status
- = render 'ci/status/icon', status: project.commit.last_pipeline.detailed_status(current_user), type: 'commit', tooltip_placement: 'top'
+ = render 'ci/status/icon', status: project.commit.last_pipeline.detailed_status(current_user), type: 'commit', tooltip_placement: 'top', path: pipeline_path
.updated-note
%span Updated #{updated_tooltip}