diff options
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/markdown/apply_suggestion.vue')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/markdown/apply_suggestion.vue | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/app/assets/javascripts/vue_shared/components/markdown/apply_suggestion.vue b/app/assets/javascripts/vue_shared/components/markdown/apply_suggestion.vue index d6a20984ad1..ce7cbafb97d 100644 --- a/app/assets/javascripts/vue_shared/components/markdown/apply_suggestion.vue +++ b/app/assets/javascripts/vue_shared/components/markdown/apply_suggestion.vue @@ -1,5 +1,6 @@ <script> import { GlDropdown, GlDropdownForm, GlFormTextarea, GlButton } from '@gitlab/ui'; +import { __, n__ } from '~/locale'; export default { components: { GlDropdown, GlDropdownForm, GlFormTextarea, GlButton }, @@ -13,12 +14,26 @@ export default { type: String, required: true, }, + batchSuggestionsCount: { + type: Number, + required: false, + default: 0, + }, }, data() { return { message: null, }; }, + computed: { + dropdownText() { + if (this.batchSuggestionsCount <= 1) { + return __('Apply suggestion'); + } + + return n__('Apply %d suggestion', 'Apply %d suggestions', this.batchSuggestionsCount); + }, + }, methods: { onApply() { this.$emit('apply', this.message); @@ -29,10 +44,11 @@ export default { <template> <gl-dropdown - :text="__('Apply suggestion')" + :text="dropdownText" :disabled="disabled" boundary="window" right + lazy menu-class="gl-w-full!" data-qa-selector="apply_suggestion_dropdown" @shown="$refs.commitMessage.$el.focus()" |