debian-mirror-gitlab/app/assets/javascripts/mr_notes/index.js

46 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-03-27 19:54:05 +05:30
import Vue from 'vue';
2020-06-23 00:09:42 +05:30
import store from '~/mr_notes/stores';
2021-03-11 19:13:27 +05:30
import initCherryPickCommitModal from '~/projects/commit/init_cherry_pick_commit_modal';
import initRevertCommitModal from '~/projects/commit/init_revert_commit_modal';
2018-11-08 19:23:39 +05:30
import initDiffsApp from '../diffs';
2021-03-11 19:13:27 +05:30
import { resetServiceWorkersPublicPath } from '../lib/utils/webpack';
import MergeRequest from '../merge_request';
2018-03-27 19:54:05 +05:30
import discussionCounter from '../notes/components/discussion_counter.vue';
2018-12-13 13:39:08 +05:30
import initDiscussionFilters from '../notes/discussion_filters';
2020-04-22 19:07:51 +05:30
import initSortDiscussions from '../notes/sort_discussions';
2021-03-11 19:13:27 +05:30
import initNotesApp from './init_notes';
2018-03-27 19:54:05 +05:30
export default function initMrNotes() {
2019-03-02 22:35:43 +05:30
resetServiceWorkersPublicPath();
2018-11-08 19:23:39 +05:30
const mrShowNode = document.querySelector('.merge-request');
// eslint-disable-next-line no-new
new MergeRequest({
action: mrShowNode.dataset.mrAction,
});
2019-07-07 11:18:12 +05:30
initNotesApp();
2018-03-27 19:54:05 +05:30
2021-03-11 19:13:27 +05:30
document.addEventListener('merged:UpdateActions', () => {
initRevertCommitModal();
initCherryPickCommitModal();
});
2018-05-09 12:01:36 +05:30
// eslint-disable-next-line no-new
new Vue({
2018-03-27 19:54:05 +05:30
el: '#js-vue-discussion-counter',
2018-11-08 19:23:39 +05:30
name: 'DiscussionCounter',
2018-03-27 19:54:05 +05:30
components: {
discussionCounter,
},
store,
render(createElement) {
return createElement('discussion-counter');
},
});
2018-11-08 19:23:39 +05:30
2018-12-13 13:39:08 +05:30
initDiscussionFilters(store);
2020-04-22 19:07:51 +05:30
initSortDiscussions(store);
2018-11-08 19:23:39 +05:30
initDiffsApp(store);
2018-03-27 19:54:05 +05:30
}