Commit 52c79bc8 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Add realtime pipeline status component for files

parent a3b85d10
import Vue from 'vue';
import commitPipelineStatus from '~/projects/tree/components/commit_pipeline_status_component.vue';
import BlobViewer from '~/blob/viewer/index'; import BlobViewer from '~/blob/viewer/index';
import initBlob from '~/pages/projects/init_blob'; import initBlob from '~/pages/projects/init_blob';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
new BlobViewer(); // eslint-disable-line no-new new BlobViewer(); // eslint-disable-line no-new
initBlob(); initBlob();
const CommitPipelineStatusEl = document.querySelector('.js-commit-pipeline-status');
const statusLink = document.querySelector('.commit-actions .ci-status-link');
if (statusLink) {
statusLink.remove();
// eslint-disable-next-line no-new
new Vue({
el: CommitPipelineStatusEl,
components: {
commitPipelineStatus,
},
render(createElement) {
return createElement('commit-pipeline-status', {
props: {
endpoint: CommitPipelineStatusEl.dataset.endpoint,
},
});
},
});
}
}); });
---
title: Add realtime pipeline status for adding/viewing files
merge_request: 17705
author:
type: other
...@@ -509,4 +509,20 @@ feature 'File blob', :js do ...@@ -509,4 +509,20 @@ feature 'File blob', :js do
end end
end end
end end
context 'realtime pipelines' do
let(:user) { create(:user) }
let(:pipeline) { create(:ci_pipeline, project: project, ref: 'feature', sha: project.commit.id, user: user, status: :success) }
before do
project.add_master(user)
sign_in(user)
visit_blob('files/ruby/popen.rb', ref: 'feature')
end
it 'should show the realtime pipeline status' do
wait_for_requests
expect(find('.js-commit-pipeline-status')).not_to be nil
end
end
end end
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