summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/components/markdown/suggestions.vue
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/markdown/suggestions.vue')
-rw-r--r--app/assets/javascripts/vue_shared/components/markdown/suggestions.vue30
1 files changed, 24 insertions, 6 deletions
diff --git a/app/assets/javascripts/vue_shared/components/markdown/suggestions.vue b/app/assets/javascripts/vue_shared/components/markdown/suggestions.vue
index 927a93487e6..5ee51764555 100644
--- a/app/assets/javascripts/vue_shared/components/markdown/suggestions.vue
+++ b/app/assets/javascripts/vue_shared/components/markdown/suggestions.vue
@@ -38,6 +38,10 @@ export default {
type: String,
required: true,
},
+ defaultCommitMessage: {
+ type: String,
+ required: true,
+ },
suggestionsCount: {
type: Number,
required: false,
@@ -82,27 +86,41 @@ export default {
this.isRendered = true;
},
generateDiff(suggestionIndex) {
- const { suggestions, disabled, batchSuggestionsInfo, helpPagePath, suggestionsCount } = this;
+ const {
+ suggestions,
+ disabled,
+ batchSuggestionsInfo,
+ helpPagePath,
+ defaultCommitMessage,
+ suggestionsCount,
+ } = this;
const suggestion =
suggestions && suggestions[suggestionIndex] ? suggestions[suggestionIndex] : {};
const SuggestionDiffComponent = Vue.extend(SuggestionDiff);
const suggestionDiff = new SuggestionDiffComponent({
- propsData: { disabled, suggestion, batchSuggestionsInfo, helpPagePath, suggestionsCount },
+ propsData: {
+ disabled,
+ suggestion,
+ batchSuggestionsInfo,
+ helpPagePath,
+ defaultCommitMessage,
+ suggestionsCount,
+ },
});
- suggestionDiff.$on('apply', ({ suggestionId, callback }) => {
- this.$emit('apply', { suggestionId, callback, flashContainer: this.$el });
+ suggestionDiff.$on('apply', ({ suggestionId, callback, message }) => {
+ this.$emit('apply', { suggestionId, callback, flashContainer: this.$el, message });
});
suggestionDiff.$on('applyBatch', () => {
this.$emit('applyBatch', { flashContainer: this.$el });
});
- suggestionDiff.$on('addToBatch', suggestionId => {
+ suggestionDiff.$on('addToBatch', (suggestionId) => {
this.$emit('addToBatch', suggestionId);
});
- suggestionDiff.$on('removeFromBatch', suggestionId => {
+ suggestionDiff.$on('removeFromBatch', (suggestionId) => {
this.$emit('removeFromBatch', suggestionId);
});