summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2018-01-22 18:34:21 -0600
committerJose Ivan Vargas <jvargas@gitlab.com>2018-01-30 09:24:57 -0600
commit449b0ebaf6f3ca65b48f372293117acc9a7e0abc (patch)
tree7a069e1708a82cf989439c80a2f9b1d46e888491
parentbfc2b8a3d2c06c80126365348ce75b3985185e83 (diff)
downloadgitlab-ce-449b0ebaf6f3ca65b48f372293117acc9a7e0abc.tar.gz
Restored some code, add hidden class
-rw-r--r--app/assets/javascripts/pages/projects/show/index.js18
-rw-r--r--app/assets/javascripts/pages/projects/tree/show/index.js5
-rw-r--r--app/helpers/ci_status_helper.rb11
-rw-r--r--app/views/projects/commits/_commit.html.haml8
4 files changed, 23 insertions, 19 deletions
diff --git a/app/assets/javascripts/pages/projects/show/index.js b/app/assets/javascripts/pages/projects/show/index.js
index 0213b46eb7c..4c42fda16d7 100644
--- a/app/assets/javascripts/pages/projects/show/index.js
+++ b/app/assets/javascripts/pages/projects/show/index.js
@@ -1,4 +1,3 @@
-import Vue from 'vue';
import ShortcutsNavigation from '~/shortcuts_navigation';
import NotificationsForm from '~/notifications_form';
import UserCallout from '~/user_callout';
@@ -26,21 +25,4 @@ export default () => {
$('#tree-slider').waitForImages(() => {
ajaxGet(document.querySelector('.js-tree-content').dataset.logsPath);
});
-
- const commitPipelineStatusEl = document.getElementById('commit-pipeline-status');
- // eslint-disable-next-line no-new
- new Vue({
- el: '#commit-pipeline-status',
- components: {
- commitPipelineStatus,
- },
- render(createElement) {
- return createElement('commit-pipeline-status', {
- props: {
- endpoint: commitPipelineStatusEl.dataset.endpoint,
- realtime: false,
- },
- });
- },
- });
};
diff --git a/app/assets/javascripts/pages/projects/tree/show/index.js b/app/assets/javascripts/pages/projects/tree/show/index.js
index c0b3f98e66d..f14c3f86687 100644
--- a/app/assets/javascripts/pages/projects/tree/show/index.js
+++ b/app/assets/javascripts/pages/projects/tree/show/index.js
@@ -15,6 +15,11 @@ export default () => {
ajaxGet(document.querySelector('.js-tree-content').dataset.logsPath));
const commitPipelineStatusEl = document.getElementById('commit-pipeline-status');
+ const $statusLink = $('.ci-status-link');
+ if ($statusLink.length > 0) {
+ $statusLink.remove();
+ }
+ commitPipelineStatusEl.classList.remove('hidden');
// eslint-disable-next-line no-new
new Vue({
el: '#commit-pipeline-status',
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb
index e8365f1da1e..636316da80a 100644
--- a/app/helpers/ci_status_helper.rb
+++ b/app/helpers/ci_status_helper.rb
@@ -103,6 +103,17 @@ module CiStatusHelper
tooltip_placement: tooltip_placement)
end
+ def render_commit_status(commit, ref: nil, tooltip_placement: 'auto left')
+ project = commit.project
+ path = pipelines_project_commit_path(project, commit)
+
+ render_status_with_link(
+ 'commit',
+ commit.status(ref),
+ path,
+ tooltip_placement: tooltip_placement)
+ end
+
def render_pipeline_status(pipeline, tooltip_placement: 'auto left')
project = pipeline.project
path = project_pipeline_path(project, pipeline)
diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml
index 436e1739180..c94e10947e6 100644
--- a/app/views/projects/commits/_commit.html.haml
+++ b/app/views/projects/commits/_commit.html.haml
@@ -26,6 +26,9 @@
%span.commit-row-message.visible-xs-inline
&middot;
= commit.short_id
+ - if commit.status(ref)
+ .visible-xs-inline
+ = render_commit_status(commit, ref: ref)
- if commit.description?
%button.text-expander.hidden-xs.js-toggle-button{ type: "button" } ...
@@ -45,7 +48,10 @@
- else
= render partial: 'projects/commit/ajax_signature', locals: { commit: commit }
- #commit-pipeline-status{ data: { endpoint: pipelines_project_commit_path(project, commit.id) } }
+ - if commit.status(ref)
+ = render_commit_status(commit, ref: ref)
+
+ #commit-pipeline-status.hidden{ data: { endpoint: pipelines_project_commit_path(project, commit.id) } }
= link_to commit.short_id, link, class: "commit-sha btn btn-transparent btn-link"
= clipboard_button(text: commit.id, title: _("Copy commit SHA to clipboard"))
= link_to_browse_code(project, commit)