From e3e5ab834544a45c0729e2ca3861415552fd2264 Mon Sep 17 00:00:00 2001 From: Shaoquan Chen Date: Thu, 9 Jul 2015 10:47:33 -0700 Subject: [PATCH] Dashboard ReOrg - Move cloud-services into app/core This patch relocates the 'cloud-services' directory because they are application specific, but needed by multiple dashboards. Co-Authored-By: Tyr Johanson Co-Authored-By: Shaoquan Chen Change-Id: Ief3b522ddeca2ea433c664c9b2ad61c245960812 Partially-Bug: #1458697 --- openstack_dashboard/enabled/_10_project.py | 2 -- .../core}/cloud-services/cloud-services.js | 22 +++++++++---------- .../cloud-services/cloud-services.spec.js | 12 +++++----- 3 files changed, 17 insertions(+), 19 deletions(-) rename openstack_dashboard/static/{dashboard => app/core}/cloud-services/cloud-services.js (93%) rename openstack_dashboard/static/{dashboard => app/core}/cloud-services/cloud-services.spec.js (96%) diff --git a/openstack_dashboard/enabled/_10_project.py b/openstack_dashboard/enabled/_10_project.py index dcb04e660e..393a8ab9cb 100644 --- a/openstack_dashboard/enabled/_10_project.py +++ b/openstack_dashboard/enabled/_10_project.py @@ -31,7 +31,6 @@ LAUNCH_INST = 'dashboard/launch-instance/' ADD_JS_FILES = [ 'dashboard/dashboard.module.js', - 'dashboard/cloud-services/cloud-services.js', LAUNCH_INST + 'launch-instance.module.js', LAUNCH_INST + 'launch-instance-workflow.service.js', LAUNCH_INST + 'launch-instance-modal.controller.js', @@ -57,7 +56,6 @@ ADD_JS_FILES = [ ADD_JS_SPEC_FILES = [ 'dashboard/dashboard.module.spec.js', - 'dashboard/cloud-services/cloud-services.spec.js', LAUNCH_INST + 'launch-instance.module.spec.js', LAUNCH_INST + 'launch-instance-workflow.service.spec.js', LAUNCH_INST + 'launch-instance-modal.controller.spec.js', diff --git a/openstack_dashboard/static/dashboard/cloud-services/cloud-services.js b/openstack_dashboard/static/app/core/cloud-services/cloud-services.js similarity index 93% rename from openstack_dashboard/static/dashboard/cloud-services/cloud-services.js rename to openstack_dashboard/static/app/core/cloud-services/cloud-services.js index 93488017ff..c6bfe824ee 100644 --- a/openstack_dashboard/static/dashboard/cloud-services/cloud-services.js +++ b/openstack_dashboard/static/app/core/cloud-services/cloud-services.js @@ -20,12 +20,12 @@ var fromJson = angular.fromJson; var isArray = angular.isArray; - angular.module('hz.dashboard') + angular.module('horizon.app.core') /** * @ngdoc factory - * @name hz.dashboard:factory:cloudServices - * @module hz.dashboard + * @name horizon.app.core:factory:cloudServices + * @module horizon.app.core * @kind hash table * @description * @@ -78,8 +78,8 @@ /** * @ngdoc factory - * @name hz.dashboard:factory:ifFeaturesEnabled - * @module hz.dashboard + * @name horizon.app.core:factory:ifFeaturesEnabled + * @module horizon.app.core * @kind function * @description * @@ -111,8 +111,8 @@ /** * @ngdoc factory - * @name hz.dashboard:factory:createDirectiveSpec - * @module hz.dashboard + * @name horizon.app.core:factory:createDirectiveSpec + * @module horizon.app.core * @kind function * @description * @@ -160,8 +160,8 @@ /** * @ngdoc directive - * @name hz.dashboard:directive:novaExtension - * @module hz.dashboard + * @name horizon.app.core:directive:novaExtension + * @module horizon.app.core * @description * * This is to enable specifying conditional UI in a declarative way. @@ -204,8 +204,8 @@ /** * @ngdoc directive - * @name hz.dashboard:directive:settingsService - * @module hz.dashboard + * @name horizon.app.core:directive:settingsService + * @module horizon.app.core * @description * * This is to enable specifying conditional UI in a declarative way. diff --git a/openstack_dashboard/static/dashboard/cloud-services/cloud-services.spec.js b/openstack_dashboard/static/app/core/cloud-services/cloud-services.spec.js similarity index 96% rename from openstack_dashboard/static/dashboard/cloud-services/cloud-services.spec.js rename to openstack_dashboard/static/app/core/cloud-services/cloud-services.spec.js index baa494c9de..02d4657c83 100644 --- a/openstack_dashboard/static/dashboard/cloud-services/cloud-services.spec.js +++ b/openstack_dashboard/static/app/core/cloud-services/cloud-services.spec.js @@ -17,14 +17,14 @@ (function () { 'use strict'; - describe('hz.dashboard', function () { + describe('horizon.app.core', function () { // factory:cloudServices describe('factory:cloudServices', function () { var cloudServices; - beforeEach(module('hz.dashboard', function ($provide) { + beforeEach(module('horizon.app.core', function ($provide) { $provide.value('horizon.openstack-service-api.cinder', {}); $provide.value('horizon.openstack-service-api.glance', {}); $provide.value('horizon.openstack-service-api.keystone', {}); @@ -80,7 +80,7 @@ $q, cloudServices; - beforeEach(module('hz.dashboard', function ($provide) { + beforeEach(module('horizon.app.core', function ($provide) { $q = { all: function () { return { @@ -155,7 +155,7 @@ var createDirectiveSpec, ifFeaturesEnabled; - beforeEach(module('hz.dashboard', function ($provide) { + beforeEach(module('horizon.app.core', function ($provide) { ifFeaturesEnabled = function () { return { then: function () { @@ -212,7 +212,7 @@ ].join(''); var element; - beforeEach(module('hz.dashboard', function ($provide) { + beforeEach(module('horizon.app.core', function ($provide) { $provide.value('ifFeaturesEnabled', function () { return { then: function (successCallback) { @@ -262,7 +262,7 @@ ].join(''); var element; - beforeEach(module('hz.dashboard', function ($provide) { + beforeEach(module('horizon.app.core', function ($provide) { $provide.value('ifFeaturesEnabled', function () { return { then: function (successCallback) {