ngReorg - move dashboard controllers from horizon

This change moves the controller ImageFormCtrl and
hzNamespaceResourceTypeFormController from horizon (the framework)
to openstack_dashboard (the application) where they belong.

Co-Authored-By: Tyr Johanson <tyr@hp.com>
Change-Id: I2309f0867c2f657a6065003475dcb10448f907bc
Partial-Bug: #1458697
This commit is contained in:
Richard Jones 2015-05-22 13:14:32 -07:00 committed by Travis Tripp
parent 5fa6f0f0fa
commit 742cb8a679
9 changed files with 43 additions and 11 deletions

View File

@ -19,8 +19,6 @@
<script src="{{ STATIC_URL }}auth/login/login.controller.js"></script> <script src="{{ STATIC_URL }}auth/login/login.controller.js"></script>
<script src="{{ STATIC_URL }}auth/login/login-finder.directive.js"></script> <script src="{{ STATIC_URL }}auth/login/login-finder.directive.js"></script>
<script src='{{ STATIC_URL }}dashboard-app/controllers/namespace-controller.js'></script>
<script src='{{ STATIC_URL }}horizon/js/angular/hz.api.module.js'></script> <script src='{{ STATIC_URL }}horizon/js/angular/hz.api.module.js'></script>
<script src='{{ STATIC_URL }}horizon/js/angular/services/hz.api.cinder.js'></script> <script src='{{ STATIC_URL }}horizon/js/angular/services/hz.api.cinder.js'></script>
<script src='{{ STATIC_URL }}horizon/js/angular/services/hz.api.common.js'></script> <script src='{{ STATIC_URL }}horizon/js/angular/services/hz.api.common.js'></script>

View File

@ -39,6 +39,9 @@ ADD_JS_FILES = [
LAUNCH_INST + 'keypair/keypair.js', LAUNCH_INST + 'keypair/keypair.js',
LAUNCH_INST + 'configuration/configuration.js', LAUNCH_INST + 'configuration/configuration.js',
LAUNCH_INST + 'configuration/load-edit.js', LAUNCH_INST + 'configuration/load-edit.js',
'dashboard/tech-debt/tech-debt.module.js',
'dashboard/tech-debt/image-form-controller.js',
] ]
ADD_JS_SPEC_FILES = [ ADD_JS_SPEC_FILES = [

View File

@ -1,3 +1,17 @@
# Copyright 2015, Rackspace, US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# The slug of the dashboard to be added to HORIZON['dashboards']. Required. # The slug of the dashboard to be added to HORIZON['dashboards']. Required.
DASHBOARD = 'admin' DASHBOARD = 'admin'
@ -5,3 +19,9 @@ DASHBOARD = 'admin'
ADD_INSTALLED_APPS = [ ADD_INSTALLED_APPS = [
'openstack_dashboard.dashboards.admin', 'openstack_dashboard.dashboards.admin',
] ]
ADD_JS_FILES = [
'dashboard/tech-debt/tech-debt.module.js',
'dashboard/tech-debt/namespace-controller.js',
'dashboard/tech-debt/image-form-controller.js',
]

View File

@ -67,6 +67,7 @@ module.exports = function(config){
"dashboard/dashboard.module.js", "dashboard/dashboard.module.js",
"dashboard/workflow/workflow.js", "dashboard/workflow/workflow.js",
"dashboard/launch-instance/launch-instance.js", "dashboard/launch-instance/launch-instance.js",
"dashboard/tech-debt/tech-debt.module.js",
"dashboard/**/*.js", "dashboard/**/*.js",
// Templates. // Templates.

View File

@ -1,11 +1,12 @@
(function () { (function () {
'use strict'; 'use strict';
var module = angular.module('hz.dashboard', [ angular.module('hz.dashboard', [
'hz.dashboard.launch-instance', 'hz.dashboard.launch-instance',
'hz.dashboard.tech-debt',
'hz.dashboard.workflow' 'hz.dashboard.workflow'
]); ])
module.constant('dashboardBasePath', '/static/dashboard/'); .constant('dashboardBasePath', '/static/dashboard/');
})(); })();

View File

@ -1,7 +1,7 @@
(function () { (function () {
'use strict'; 'use strict';
angular.module('horizon.dashboard-app') angular.module('hz.dashboard.tech-debt')
.controller('ImageFormCtrl', ['$scope', function ($scope) { .controller('ImageFormCtrl', ['$scope', function ($scope) {
$scope.selectImageFormat = function (path) { $scope.selectImageFormat = function (path) {
if (!path) { return; } if (!path) { return; }
@ -15,4 +15,4 @@
}; };
}]); }]);
}()); }());

View File

@ -1,6 +1,6 @@
(function () { (function () {
'use strict'; 'use strict';
angular.module('horizon.dashboard-app') angular.module('hz.dashboard.tech-debt')
.controller('hzNamespaceResourceTypeFormController', function($scope, $window) { .controller('hzNamespaceResourceTypeFormController', function($scope, $window) {
$scope.resource_types = $window.resource_types; $scope.resource_types = $window.resource_types;
@ -8,4 +8,4 @@
$scope.resource_types = JSON.stringify($scope.resource_types); $scope.resource_types = JSON.stringify($scope.resource_types);
}; };
}); });
}()); }());

View File

@ -0,0 +1,6 @@
(function () {
'use strict';
angular.module('hz.dashboard.tech-debt', []);
})();

View File

@ -116,7 +116,10 @@ def update_dashboards(modules, horizon_config, installed_apps):
+ exc_list)) + exc_list))
angular_modules.extend(config.get('ADD_ANGULAR_MODULES', [])) angular_modules.extend(config.get('ADD_ANGULAR_MODULES', []))
js_files.extend(config.get('ADD_JS_FILES', [])) # avoid pulling in dashboard javascript dependencies multiple times
existing = set(js_files)
js_files.extend([f for f in config.get('ADD_JS_FILES', [])
if f not in existing])
js_spec_files.extend(config.get('ADD_JS_SPEC_FILES', [])) js_spec_files.extend(config.get('ADD_JS_SPEC_FILES', []))
update_horizon_config.update( update_horizon_config.update(
config.get('UPDATE_HORIZON_CONFIG', {})) config.get('UPDATE_HORIZON_CONFIG', {}))