diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-10 15:09:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-10 15:09:14 +0300 |
commit | 152b3268d701b54cac9b615a0e29e0e5726bfd99 (patch) | |
tree | deb2e10bd5aa7c5fd54988fb8bc2ca9ec819c0b2 /app/assets/javascripts/ref | |
parent | 921173681c207356914a35ea3dca1afffeac8b05 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/ref')
-rw-r--r-- | app/assets/javascripts/ref/components/ref_selector.vue | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/app/assets/javascripts/ref/components/ref_selector.vue b/app/assets/javascripts/ref/components/ref_selector.vue index 6481af2fd80..82963fe98fd 100644 --- a/app/assets/javascripts/ref/components/ref_selector.vue +++ b/app/assets/javascripts/ref/components/ref_selector.vue @@ -4,7 +4,6 @@ import { GlDropdownDivider, GlSearchBoxByType, GlSprintf, - GlIcon, GlLoadingIcon, } from '@gitlab/ui'; import { debounce, isArray } from 'lodash'; @@ -27,7 +26,6 @@ export default { GlDropdownDivider, GlSearchBoxByType, GlSprintf, - GlIcon, GlLoadingIcon, RefResultsSection, }, @@ -111,7 +109,10 @@ export default { return this.enabledRefTypes.length > 1; }, toggleButtonClass() { - return { 'gl-inset-border-1-red-500!': !this.state }; + return { + 'gl-inset-border-1-red-500!': !this.state, + 'gl-font-monospace': Boolean(this.selectedRef), + }; }, footerSlotProps() { return { @@ -120,6 +121,9 @@ export default { query: this.lastQuery, }; }, + buttonText() { + return this.selectedRef || this.i18n.noRefSelected; + }, }, watch: { // Keep the Vuex store synchronized if the parent @@ -190,19 +194,12 @@ export default { <gl-dropdown :header-text="i18n.dropdownHeader" :toggle-class="toggleButtonClass" + :text="buttonText" class="ref-selector" v-bind="$attrs" v-on="$listeners" @shown="focusSearchBox" > - <template #button-content> - <span class="gl-flex-grow-1 gl-ml-2 gl-text-gray-400" data-testid="button-content"> - <span v-if="selectedRef" class="gl-font-monospace">{{ selectedRef }}</span> - <span v-else>{{ i18n.noRefSelected }}</span> - </span> - <gl-icon name="chevron-down" /> - </template> - <template #header> <gl-search-box-by-type ref="searchBox" |