diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-29 15:09:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-29 15:09:16 +0300 |
commit | 37b681b2477113b5008efb79356261e89c4ff82f (patch) | |
tree | 4502baf98afe89abd69a4b6227249fbf2bdd8348 /app/assets/javascripts/content_editor | |
parent | f22f6efffe139939114f2a6a29e9864c481e3010 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/content_editor')
-rw-r--r-- | app/assets/javascripts/content_editor/components/formatting_toolbar.vue | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/assets/javascripts/content_editor/components/formatting_toolbar.vue b/app/assets/javascripts/content_editor/components/formatting_toolbar.vue index 8bf71a481bd..b6c16e9f306 100644 --- a/app/assets/javascripts/content_editor/components/formatting_toolbar.vue +++ b/app/assets/javascripts/content_editor/components/formatting_toolbar.vue @@ -1,4 +1,5 @@ <script> +import CommentTemplatesDropdown from '~/vue_shared/components/markdown/comment_templates_dropdown.vue'; import trackUIControl from '../services/track_ui_control'; import ToolbarButton from './toolbar_button.vue'; import ToolbarAttachmentButton from './toolbar_attachment_button.vue'; @@ -13,6 +14,11 @@ export default { ToolbarTableButton, ToolbarAttachmentButton, ToolbarMoreDropdown, + CommentTemplatesDropdown, + }, + inject: { + newCommentTemplatePath: { default: null }, + tiptapEditor: { default: null }, }, props: { supportsQuickActions: { @@ -30,6 +36,9 @@ export default { trackToolbarControlExecution({ contentType, value }) { trackUIControl({ property: contentType, value }); }, + insertSavedReply(savedReply) { + this.tiptapEditor.chain().focus().pasteContent(savedReply).run(); + }, }, }; </script> @@ -131,11 +140,16 @@ export default { data-testid="quick-actions" content-type="quickAction" icon-name="quick-actions" - class="gl-display-none gl-sm-display-inline gl-mr-1!" + class="gl-display-none gl-sm-display-inline" editor-command="insertQuickAction" :label="__('Add a quick action')" @execute="trackToolbarControlExecution" /> + <comment-templates-dropdown + v-if="newCommentTemplatePath" + :new-comment-template-path="newCommentTemplatePath" + @select="insertSavedReply" + /> <toolbar-more-dropdown data-testid="more" @execute="trackToolbarControlExecution" /> </div> </div> |