diff options
author | Phil Hughes <me@iamphill.com> | 2018-02-26 16:05:24 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-02-26 16:25:24 +0000 |
commit | 6358004b1c64ed3f8b83a75a672a0a72e1bee851 (patch) | |
tree | d81a593f9a30bd82f7b3fe2792a43333ece39799 /app | |
parent | 78ed5c0f30478b6ecdb58c9bcb335f758acd8a9b (diff) | |
download | gitlab-ce-6358004b1c64ed3f8b83a75a672a0a72e1bee851.tar.gz |
Converted webpack_bundle_tag to be automatic webpack bundles
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/network/network_bundle.js | 17 | ||||
-rw-r--r-- | app/assets/javascripts/pages/projects/merge_requests/show/index.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/pages/projects/network/network.js (renamed from app/assets/javascripts/network/network.js) | 2 | ||||
-rw-r--r-- | app/assets/javascripts/pages/projects/network/show/index.js | 16 | ||||
-rw-r--r-- | app/assets/javascripts/pages/projects/pipelines/index/index.js (renamed from app/assets/javascripts/pipelines/pipelines_bundle.js) | 6 | ||||
-rw-r--r-- | app/assets/javascripts/pipelines/services/pipelines_service.js | 1 | ||||
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/index.js | 4 | ||||
-rw-r--r-- | app/views/projects/merge_requests/show.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/network/show.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/pipelines/index.html.haml | 3 |
10 files changed, 25 insertions, 31 deletions
diff --git a/app/assets/javascripts/network/network_bundle.js b/app/assets/javascripts/network/network_bundle.js deleted file mode 100644 index 129f1724cb8..00000000000 --- a/app/assets/javascripts/network/network_bundle.js +++ /dev/null @@ -1,17 +0,0 @@ -/* eslint-disable func-names, space-before-function-paren, prefer-arrow-callback, quotes, no-var, vars-on-top, camelcase, comma-dangle, consistent-return, max-len */ - -import ShortcutsNetwork from '../shortcuts_network'; -import Network from './network'; - -$(function() { - if (!$(".network-graph").length) return; - - var network_graph; - network_graph = new Network({ - url: $(".network-graph").attr('data-url'), - commit_url: $(".network-graph").attr('data-commit-url'), - ref: $(".network-graph").attr('data-ref'), - commit_id: $(".network-graph").attr('data-commit-id') - }); - return new ShortcutsNetwork(network_graph.branch_graph); -}); 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 07f3e579c97..bd0f4fe5188 100644 --- a/app/assets/javascripts/pages/projects/merge_requests/show/index.js +++ b/app/assets/javascripts/pages/projects/merge_requests/show/index.js @@ -7,6 +7,7 @@ import ShortcutsIssuable from '~/shortcuts_issuable'; import Diff from '~/diff'; import { handleLocationHash } from '~/lib/utils/common_utils'; import howToMerge from '~/how_to_merge'; +import initWidget from '../../../../vue_merge_request_widget'; document.addEventListener('DOMContentLoaded', () => { new Diff(); // eslint-disable-line no-new @@ -25,4 +26,5 @@ document.addEventListener('DOMContentLoaded', () => { new ShortcutsIssuable(true); // eslint-disable-line no-new handleLocationHash(); howToMerge(); + initWidget(); }); diff --git a/app/assets/javascripts/network/network.js b/app/assets/javascripts/pages/projects/network/network.js index a3fd22aff2a..7354243e4c8 100644 --- a/app/assets/javascripts/network/network.js +++ b/app/assets/javascripts/pages/projects/network/network.js @@ -1,6 +1,6 @@ /* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, quotes, quote-props, prefer-template, comma-dangle, max-len */ -import BranchGraph from './branch_graph'; +import BranchGraph from '../../../network/branch_graph'; export default (function() { function Network(opts) { diff --git a/app/assets/javascripts/pages/projects/network/show/index.js b/app/assets/javascripts/pages/projects/network/show/index.js new file mode 100644 index 00000000000..e7dfd2d0128 --- /dev/null +++ b/app/assets/javascripts/pages/projects/network/show/index.js @@ -0,0 +1,16 @@ +import ShortcutsNetwork from '../../../../shortcuts_network'; +import Network from '../network'; + +document.addEventListener('DOMContentLoaded', () => { + if (!$('.network-graph').length) return; + + const networkGraph = new Network({ + url: $('.network-graph').attr('data-url'), + commit_url: $('.network-graph').attr('data-commit-url'), + ref: $('.network-graph').attr('data-ref'), + commit_id: $('.network-graph').attr('data-commit-id'), + }); + + // eslint-disable-next-line no-new + new ShortcutsNetwork(networkGraph.branch_graph); +}); diff --git a/app/assets/javascripts/pipelines/pipelines_bundle.js b/app/assets/javascripts/pages/projects/pipelines/index/index.js index ab5596e70f0..25dfa99ad9c 100644 --- a/app/assets/javascripts/pipelines/pipelines_bundle.js +++ b/app/assets/javascripts/pages/projects/pipelines/index/index.js @@ -1,7 +1,7 @@ import Vue from 'vue'; -import PipelinesStore from './stores/pipelines_store'; -import pipelinesComponent from './components/pipelines.vue'; -import Translate from '../vue_shared/translate'; +import PipelinesStore from '../../../../pipelines/stores/pipelines_store'; +import pipelinesComponent from '../../../../pipelines/components/pipelines.vue'; +import Translate from '../../../../vue_shared/translate'; Vue.use(Translate); diff --git a/app/assets/javascripts/pipelines/services/pipelines_service.js b/app/assets/javascripts/pipelines/services/pipelines_service.js index e2285494e62..47736fc5f42 100644 --- a/app/assets/javascripts/pipelines/services/pipelines_service.js +++ b/app/assets/javascripts/pipelines/services/pipelines_service.js @@ -1,6 +1,7 @@ /* eslint-disable class-methods-use-this */ import Vue from 'vue'; import VueResource from 'vue-resource'; +import '../../vue_shared/vue_resource_interceptor'; Vue.use(VueResource); diff --git a/app/assets/javascripts/vue_merge_request_widget/index.js b/app/assets/javascripts/vue_merge_request_widget/index.js index 6b9918b65b0..69a9132a2da 100644 --- a/app/assets/javascripts/vue_merge_request_widget/index.js +++ b/app/assets/javascripts/vue_merge_request_widget/index.js @@ -6,7 +6,7 @@ import Translate from '../vue_shared/translate'; Vue.use(Translate); -document.addEventListener('DOMContentLoaded', () => { +export default () => { gl.mrWidgetData.gitlabLogo = gon.gitlab_logo; const vm = new Vue(mrWidgetOptions); @@ -14,4 +14,4 @@ document.addEventListener('DOMContentLoaded', () => { window.gl.mrWidget = { checkStatus: vm.checkStatus, }; -}); +}; diff --git a/app/views/projects/merge_requests/show.html.haml b/app/views/projects/merge_requests/show.html.haml index e29f21b3bec..7cbc984ef19 100644 --- a/app/views/projects/merge_requests/show.html.haml +++ b/app/views/projects/merge_requests/show.html.haml @@ -23,9 +23,6 @@ #js-vue-mr-widget.mr-widget - - content_for :page_specific_javascripts do - = webpack_bundle_tag 'vue_merge_request_widget' - .content-block.content-block-small.emoji-list-container = render 'award_emoji/awards_block', awardable: @merge_request, inline: true diff --git a/app/views/projects/network/show.html.haml b/app/views/projects/network/show.html.haml index 97be8950db0..4b7be9a223f 100644 --- a/app/views/projects/network/show.html.haml +++ b/app/views/projects/network/show.html.haml @@ -1,7 +1,5 @@ - breadcrumb_title "Graph" - page_title "Graph", @ref -- content_for :page_specific_javascripts do - = webpack_bundle_tag('network') = render "head" %div{ class: container_class } .project-network diff --git a/app/views/projects/pipelines/index.html.haml b/app/views/projects/pipelines/index.html.haml index fdcc60f48a5..cf95cdbfec2 100644 --- a/app/views/projects/pipelines/index.html.haml +++ b/app/views/projects/pipelines/index.html.haml @@ -12,6 +12,3 @@ "has-ci" => @repository.gitlab_ci_yml, "ci-lint-path" => ci_lint_path, "reset-cache-path" => reset_cache_project_settings_ci_cd_path(@project) } } - - = webpack_bundle_tag('common_vue') - = webpack_bundle_tag('pipelines') |