2016-11-24 11:43:54 -05:00
|
|
|
//= require lib/utils/bootstrap_linked_tabs
|
|
|
|
|
2016-10-26 04:02:58 -04:00
|
|
|
/* eslint-disable */
|
2016-09-29 17:24:37 -04:00
|
|
|
((global) => {
|
|
|
|
|
|
|
|
class Pipelines {
|
2016-11-24 11:43:54 -05:00
|
|
|
constructor(options) {
|
|
|
|
|
|
|
|
if (options.initTabs && options.tabsOptions) {
|
2016-11-29 05:35:53 -05:00
|
|
|
new global.LinkedTabs(options.tabsOptions);
|
2016-11-24 11:43:54 -05:00
|
|
|
}
|
|
|
|
|
2016-10-06 16:20:25 -04:00
|
|
|
this.addMarginToBuildColumns();
|
2016-09-12 06:19:20 -04:00
|
|
|
}
|
|
|
|
|
2016-09-29 17:24:37 -04:00
|
|
|
addMarginToBuildColumns() {
|
2016-11-10 12:56:37 -05:00
|
|
|
this.pipelineGraph = document.querySelector('.pipeline-graph');
|
|
|
|
const secondChildBuildNodes = document.querySelector('.pipeline-graph').querySelectorAll('.build:nth-child(2)');
|
2016-10-20 17:18:39 -04: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 17:24:37 -04:00
|
|
|
}
|
2016-10-17 15:06:56 -04:00
|
|
|
this.pipelineGraph.classList.remove('hidden');
|
2016-08-23 12:02:52 -04:00
|
|
|
}
|
2016-08-17 17:41:24 -04:00
|
|
|
}
|
2016-08-16 20:42:05 -04:00
|
|
|
|
2016-09-29 17:24:37 -04:00
|
|
|
global.Pipelines = Pipelines;
|
|
|
|
|
|
|
|
})(window.gl || (window.gl = {}));
|