diff options
Diffstat (limited to 'app/assets/javascripts/ref')
-rw-r--r-- | app/assets/javascripts/ref/components/ref_results_section.vue | 2 | ||||
-rw-r--r-- | app/assets/javascripts/ref/components/ref_selector.vue | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/app/assets/javascripts/ref/components/ref_results_section.vue b/app/assets/javascripts/ref/components/ref_results_section.vue index 32e916052c4..c8f5c66b0c1 100644 --- a/app/assets/javascripts/ref/components/ref_results_section.vue +++ b/app/assets/javascripts/ref/components/ref_results_section.vue @@ -111,7 +111,7 @@ export default { <div class="gl-flex-grow-1 gl-display-flex gl-flex-direction-column"> <span class="gl-font-monospace">{{ item.name }}</span> - <span class="gl-text-gray-600">{{ item.subtitle }}</span> + <span class="gl-text-gray-400">{{ item.subtitle }}</span> </div> <gl-badge v-if="item.default" size="sm" variant="info">{{ diff --git a/app/assets/javascripts/ref/components/ref_selector.vue b/app/assets/javascripts/ref/components/ref_selector.vue index 012a391a3da..e388604ed92 100644 --- a/app/assets/javascripts/ref/components/ref_selector.vue +++ b/app/assets/javascripts/ref/components/ref_selector.vue @@ -74,6 +74,18 @@ export default { return !this.showBranchesSection && !this.showTagsSection && !this.showCommitsSection; }, }, + watch: { + // Keep the Vuex store synchronized if the parent + // component updates the selected ref through v-model + value: { + immediate: true, + handler() { + if (this.value !== this.selectedRef) { + this.setSelectedRef(this.value); + } + }, + }, + }, created() { this.setProjectId(this.projectId); this.search(this.query); @@ -95,9 +107,9 @@ export default { </script> <template> - <gl-new-dropdown class="ref-selector" @shown="focusSearchBox"> + <gl-new-dropdown v-bind="$attrs" class="ref-selector" @shown="focusSearchBox"> <template slot="button-content"> - <span class="gl-flex-grow-1 gl-ml-2 gl-text-gray-600" data-testid="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> |