diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-13 18:09:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-13 18:09:24 +0300 |
commit | 37699393e9d68181a04f54ded5ae1b08b6272291 (patch) | |
tree | 6d02f81cb671476f5b9b8a635f9307fd7728d04f /app/assets/javascripts/pipelines | |
parent | 7f59234892f27812dc91044cd63a6a4655e26263 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/pipelines')
-rw-r--r-- | app/assets/javascripts/pipelines/components/header_component.vue | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/assets/javascripts/pipelines/components/header_component.vue b/app/assets/javascripts/pipelines/components/header_component.vue index 690ea962336..741609c908a 100644 --- a/app/assets/javascripts/pipelines/components/header_component.vue +++ b/app/assets/javascripts/pipelines/components/header_component.vue @@ -16,6 +16,7 @@ export default { name: 'PipelineHeaderSection', pipelineCancel: 'pipelineCancel', pipelineRetry: 'pipelineRetry', + finishedStatuses: ['FAILED', 'SUCCESS', 'CANCELED'], components: { ciHeader, GlAlert, @@ -95,6 +96,9 @@ export default { status() { return this.pipeline?.status; }, + isFinished() { + return this.$options.finishedStatuses.includes(this.status); + }, shouldRenderContent() { return !this.isLoadingInitialQuery && this.hasPipelineData; }, @@ -123,6 +127,13 @@ export default { } }, }, + watch: { + isFinished(finished) { + if (finished) { + this.$apollo.queries.pipeline.stopPolling(); + } + }, + }, methods: { reportFailure(errorType) { this.failureType = errorType; @@ -141,7 +152,10 @@ export default { if (errors.length > 0) { this.reportFailure(POST_FAILURE); } else { - this.$apollo.queries.pipeline.refetch(); + await this.$apollo.queries.pipeline.refetch(); + if (!this.isFinished) { + this.$apollo.queries.pipeline.startPolling(POLL_INTERVAL); + } } } catch { this.reportFailure(POST_FAILURE); |