diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue')
-rw-r--r-- | app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue b/app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue index 46f6f4a28c1..ec240854be5 100644 --- a/app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue +++ b/app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue @@ -3,7 +3,6 @@ import { GlButton, GlIcon, GlLink, GlLoadingIcon, GlSprintf } from '@gitlab/ui'; import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { truncateSha } from '~/lib/utils/text_utility'; import { s__ } from '~/locale'; -import getCommitSha from '~/pipeline_editor/graphql/queries/client/commit_sha.graphql'; import getPipelineQuery from '~/pipeline_editor/graphql/queries/client/pipeline.graphql'; import getPipelineEtag from '~/pipeline_editor/graphql/queries/client/pipeline_etag.graphql'; import { @@ -33,10 +32,14 @@ export default { GlSprintf, }, inject: ['projectFullPath'], - apollo: { + props: { commitSha: { - query: getCommitSha, + type: String, + required: false, + default: '', }, + }, + apollo: { pipelineEtag: { query: getPipelineEtag, }, @@ -51,7 +54,7 @@ export default { sha: this.commitSha, }; }, - update: (data) => { + update(data) { const { id, commitPath = '', detailedStatus = {} } = data.project?.pipeline || {}; return { @@ -60,6 +63,11 @@ export default { detailedStatus, }; }, + result(res) { + if (res.data?.project?.pipeline) { + this.hasError = false; + } + }, error() { this.hasError = true; }, @@ -68,7 +76,6 @@ export default { }, data() { return { - commitSha: '', hasError: false, }; }, @@ -84,7 +91,11 @@ export default { // (e.g. pipeline is null during fetch when the pipeline hasn't been // triggered yet), we can just show the loading state until the pipeline // details are ready to be fetched - return this.$apollo.queries.pipeline.loading || (!this.hasPipelineData && !this.hasError); + return ( + this.$apollo.queries.pipeline.loading || + this.commitSha.length === 0 || + (!this.hasPipelineData && !this.hasError) + ); }, shortSha() { return truncateSha(this.commitSha); |