Fix after review

Adds require statement
This commit is contained in:
Filipa Lacerda 2016-11-24 16:43:54 +00:00
parent da8c2e6987
commit cc4434a483
4 changed files with 20 additions and 13 deletions

View file

@ -135,8 +135,18 @@
new TreeView();
}
break;
case 'projects:pipelines:builds':
case 'projects:pipelines:show':
new gl.Pipelines();
const controllerAction = document.querySelector('.js-pipeline-container').dataset.controllerAction;
new gl.Pipelines({
initTabs: true,
tabsOptions: {
action: controllerAction,
defaultAction: 'pipelines',
parentEl: '.pipelines-tabs',
},
});
break;
case 'groups:activity':
new gl.Activities();

View file

@ -1,8 +1,15 @@
//= require lib/utils/bootstrap_linked_tabs
/* eslint-disable */
((global) => {
class Pipelines {
constructor() {
constructor(options) {
if (options.initTabs && options.tabsOptions) {
new window.gl.LinkedTabs(options.tabsOptions);
}
this.addMarginToBuildColumns();
}

View file

@ -52,13 +52,3 @@
%th
- pipeline.statuses.relevant.stages.each do |stage|
= render 'projects/commit/ci_stage', stage: stage, statuses: pipeline.statuses.relevant.where(stage: stage)
:javascript
var pipelines_tab;
pipelines_tab = new window.gl.LinkedTabs({
action: "#{controller.action_name}",
defaultAction: 'pipelines',
parentEl: '.pipelines-tabs'
});

View file

@ -2,7 +2,7 @@
- page_title "Pipeline"
= render "projects/pipelines/head"
%div{ class: container_class }
%div.js-pipeline-container{ class: container_class, data: {controller_action: "#{controller.action_name}"} }
- if @commit
= render "projects/pipelines/info"