2016-11-24 16:43:54 +00:00
|
|
|
//= require lib/utils/bootstrap_linked_tabs
|
|
|
|
|
2016-10-26 08:02:58 +00:00
|
|
|
/* eslint-disable */
|
2016-09-29 21:24:37 +00:00
|
|
|
((global) => {
|
|
|
|
|
|
|
|
class Pipelines {
|
2016-12-09 14:37:41 +00:00
|
|
|
constructor(options = {}) {
|
2016-11-24 16:43:54 +00:00
|
|
|
|
|
|
|
if (options.initTabs && options.tabsOptions) {
|
2016-11-29 10:35:53 +00:00
|
|
|
new global.LinkedTabs(options.tabsOptions);
|
2016-11-24 16:43:54 +00:00
|
|
|
}
|
|
|
|
|
2016-10-06 20:20:25 +00:00
|
|
|
this.addMarginToBuildColumns();
|
2016-09-12 10:19:20 +00:00
|
|
|
}
|
|
|
|
|
2016-09-29 21:24:37 +00:00
|
|
|
addMarginToBuildColumns() {
|
2016-11-10 17:56:37 +00:00
|
|
|
this.pipelineGraph = document.querySelector('.pipeline-graph');
|
|
|
|
const secondChildBuildNodes = document.querySelector('.pipeline-graph').querySelectorAll('.build:nth-child(2)');
|
2016-10-20 21:18:39 +00:00
|
|
|
for (buildNodeIndex in secondChildBuildNodes) {
|
|
|
|
const buildNode = secondChildBuildNodes[buildNodeIndex];
|
|
|
|
const firstChildBuildNode = buildNode.previousElementSibling;
|
|
|
|
if (!firstChildBuildNode || !firstChildBuildNode.matches('.build')) continue;
|
|
|
|
const multiBuildColumn = buildNode.closest('.stage-column');
|
|
|
|
const previousColumn = multiBuildColumn.previousElementSibling;
|
|
|
|
if (!previousColumn || !previousColumn.matches('.stage-column')) continue;
|
|
|
|
multiBuildColumn.classList.add('left-margin');
|
|
|
|
firstChildBuildNode.classList.add('left-connector');
|
|
|
|
const columnBuilds = previousColumn.querySelectorAll('.build');
|
|
|
|
if (columnBuilds.length === 1) previousColumn.classList.add('no-margin');
|
2016-09-29 21:24:37 +00:00
|
|
|
}
|
2016-10-17 19:06:56 +00:00
|
|
|
this.pipelineGraph.classList.remove('hidden');
|
2016-08-23 16:02:52 +00:00
|
|
|
}
|
2016-08-17 21:41:24 +00:00
|
|
|
}
|
2016-08-17 00:42:05 +00:00
|
|
|
|
2016-09-29 21:24:37 +00:00
|
|
|
global.Pipelines = Pipelines;
|
|
|
|
|
|
|
|
})(window.gl || (window.gl = {}));
|