diff options
author | Fatih Acet <acetfatih@gmail.com> | 2018-03-03 00:16:11 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2018-03-03 00:16:11 +0300 |
commit | 405c4caeb00680d2ca809b56d1d2ea98433611dd (patch) | |
tree | 2e32ba5d23bb5835f780f40ed629c7853ed21f3a /app | |
parent | 369d34c7c8e006d2568e4a1b12b6493830811270 (diff) | |
parent | b342d2ae52d8f821dedd513dc80b56c99d2868f8 (diff) |
Merge branch 'remove-mr-notes-bundle' into 'master'
Remove mr_notes webpack bundle
See merge request gitlab-org/gitlab-ce!17497
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/mr_notes/index.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/pages/projects/merge_requests/show/index.js | 6 | ||||
-rw-r--r-- | app/views/projects/merge_requests/show.html.haml | 5 |
3 files changed, 8 insertions, 7 deletions
diff --git a/app/assets/javascripts/mr_notes/index.js b/app/assets/javascripts/mr_notes/index.js index f4cba998fa7..972fdb2b791 100644 --- a/app/assets/javascripts/mr_notes/index.js +++ b/app/assets/javascripts/mr_notes/index.js @@ -3,7 +3,7 @@ import notesApp from '../notes/components/notes_app.vue'; import discussionCounter from '../notes/components/discussion_counter.vue'; import store from '../notes/stores'; -document.addEventListener('DOMContentLoaded', () => { +export default function initMrNotes() { new Vue({ // eslint-disable-line el: '#js-vue-mr-discussions', components: { @@ -38,4 +38,4 @@ document.addEventListener('DOMContentLoaded', () => { return createElement('discussion-counter'); }, }); -}); +} diff --git a/app/assets/javascripts/pages/projects/merge_requests/show/index.js b/app/assets/javascripts/pages/projects/merge_requests/show/index.js index 3e72f7a6f37..e5b2827b50c 100644 --- a/app/assets/javascripts/pages/projects/merge_requests/show/index.js +++ b/app/assets/javascripts/pages/projects/merge_requests/show/index.js @@ -1,7 +1,13 @@ +import { hasVueMRDiscussionsCookie } from '~/lib/utils/common_utils'; +import initMrNotes from '~/mr_notes'; import initSidebarBundle from '~/sidebar/sidebar_bundle'; import initShow from '../init_merge_request_show'; document.addEventListener('DOMContentLoaded', () => { initShow(); initSidebarBundle(); + + if (hasVueMRDiscussionsCookie()) { + initMrNotes(); + } }); diff --git a/app/views/projects/merge_requests/show.html.haml b/app/views/projects/merge_requests/show.html.haml index f2e35ef6e0c..9866cc716ee 100644 --- a/app/views/projects/merge_requests/show.html.haml +++ b/app/views/projects/merge_requests/show.html.haml @@ -5,11 +5,6 @@ - page_title "#{@merge_request.title} (#{@merge_request.to_reference})", "Merge Requests" - page_description @merge_request.description - page_card_attributes @merge_request.card_attributes -- content_for :page_specific_javascripts do - = webpack_bundle_tag('common_vue') - - - if has_vue_discussions_cookie? - = webpack_bundle_tag('mr_notes') .merge-request{ data: { mr_action: j(params[:tab].presence || 'show'), url: merge_request_path(@merge_request, format: :json), project_path: project_path(@merge_request.project) } } = render "projects/merge_requests/mr_title" |