diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-23 15:09:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-23 15:09:52 +0300 |
commit | ecf1ffc19875a94c9de675b0559adc408b202515 (patch) | |
tree | 92f76d0b7cbd9161eb4dff35ca4753f45f4bc6d2 /app/assets/javascripts/pipeline_editor/components/file_nav/branch_switcher.vue | |
parent | 65f7976d0cd11d91a4c0945b2c63a1aa2f888b07 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/pipeline_editor/components/file_nav/branch_switcher.vue')
-rw-r--r-- | app/assets/javascripts/pipeline_editor/components/file_nav/branch_switcher.vue | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/assets/javascripts/pipeline_editor/components/file_nav/branch_switcher.vue b/app/assets/javascripts/pipeline_editor/components/file_nav/branch_switcher.vue index b3eba0fcc19..a255e5cc72d 100644 --- a/app/assets/javascripts/pipeline_editor/components/file_nav/branch_switcher.vue +++ b/app/assets/javascripts/pipeline_editor/components/file_nav/branch_switcher.vue @@ -44,6 +44,20 @@ export default { return this.branches?.length > 0; }, }, + methods: { + async selectBranch(newBranch) { + if (newBranch === this.currentBranch) { + return; + } + + await this.$apollo.getClient().writeQuery({ + query: getCurrentBranch, + data: { currentBranch: newBranch }, + }); + + this.$emit('refetchContent'); + }, + }, }; </script> @@ -57,6 +71,7 @@ export default { :key="branch.name" :is-checked="currentBranch === branch.name" :is-check-item="true" + @click="selectBranch(branch.name)" > <gl-icon name="check" class="gl-visibility-hidden" /> {{ branch.name }} |