BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d5a223bd
Commit
d5a223bd
authored
Feb 05, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use webpack
parent
2621ce5c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
44 deletions
+25
-44
pipelines_bundle.js.es6
...sets/javascripts/commit/pipelines/pipelines_bundle.js.es6
+4
-3
pipelines_service.js.es6
...ets/javascripts/commit/pipelines/pipelines_service.js.es6
+3
-13
pipelines_store.js.es6
...ssets/javascripts/commit/pipelines/pipelines_store.js.es6
+10
-17
pipelines_table.js.es6
...ssets/javascripts/commit/pipelines/pipelines_table.js.es6
+8
-11
No files found.
app/assets/javascripts/commit/pipelines/pipelines_bundle.js.es6
View file @
d5a223bd
/* eslint-disable no-new, no-param-reassign */
/* eslint-disable no-new, no-param-reassign */
/* global Vue, CommitsPipelineStore, PipelinesService, Flash */
/* global Vue, CommitsPipelineStore, PipelinesService, Flash */
//= require vue
window.Vue = require('vue');
//= require_tree .
require('./pipelines_store');
require('./pipelines_service');
require('./pipelines_table');
/**
/**
* Commits View > Pipelines Tab > Pipelines Table.
* Commits View > Pipelines Tab > Pipelines Table.
* Merge Request View > Pipelines Tab > Pipelines Table.
* Merge Request View > Pipelines Tab > Pipelines Table.
...
...
app/assets/javascripts/commit/pipelines/pipelines_service.js.es6
View file @
d5a223bd
...
@@ -8,18 +8,8 @@
...
@@ -8,18 +8,8 @@
* Uses Vue.Resource
* Uses Vue.Resource
*/
*/
class PipelinesService {
class PipelinesService {
constructor(root) {
constructor(endpoint) {
Vue.http.options.root = root;
this.pipelines = Vue.resource(endpoint);
this.pipelines = Vue.resource(root);
Vue.http.interceptors.push((request, next) => {
// needed in order to not break the tests.
if ($.rails) {
request.headers['X-CSRF-Token'] = $.rails.csrfToken();
}
next();
});
}
}
/**
/**
...
@@ -28,7 +18,7 @@ class PipelinesService {
...
@@ -28,7 +18,7 @@ class PipelinesService {
*
*
* @return {Promise}
* @return {Promise}
*/
*/
all
() {
get
() {
return this.pipelines.get();
return this.pipelines.get();
}
}
}
}
...
...
app/assets/javascripts/commit/pipelines/pipelines_store.js.es6
View file @
d5a223bd
...
@@ -5,25 +5,17 @@
...
@@ -5,25 +5,17 @@
* Used to store the Pipelines rendered in the commit view in the pipelines table.
* Used to store the Pipelines rendered in the commit view in the pipelines table.
*/
*/
(() => {
class PipelinesStore {
window.gl = window.gl || {};
constructor() {
gl.commits = gl.commits || {};
this.state = {};
gl.commits.pipelines = gl.commits.pipelines || {};
gl.commits.pipelines.PipelinesStore = {
state: {},
create() {
this.state.pipelines = [];
this.state.pipelines = [];
}
return this;
storePipelines(pipelines = []) {
},
store(pipelines = []) {
this.state.pipelines = pipelines;
this.state.pipelines = pipelines;
return pipelines;
return pipelines;
},
}
/**
/**
* Once the data is received we will start the time ago loops.
* Once the data is received we will start the time ago loops.
...
@@ -49,6 +41,7 @@
...
@@ -49,6 +41,7 @@
const startIntervals = () => startTimeLoops();
const startIntervals = () => startTimeLoops();
gl.VueRealtimeListener(removeIntervals, startIntervals);
gl.VueRealtimeListener(removeIntervals, startIntervals);
},
}
};
}
})();
return PipelinesStore;
app/assets/javascripts/commit/pipelines/pipelines_table.js.es6
View file @
d5a223bd
/* eslint-disable no-new, no-param-reassign */
/* eslint-disable no-new, no-param-reassign */
/* global Vue, CommitsPipelineStore, PipelinesService, Flash */
/* global Vue, CommitsPipelineStore, PipelinesService, Flash */
//= require vue
window.Vue = require('vue');
//= require vue-resource
window.Vue.use(require('vue-resource'));
//= require vue_shared/vue_resource_interceptor
require('../../vue_shared/vue_resource_interceptor');
//= require vue_shared/components/pipelines_table
require('../../vue_shared/components/pipelines_table');
//= require vue_realtime_listener/index
require('../vue_realtime_listener/index');
/**
/**
*
*
...
@@ -38,13 +38,10 @@
...
@@ -38,13 +38,10 @@
data() {
data() {
const pipelinesTableData = document.querySelector('#commit-pipeline-table-view').dataset;
const pipelinesTableData = document.querySelector('#commit-pipeline-table-view').dataset;
const svgsData = document.querySelector('.pipeline-svgs').dataset;
const svgsData = document.querySelector('.pipeline-svgs').dataset;
const store =
gl.commits.pipelines.PipelinesStore.creat
e();
const store =
new gl.commits.pipelines.PipelinesStor
e();
// Transform svgs DOMStringMap to a plain Object.
// Transform svgs DOMStringMap to a plain Object.
const svgsObject = Object.keys(svgsData).reduce((acc, element) => {
const svgsObject = gl.utils.DOMStringMapToObject(svgsData);
acc[element] = svgsData[element];
return acc;
}, {});
return {
return {
endpoint: pipelinesTableData.endpoint,
endpoint: pipelinesTableData.endpoint,
...
@@ -71,7 +68,7 @@
...
@@ -71,7 +68,7 @@
return gl.pipelines.pipelinesService.all()
return gl.pipelines.pipelinesService.all()
.then(response => response.json())
.then(response => response.json())
.then((json) => {
.then((json) => {
this.store.store(json);
this.store.store
Pipelines
(json);
this.store.startTimeAgoLoops.call(this, Vue);
this.store.startTimeAgoLoops.call(this, Vue);
this.isLoading = false;
this.isLoading = false;
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment