Skip to content
Snippets Groups Projects

Add branch switcher UI to the pipeline editor [RUN ALL RSPEC] [RUN AS-IF-FOSS]

Merged Mireya Andres requested to merge branch-switcher-ui into master
All threads resolved!
1 file
+ 9
11
Compare changes
  • Side-by-side
  • Inline
@@ -6,7 +6,7 @@ import getCurrentBranch from '~/pipeline_editor/graphql/queries/client/current_b
@@ -6,7 +6,7 @@ import getCurrentBranch from '~/pipeline_editor/graphql/queries/client/current_b
export default {
export default {
i18n: {
i18n: {
title: s__('PipelineEditor|Branches'),
title: s__('Branches'),
},
},
components: {
components: {
GlDropdown,
GlDropdown,
@@ -23,11 +23,11 @@ export default {
@@ -23,11 +23,11 @@ export default {
projectFullPath: this.projectFullPath,
projectFullPath: this.projectFullPath,
};
};
},
},
update: (data) => {
update(data) {
return data.project?.repository?.branches || [];
return data.project?.repository?.branches || [];
},
},
error() {
error() {
this.hasError = true;
// TODO
},
},
},
},
currentBranch: {
currentBranch: {
@@ -38,9 +38,6 @@ export default {
@@ -38,9 +38,6 @@ export default {
hasBranchList() {
hasBranchList() {
return this.branches?.length > 0;
return this.branches?.length > 0;
},
},
branchListWithoutCurrentBranch() {
return this.branches.filter((branch) => branch.name !== this.currentBranch);
},
},
},
};
};
</script>
</script>
@@ -50,11 +47,12 @@ export default {
@@ -50,11 +47,12 @@ export default {
<gl-dropdown-section-header>
<gl-dropdown-section-header>
{{ this.$options.i18n.title }}
{{ this.$options.i18n.title }}
</gl-dropdown-section-header>
</gl-dropdown-section-header>
<gl-dropdown-item>
<gl-dropdown-item
<gl-icon name="check" />
v-for="branch in branches"
{{ currentBranch }}
:key="branch.name"
</gl-dropdown-item>
:is-checked="currentBranch === branch.name"
<gl-dropdown-item v-for="branch in branchListWithoutCurrentBranch" :key="branch.name">
:is-check-item="true"
 
>
<gl-icon name="check" class="gl-visibility-hidden" />
<gl-icon name="check" class="gl-visibility-hidden" />
{{ branch.name }}
{{ branch.name }}
</gl-dropdown-item>
</gl-dropdown-item>
Loading