Changes after review
This commit is contained in:
parent
7c1bb6c349
commit
386f958620
2 changed files with 11 additions and 9 deletions
|
@ -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 {
|
||||||
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 {
|
||||||
},
|
},
|
||||||
|
|
||||||
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());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue