diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /app/assets/javascripts/batch_comments | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'app/assets/javascripts/batch_comments')
-rw-r--r-- | app/assets/javascripts/batch_comments/components/draft_note.vue | 10 | ||||
-rw-r--r-- | app/assets/javascripts/batch_comments/components/preview_dropdown.vue | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/app/assets/javascripts/batch_comments/components/draft_note.vue b/app/assets/javascripts/batch_comments/components/draft_note.vue index f5e3bab6ff0..918519f386b 100644 --- a/app/assets/javascripts/batch_comments/components/draft_note.vue +++ b/app/assets/javascripts/batch_comments/components/draft_note.vue @@ -1,5 +1,5 @@ <script> -import { GlButton } from '@gitlab/ui'; +import { GlButton, GlSafeHtmlDirective } from '@gitlab/ui'; import { mapActions, mapGetters, mapState } from 'vuex'; import NoteableNote from '~/notes/components/noteable_note.vue'; import PublishButton from './publish_button.vue'; @@ -10,6 +10,9 @@ export default { PublishButton, GlButton, }, + directives: { + SafeHtml: GlSafeHtmlDirective, + }, props: { draft: { type: Object, @@ -72,6 +75,9 @@ export default { } }, }, + safeHtmlConfig: { + ADD_TAGS: ['use', 'gl-emoji'], + }, }; </script> <template> @@ -104,8 +110,8 @@ export default { <template v-if="!isEditingDraft"> <div v-if="draftCommands" + v-safe-html:[$options.safeHtmlConfig]="draftCommands" class="referenced-commands draft-note-commands" - v-html="draftCommands /* eslint-disable-line vue/no-v-html */" ></div> <p class="draft-note-actions d-flex"> diff --git a/app/assets/javascripts/batch_comments/components/preview_dropdown.vue b/app/assets/javascripts/batch_comments/components/preview_dropdown.vue index 91b3b6a685c..e90c29e939f 100644 --- a/app/assets/javascripts/batch_comments/components/preview_dropdown.vue +++ b/app/assets/javascripts/batch_comments/components/preview_dropdown.vue @@ -15,14 +15,14 @@ export default { ...mapGetters('batchComments', ['draftsCount', 'sortedDrafts']), }, methods: { - ...mapActions('diffs', ['toggleActiveFileByHash']), + ...mapActions('diffs', ['setCurrentFileHash']), ...mapActions('batchComments', ['scrollToDraft']), isLast(index) { return index === this.sortedDrafts.length - 1; }, async onClickDraft(draft) { if (this.viewDiffsFileByFile && draft.file_hash) { - await this.toggleActiveFileByHash(draft.file_hash); + await this.setCurrentFileHash(draft.file_hash); } await this.scrollToDraft(draft); |