diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-18 18:08:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-18 18:08:53 +0300 |
commit | 93d0784e6d8f43ef5a27f506784b4b0d989c0c2b (patch) | |
tree | bba6397c298bf0d42b78992ea16ddea60769be84 /app/assets/javascripts/vue_shared/components | |
parent | 4c3f961bd94656e64cee5b0ad07b3f49a84338a5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_shared/components')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/markdown/header.vue | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/app/assets/javascripts/vue_shared/components/markdown/header.vue b/app/assets/javascripts/vue_shared/components/markdown/header.vue index a53d5049752..0907e064e01 100644 --- a/app/assets/javascripts/vue_shared/components/markdown/header.vue +++ b/app/assets/javascripts/vue_shared/components/markdown/header.vue @@ -39,6 +39,7 @@ export default { default: null, }, editorAiActions: { default: () => [] }, + mrGeneratedContent: { default: null }, }, props: { previewMarkdown: { @@ -208,19 +209,13 @@ export default { replaceTextarea(text) { const { description, descriptionForSha } = this.$options.i18n; const headSha = document.getElementById('merge_request_diff_head_sha').value; - const textArea = this.$el.closest('.md-area')?.querySelector('textarea'); const addendum = headSha ? sprintf(descriptionForSha, { revision: truncateSha(headSha) }) : description; - if (textArea) { - textArea.value = ''; - updateText({ - textArea, - tag: `${text}\n\n---\n\n_${addendum}_`, - cursorOffset: 0, - wrap: false, - }); + if (this.mrGeneratedContent) { + this.mrGeneratedContent.setGeneratedContent(`${text}\n\n---\n\n_${addendum}_`); + this.mrGeneratedContent.showWarning(); } }, switchPreview() { |