From 865422137adf2c09ef0e86c98f79250d2f5b91e1 Mon Sep 17 00:00:00 2001 From: Shaoquan Chen Date: Sun, 30 Aug 2015 11:31:39 -0700 Subject: [PATCH] Cleaning up module dependency management tree In Horizon, angular modules' dependency are managed as a tree, where a module should only depends on modules defined as `child module`. Angular built-in modules and modules from third party libraries will be defined as external dependencies at the allication level module (top level). This way we know what external dependency the application has by only looking at the top module definition. Change-Id: I316bdd3e25ad14d5d316f4835b14657c404654db --- .../framework/widgets/magic-search/magic-search.module.js | 2 +- horizon/static/framework/widgets/table/table.module.js | 4 +--- horizon/static/framework/widgets/table/table.spec.js | 1 + openstack_dashboard/static/app/app.module.js | 2 ++ 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/horizon/static/framework/widgets/magic-search/magic-search.module.js b/horizon/static/framework/widgets/magic-search/magic-search.module.js index 73a97c07f3..925b60eede 100644 --- a/horizon/static/framework/widgets/magic-search/magic-search.module.js +++ b/horizon/static/framework/widgets/magic-search/magic-search.module.js @@ -33,6 +33,6 @@ * */ angular - .module('MagicSearch', ['ui.bootstrap']); + .module('MagicSearch', []); })(); diff --git a/horizon/static/framework/widgets/table/table.module.js b/horizon/static/framework/widgets/table/table.module.js index 0409b2bbac..ff1c212f4c 100644 --- a/horizon/static/framework/widgets/table/table.module.js +++ b/horizon/static/framework/widgets/table/table.module.js @@ -29,9 +29,7 @@ * module and jQuery (for table drawer slide animation in IE9) to be installed. */ angular - .module('horizon.framework.widgets.table', [ - 'smart-table', 'lrDragNDrop' - ]) + .module('horizon.framework.widgets.table', []) /** * @ngdoc parameters diff --git a/horizon/static/framework/widgets/table/table.spec.js b/horizon/static/framework/widgets/table/table.spec.js index 553a4689a9..b9d4f64f5f 100644 --- a/horizon/static/framework/widgets/table/table.spec.js +++ b/horizon/static/framework/widgets/table/table.spec.js @@ -251,6 +251,7 @@ var $scope, $compile, $element; beforeEach(module('templates')); + beforeEach(module('smart-table')); beforeEach(module('horizon.framework')); beforeEach(inject(function ($injector) { diff --git a/openstack_dashboard/static/app/app.module.js b/openstack_dashboard/static/app/app.module.js index c7a3365635..5aea9994bf 100644 --- a/openstack_dashboard/static/app/app.module.js +++ b/openstack_dashboard/static/app/app.module.js @@ -23,8 +23,10 @@ */ var libraryModules = [ 'gettext', + 'lrDragNDrop', 'ngCookies', 'ngSanitize', + 'smart-table', 'ui.bootstrap' ];