Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-12-22 21:07:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-22 21:07:08 +0300
commitb486760a6332905cd2ac94b3fade5cbc6a55d21e (patch)
tree0f1206f20aa3f1d49ddfee1418538c1777ef0957 /app/assets/javascripts/work_items
parentaaf158bcb57386a043d8cb7dc491a2f306a4ac13 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/work_items')
-rw-r--r--app/assets/javascripts/work_items/components/notes/system_note.vue17
1 files changed, 6 insertions, 11 deletions
diff --git a/app/assets/javascripts/work_items/components/notes/system_note.vue b/app/assets/javascripts/work_items/components/notes/system_note.vue
index 1eece0af31e..92a2fcaf1df 100644
--- a/app/assets/javascripts/work_items/components/notes/system_note.vue
+++ b/app/assets/javascripts/work_items/components/notes/system_note.vue
@@ -16,6 +16,7 @@
* />
*/
import { GlButton, GlSkeletonLoader, GlTooltipDirective, GlIcon } from '@gitlab/ui';
+import $ from 'jquery';
import { renderGFM } from '~/behaviors/markdown/render_gfm';
import SafeHtml from '~/vue_shared/directives/safe_html';
import descriptionVersionHistoryMixin from 'ee_else_ce/notes/mixins/description_version_history';
@@ -76,18 +77,12 @@ export default {
toggleIcon() {
return this.expanded ? 'chevron-up' : 'chevron-down';
},
- noteElement() {
- const node = document.createElement('template');
- // eslint-disable-next-line no-unsanitized/method
- node.insertAdjacentHTML('afterbegin', this.note.note_html);
- return node;
- },
- unwrappedNoteHtml() {
- return this.noteElement.children[0].innerHTML;
+ // following 2 methods taken from code in `collapseLongCommitList` of notes.js:
+ actionTextHtml() {
+ return $(this.note.bodyHtml).unwrap().html();
},
hasMoreCommits() {
- const elements = this.noteElement.querySelectorAll('ul > *') || [];
- return elements.length > MAX_VISIBLE_COMMIT_LIST_COUNT;
+ return $(this.note.bodyHtml).filter('ul').children().length > MAX_VISIBLE_COMMIT_LIST_COUNT;
},
descriptionVersion() {
return this.descriptionVersions[this.note.description_version_id];
@@ -137,7 +132,7 @@ export default {
:note-id="note.id"
:is-system-note="true"
>
- <span ref="gfm-content" v-safe-html="unwrappedNoteHtml"></span>
+ <span ref="gfm-content" v-safe-html="actionTextHtml"></span>
<template
v-if="canSeeDescriptionVersion || note.outdated_line_change_path"
#extra-controls