diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-26 21:12:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-26 21:12:26 +0300 |
commit | a4aa229f7621a1982b4220bbd6db1fbceb738a2e (patch) | |
tree | fcd1137d144f6ed81c728d187e62eb8d2c1a10e3 /app/assets/javascripts/pipeline_editor | |
parent | 74015980b5259072bbf27b432b9b08fda9d27945 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/pipeline_editor')
-rw-r--r-- | app/assets/javascripts/pipeline_editor/components/commit/commit_section.vue | 15 | ||||
-rw-r--r-- | app/assets/javascripts/pipeline_editor/graphql/mutations/commit_ci_file.mutation.graphql | 2 |
2 files changed, 10 insertions, 7 deletions
diff --git a/app/assets/javascripts/pipeline_editor/components/commit/commit_section.vue b/app/assets/javascripts/pipeline_editor/components/commit/commit_section.vue index e11cfc1c65e..d8043f749ab 100644 --- a/app/assets/javascripts/pipeline_editor/components/commit/commit_section.vue +++ b/app/assets/javascripts/pipeline_editor/components/commit/commit_section.vue @@ -87,7 +87,7 @@ export default { try { const { data: { - commitCreate: { errors }, + commitCreate: { errors, commitPipelinePath: pipelineEtag }, }, } = await this.$apollo.mutate({ mutation: commitCIFile, @@ -101,14 +101,12 @@ export default { content: this.ciFileContent, lastCommitId: this.commitSha, }, - update(_, { data }) { - const pipelineEtag = data?.commitCreate?.commit?.commitPipelinePath; - if (pipelineEtag) { - this.$apollo.mutate({ mutation: updatePipelineEtag, variables: pipelineEtag }); - } - }, }); + if (pipelineEtag) { + this.updatePipelineEtag(pipelineEtag); + } + if (errors?.length) { this.$emit('showError', { type: COMMIT_FAILURE, reasons: errors }); } else if (openMergeRequest) { @@ -139,6 +137,9 @@ export default { variables: { lastCommitBranch }, }); }, + updatePipelineEtag(pipelineEtag) { + this.$apollo.mutate({ mutation: updatePipelineEtag, variables: { pipelineEtag } }); + }, }, }; </script> diff --git a/app/assets/javascripts/pipeline_editor/graphql/mutations/commit_ci_file.mutation.graphql b/app/assets/javascripts/pipeline_editor/graphql/mutations/commit_ci_file.mutation.graphql index 94e6facabfd..65bb755ad2e 100644 --- a/app/assets/javascripts/pipeline_editor/graphql/mutations/commit_ci_file.mutation.graphql +++ b/app/assets/javascripts/pipeline_editor/graphql/mutations/commit_ci_file.mutation.graphql @@ -19,7 +19,9 @@ mutation commitCIFile( ] } ) { + __typename commit { + __typename sha } commitPipelinePath |