BigW Consortium Gitlab

Unverified Commit 386f9586 by Filipa Lacerda Committed by Kamil Trzcinski

Changes after review

parent 7c1bb6c3
...@@ -44,7 +44,7 @@ export default Vue.component('pipelines-table', { ...@@ -44,7 +44,7 @@ export default Vue.component('pipelines-table', {
state: store.state, state: store.state,
isLoading: false, isLoading: false,
hasError: false, hasError: false,
setIsMakingRequest: false, isMakingRequest: false,
}; };
}, },
......
...@@ -123,18 +123,23 @@ export default { ...@@ -123,18 +123,23 @@ export default {
tagsPath: this.tagsPath, tagsPath: this.tagsPath,
}; };
}, },
pageParameter() {
return gl.utils.getParameterByName('page') || this.pagenum;
},
scopeParameter() {
return gl.utils.getParameterByName('scope') || this.apiScope;
},
}, },
created() { created() {
const pageNumber = gl.utils.getParameterByName('page') || this.pagenum;
const scope = gl.utils.getParameterByName('scope') || this.apiScope;
this.service = new PipelinesService(this.endpoint); this.service = new PipelinesService(this.endpoint);
const poll = new Poll({ const poll = new Poll({
resource: this.service, resource: this.service,
method: 'getPipelines', method: 'getPipelines',
data: { page: pageNumber, scope }, data: { page: this.pageParameter, scope: this.scopeParameter },
successCallback: this.successCallback, successCallback: this.successCallback,
errorCallback: this.errorCallback, errorCallback: this.errorCallback,
notificationCallback: this.setIsMakingRequest, notificationCallback: this.setIsMakingRequest,
...@@ -183,13 +188,10 @@ export default { ...@@ -183,13 +188,10 @@ export default {
}, },
fetchPipelines() { fetchPipelines() {
const pageNumber = gl.utils.getParameterByName('page') || this.pagenum;
const scope = gl.utils.getParameterByName('scope') || this.apiScope;
if (!this.isMakingRequest) { if (!this.isMakingRequest) {
this.isLoading = true; this.isLoading = true;
this.service.getPipelines({ scope, page: pageNumber }) this.service.getPipelines({ scope: this.scopeParameter, page: this.pageParameter })
.then(response => this.successCallback(response)) .then(response => this.successCallback(response))
.catch(() => this.errorCallback()); .catch(() => this.errorCallback());
} }
......
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