Commit 449b0eba authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Restored some code, add hidden class

parent bfc2b8a3
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,
},
});
},
});
};
......@@ -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',
......
......@@ -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)
......
......@@ -26,6 +26,9 @@
%span.commit-row-message.visible-xs-inline
·
= 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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment