BigW Consortium Gitlab

Commit 729fd548 by Regis

Merge branch 'p_url' into auto-pipelines-vue

parents 2d2f413a a0a0a570
......@@ -30,12 +30,9 @@
created() {
const url = window.location.toString();
if (~url.indexOf('?')) this.pagenum = url.split('?')[1].split('=')[1];
this.store.fetchDataLoop.call(this, Vue, this.pagenum);
this.store.fetchDataLoop.call(this, Vue, this.pagenum, this.scope);
},
methods: {
shortsha(pipeline) {
return pipeline.sha.slice(0, 8);
},
changepage(event, last) {
const text = event.target.innerText;
if (text === '...') return;
......@@ -47,7 +44,8 @@
window.history.pushState({}, null, `?p=${this.pagenum}`);
clearInterval(this.intervalId);
this.store.fetchDataLoop.call(this, Vue, this.pagenum);
debugger
this.store.fetchDataLoop.call(this, Vue, this.pagenum, this.scope);
},
pipelineurl(id) {
return `pipelines/${id}`;
......@@ -72,7 +70,7 @@
</vue-pipeline-url>
<vue-branch-commit
:pipeline='pipeline'
:shortsha='shortsha'
:shortsha='pipeline.commit.shortsha'
>
</vue-branch-commit>
<vue-stages></vue-stages>
......
......@@ -2,17 +2,14 @@
/* eslint-disable no-param-reassign */
((gl) => {
const api = '/api/v3/projects';
const paginate = '?per_page=5&page=';
gl.PipelineStore = class {
fetchDataLoop(Vue, pageNum) {
fetchDataLoop(Vue, pageNum, url) {
const goFetch = () =>
// const url = `${api}/${this.scope}/pipelines${paginate}${pageNum}`
this.$http.get('/gitlab-org/gitlab-shell/pipelines.json?page=1')
this.$http.get(`${url}?page=${pageNum}`)
.then((response) => {
debugger
Vue.set(this, 'pipelines', JSON.parse(response.body));
const res = JSON.parse(response.body)
Vue.set(this, 'pipelines', res.pipelines);
}, () => new Flash(
'Something went wrong on our end.'
));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment