69e4072f89
* master: (389 commits)
Document "No gems fetched from git repositories" policy [ci skip]
Typos
Small gramatical tweaks
Typos
Added PHP & NPM doc
Use `:empty_project` where possible in request specs
Add caching of droplab ajax requests
Use `:empty_project` where possible in model specs
Revert 3f17f29a
Remove unused js response from refs controller
Add MR id to changelog entry
fixed small mini pipeline graph line glitch
Prevent form to be submitted twice
Fix Error 500 when repositories contain annotated tags pointing to blobs
Fix /explore sorting (trending)
Simplify wording in "adding an image" docs
Remove "official merge window" from CONTRIBUTING.md [ci skip]
Update repository check documentation
Fixed flexbox and wrap issues
Update two_factor_authentication.md
...
38 lines
1.5 KiB
JavaScript
38 lines
1.5 KiB
JavaScript
/* eslint-disable no-new, guard-for-in, no-restricted-syntax, no-continue, no-param-reassign, max-len */
|
|
|
|
require('./lib/utils/bootstrap_linked_tabs');
|
|
|
|
((global) => {
|
|
class Pipelines {
|
|
constructor(options = {}) {
|
|
if (options.initTabs && options.tabsOptions) {
|
|
new global.LinkedTabs(options.tabsOptions);
|
|
}
|
|
|
|
this.addMarginToBuildColumns();
|
|
}
|
|
|
|
addMarginToBuildColumns() {
|
|
this.pipelineGraph = document.querySelector('.js-pipeline-graph');
|
|
|
|
const secondChildBuildNodes = this.pipelineGraph.querySelectorAll('.build:nth-child(2)');
|
|
|
|
for (const 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');
|
|
}
|
|
|
|
this.pipelineGraph.classList.remove('hidden');
|
|
}
|
|
}
|
|
|
|
global.Pipelines = Pipelines;
|
|
})(window.gl || (window.gl = {}));
|