Commit 1ec67ecd authored by eugielimpin's avatar eugielimpin Committed by Douglas Barbosa Alexandre

Disable the dropdown instead of not showing it

To make the screen more stable. This prevents the tabs from being
pushed down when the dropdown is rendered and making the popover
anchor wrong.
parent 2ab23a78
......@@ -112,7 +112,7 @@ export default {
isBranchesLoading() {
return this.$apollo.queries.availableBranches.loading || this.isSearchingBranches;
},
showBranchSwitcher() {
enableBranchSwitcher() {
return this.branches.length > 0 || this.searchTerm.length > 0;
},
},
......@@ -230,11 +230,11 @@ export default {
<template>
<gl-dropdown
v-if="showBranchSwitcher"
v-gl-tooltip.hover
:title="$options.i18n.dropdownHeader"
:header-text="$options.i18n.dropdownHeader"
:text="currentBranch"
:disabled="!enableBranchSwitcher"
icon="branch"
data-qa-selector="branch_selector_button"
data-testid="branch-selector"
......
......@@ -141,8 +141,8 @@ describe('Pipeline editor branch switcher', () => {
createComponentWithApollo();
});
it('does not render dropdown', () => {
expect(findDropdown().exists()).toBe(false);
it('disables the dropdown', () => {
expect(findDropdown().props('disabled')).toBe(true);
});
});
......@@ -189,7 +189,7 @@ describe('Pipeline editor branch switcher', () => {
});
it('does not render dropdown', () => {
expect(findDropdown().exists()).toBe(false);
expect(findDropdown().props('disabled')).toBe(true);
});
it('shows an error message', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment