summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2019-04-26 08:39:44 +0000
committerFilipa Lacerda <filipa@gitlab.com>2019-04-26 08:39:44 +0000
commit55767af463441744140d3fbfd44b00026ed83350 (patch)
treedfc274b4b44fb42f4c092ec8c974ab2b14a3407f
parentd1ac44ae96468c571ba153cd79d1760c78524894 (diff)
parent41ff0d1e08c0f38ac3de8eb66e5635ecb772173c (diff)
downloadgitlab-ce-55767af463441744140d3fbfd44b00026ed83350.tar.gz
Merge branch '60855-mr-popover-is-not-attached-in-system-notes' into 'master'
Resolve "MR Popover is not attached in system notes" Closes #60855 See merge request gitlab-org/gitlab-ce!27589
-rw-r--r--app/assets/javascripts/vue_shared/components/notes/system_note.vue4
-rw-r--r--changelogs/unreleased/60855-mr-popover-is-not-attached-in-system-notes.yml5
-rw-r--r--spec/frontend/vue_shared/components/notes/system_note_spec.js6
3 files changed, 15 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/components/notes/system_note.vue b/app/assets/javascripts/vue_shared/components/notes/system_note.vue
index acc179b3834..3c86b7e4c61 100644
--- a/app/assets/javascripts/vue_shared/components/notes/system_note.vue
+++ b/app/assets/javascripts/vue_shared/components/notes/system_note.vue
@@ -22,6 +22,7 @@ import noteHeader from '~/notes/components/note_header.vue';
import Icon from '~/vue_shared/components/icon.vue';
import TimelineEntryItem from './timeline_entry_item.vue';
import { spriteIcon } from '../../../lib/utils/common_utils';
+import initMRPopovers from '~/mr_popover/';
const MAX_VISIBLE_COMMIT_LIST_COUNT = 3;
@@ -71,6 +72,9 @@ export default {
);
},
},
+ mounted() {
+ initMRPopovers(this.$el.querySelectorAll('.gfm-merge_request'));
+ },
};
</script>
diff --git a/changelogs/unreleased/60855-mr-popover-is-not-attached-in-system-notes.yml b/changelogs/unreleased/60855-mr-popover-is-not-attached-in-system-notes.yml
new file mode 100644
index 00000000000..f7017ddf3dd
--- /dev/null
+++ b/changelogs/unreleased/60855-mr-popover-is-not-attached-in-system-notes.yml
@@ -0,0 +1,5 @@
+---
+title: Fix bug where system note MR has no popover
+merge_request: 27589
+author:
+type: fixed
diff --git a/spec/frontend/vue_shared/components/notes/system_note_spec.js b/spec/frontend/vue_shared/components/notes/system_note_spec.js
index adcb1c858aa..5b4ca20940a 100644
--- a/spec/frontend/vue_shared/components/notes/system_note_spec.js
+++ b/spec/frontend/vue_shared/components/notes/system_note_spec.js
@@ -5,8 +5,10 @@ import createStore from '~/notes/stores';
describe('system note component', () => {
let vm;
let props;
+ let initMRPopoversSpy;
beforeEach(() => {
+ initMRPopoversSpy = spyOnDependency(issueSystemNote, 'initMRPopovers');
props = {
note: {
id: '1424',
@@ -56,4 +58,8 @@ describe('system note component', () => {
it('removes wrapping paragraph from note HTML', () => {
expect(vm.$el.querySelector('.system-note-message').innerHTML).toEqual('<span>closed</span>');
});
+
+ it('should initMRPopovers onMount', () => {
+ expect(initMRPopoversSpy).toHaveBeenCalled();
+ });
});