diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-27 12:08:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-27 12:08:07 +0300 |
commit | b6f32e82a08a171debbb57236e8995b8d741e6a5 (patch) | |
tree | 44d876d957d94b7bb0e940cce64f96693997fe0f /app/assets/javascripts/ref | |
parent | 605f9296cc7bb39665ea5d07b7dad9a8eda4c26d (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 | 16 | ||||
-rw-r--r-- | app/assets/javascripts/ref/constants.js | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/app/assets/javascripts/ref/components/ref_selector.vue b/app/assets/javascripts/ref/components/ref_selector.vue index e5f5800c99c..ed9fd521e67 100644 --- a/app/assets/javascripts/ref/components/ref_selector.vue +++ b/app/assets/javascripts/ref/components/ref_selector.vue @@ -11,6 +11,10 @@ import { REF_TYPE_BRANCHES, REF_TYPE_TAGS, REF_TYPE_COMMITS, + TAG_REF_TYPE, + BRANCH_REF_TYPE, + TAG_REF_TYPE_ICON, + BRANCH_REF_TYPE_ICON, } from '../constants'; import createStore from '../stores'; import { formatListBoxItems, formatErrors } from '../format_refs'; @@ -159,6 +163,17 @@ export default { }) : this.i18n.noResults; }, + dropdownIcon() { + let icon; + + if (this.selectedRef.includes(`refs/${TAG_REF_TYPE}`)) { + icon = TAG_REF_TYPE_ICON; + } else if (this.selectedRef.includes(`refs/${BRANCH_REF_TYPE}`)) { + icon = BRANCH_REF_TYPE_ICON; + } + + return icon; + }, }, watch: { // Keep the Vuex store synchronized if the parent @@ -246,6 +261,7 @@ export default { :search-placeholder="i18n.searchPlaceholder" :toggle-class="extendedToggleButtonClass" :toggle-text="buttonText" + :icon="dropdownIcon" v-bind="$attrs" v-on="$listeners" @hidden="$emit('hide')" diff --git a/app/assets/javascripts/ref/constants.js b/app/assets/javascripts/ref/constants.js index 4b5b18cf6c1..7699c4fd863 100644 --- a/app/assets/javascripts/ref/constants.js +++ b/app/assets/javascripts/ref/constants.js @@ -7,6 +7,8 @@ export const REF_TYPE_COMMITS = 'REF_TYPE_COMMITS'; export const ALL_REF_TYPES = Object.freeze([REF_TYPE_BRANCHES, REF_TYPE_TAGS, REF_TYPE_COMMITS]); export const BRANCH_REF_TYPE = 'heads'; export const TAG_REF_TYPE = 'tags'; +export const TAG_REF_TYPE_ICON = 'tag'; +export const BRANCH_REF_TYPE_ICON = 'branch'; export const X_TOTAL_HEADER = 'x-total'; |