diff options
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/markdown/suggestions.vue')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/markdown/suggestions.vue | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/app/assets/javascripts/vue_shared/components/markdown/suggestions.vue b/app/assets/javascripts/vue_shared/components/markdown/suggestions.vue index 20a14d78f9b..9527c5114f2 100644 --- a/app/assets/javascripts/vue_shared/components/markdown/suggestions.vue +++ b/app/assets/javascripts/vue_shared/components/markdown/suggestions.vue @@ -16,6 +16,11 @@ export default { required: false, default: () => [], }, + batchSuggestionsInfo: { + type: Array, + required: false, + default: () => [], + }, noteHtml: { type: String, required: true, @@ -68,18 +73,30 @@ export default { this.isRendered = true; }, generateDiff(suggestionIndex) { - const { suggestions, disabled, helpPagePath } = this; + const { suggestions, disabled, batchSuggestionsInfo, helpPagePath } = this; const suggestion = suggestions && suggestions[suggestionIndex] ? suggestions[suggestionIndex] : {}; const SuggestionDiffComponent = Vue.extend(SuggestionDiff); const suggestionDiff = new SuggestionDiffComponent({ - propsData: { disabled, suggestion, helpPagePath }, + propsData: { disabled, suggestion, batchSuggestionsInfo, helpPagePath }, }); suggestionDiff.$on('apply', ({ suggestionId, callback }) => { this.$emit('apply', { suggestionId, callback, flashContainer: this.$el }); }); + suggestionDiff.$on('applyBatch', () => { + this.$emit('applyBatch', { flashContainer: this.$el }); + }); + + suggestionDiff.$on('addToBatch', suggestionId => { + this.$emit('addToBatch', suggestionId); + }); + + suggestionDiff.$on('removeFromBatch', suggestionId => { + this.$emit('removeFromBatch', suggestionId); + }); + return suggestionDiff; }, reset() { |