diff options
Diffstat (limited to 'app/assets/javascripts/pipeline_editor/components/commit/commit_section.vue')
-rw-r--r-- | app/assets/javascripts/pipeline_editor/components/commit/commit_section.vue | 18 |
1 files changed, 8 insertions, 10 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 8f4894a0bde..0308cd9c565 100644 --- a/app/assets/javascripts/pipeline_editor/components/commit/commit_section.vue +++ b/app/assets/javascripts/pipeline_editor/components/commit/commit_section.vue @@ -10,7 +10,6 @@ import { import commitCIFile from '../../graphql/mutations/commit_ci_file.mutation.graphql'; import updateCurrentBranchMutation from '../../graphql/mutations/update_current_branch.mutation.graphql'; import updateLastCommitBranchMutation from '../../graphql/mutations/update_last_commit_branch.mutation.graphql'; -import getCommitSha from '../../graphql/queries/client/commit_sha.graphql'; import getCurrentBranch from '../../graphql/queries/client/current_branch.graphql'; import getIsNewCiConfigFile from '../../graphql/queries/client/is_new_ci_config_file.graphql'; import getPipelineEtag from '../../graphql/queries/client/pipeline_etag.graphql'; @@ -37,6 +36,11 @@ export default { type: String, required: true, }, + commitSha: { + type: String, + required: false, + default: '', + }, }, data() { return { @@ -49,9 +53,6 @@ export default { isNewCiConfigFile: { query: getIsNewCiConfigFile, }, - commitSha: { - query: getCommitSha, - }, currentBranch: { query: getCurrentBranch, }, @@ -96,13 +97,7 @@ export default { lastCommitId: this.commitSha, }, update(store, { data }) { - const commitSha = data?.commitCreate?.commit?.sha; const pipelineEtag = data?.commitCreate?.commit?.commitPipelinePath; - - if (commitSha) { - store.writeQuery({ query: getCommitSha, data: { commitSha } }); - } - if (pipelineEtag) { store.writeQuery({ query: getPipelineEtag, data: { pipelineEtag } }); } @@ -117,6 +112,9 @@ export default { this.$emit('commit', { type: COMMIT_SUCCESS }); this.updateLastCommitBranch(targetBranch); this.updateCurrentBranch(targetBranch); + if (this.currentBranch === targetBranch) { + this.$emit('updateCommitSha'); + } } } catch (error) { this.$emit('showError', { type: COMMIT_FAILURE, reasons: [error?.message] }); |