Dashboard ReOrg - Relocate Launch Instance module

This patch relocates the 'launch-instance' directory.

Continuing re-organization of the Launch Instance angular code
to move it into the correct place for plugins, namely
openstack_dashboard/dashboards/project/

This patch attempts to divide https://review.openstack.org/#/c/191592
into smaller, more easily reviewable pieces.

Co-Authored-By: Shaoquan Chen <sean.chen2@hp.com>
Co-Authored-By: Tyr Johanson <tyr@hp.com>

Change-Id: I426c77d704ed9114ce9ae148b5fdec4e381f0f68
Partial-Bug: 1478717
This commit is contained in:
Tyr Johanson 2015-06-30 13:08:37 -06:00
parent e22b846973
commit 87e386aea8
70 changed files with 268 additions and 215 deletions
doc/source/topics
openstack_dashboard
dashboards/project/static/dashboard/project
enabled
static/dashboard

View File

@ -231,7 +231,7 @@ Lines added to ``openstack_dashboard/enabled/_10_project.py``:
var scope;
var ctrl;
beforeEach(module('hz.dashboard.launch-instance'));
beforeEach(module('horizon.dashboard.project.workflow.launch-instance'));
beforeEach(inject(function($controller) {
scope = {

View File

@ -26,7 +26,7 @@
var imagesBasePath, staticUrl;
beforeEach(module('hz.dashboard'));
beforeEach(module('hz.dashboard.project'));
beforeEach(module('horizon.dashboard.project'));
beforeEach(module('hz.dashboard.project.images'));
beforeEach(inject(function ($injector) {
imagesBasePath = $injector.get('hz.dashboard.project.images.basePath');

View File

@ -18,14 +18,16 @@
'use strict';
/**
* @ngdoc overview
* @ngname hz.dashboard.project
*
* @ngdoc module
* @ngname horizon.dashboard.project
* @description
* Dashboard module to host project panels.
*/
angular
.module('hz.dashboard.project', ['hz.dashboard.project.images'])
.module('horizon.dashboard.project', [
'hz.dashboard.project.images',
'horizon.dashboard.project.workflow'
])
.config(config);
config.$inject = [
@ -34,12 +36,12 @@
];
/**
* @name hz.dashboard.project.basePath
* @name horizon.dashboard.project.basePath
* @description Base path for the project dashboard
*/
function config($provide, $windowProvider) {
var path = $windowProvider.$get().STATIC_URL + 'dashboard/project/';
$provide.constant('hz.dashboard.project.basePath', path);
$provide.constant('horizon.dashboard.project.basePath', path);
}
})();

View File

@ -16,19 +16,19 @@
(function () {
'use strict';
describe('hz.dashboard.project', function () {
describe('horizon.dashboard.project', function () {
it('should be defined', function () {
expect(angular.module('hz.dashboard.project')).toBeDefined();
expect(angular.module('horizon.dashboard.project')).toBeDefined();
});
});
describe('hz.dashboard.project.basePath constant', function () {
describe('horizon.dashboard.project.basePath constant', function () {
var projectBasePath, staticUrl;
beforeEach(module('hz.dashboard'));
beforeEach(module('hz.dashboard.project'));
beforeEach(module('horizon.dashboard.project'));
beforeEach(inject(function ($injector) {
projectBasePath = $injector.get('hz.dashboard.project.basePath');
projectBasePath = $injector.get('horizon.dashboard.project.basePath');
staticUrl = $injector.get('$window').STATIC_URL;
}));

View File

@ -1 +1,9 @@
// Custom Theme Variables
@import "/custom/variables";
@import "/dashboard/scss/variables";
@import "workflow/workflow";
// Custom Style Variables
@import "/custom/styles";

View File

@ -15,7 +15,7 @@
'use strict';
angular
.module('hz.dashboard.launch-instance')
.module('horizon.dashboard.project.workflow.launch-instance')
.controller('LaunchInstanceConfigHelpController', LaunchInstanceConfigHelpController);
/**

View File

@ -20,7 +20,7 @@
var DEFAULT_DISK_CONFIG = 'AUTO';
angular
.module('hz.dashboard.launch-instance')
.module('horizon.dashboard.project.workflow.launch-instance')
.controller('LaunchInstanceConfigurationController', LaunchInstanceConfigurationController);
LaunchInstanceConfigurationController.$inject = [

View File

@ -21,7 +21,7 @@
describe('LaunchInstanceConfigurationController', function() {
var scope, ctrl;
beforeEach(module('hz.dashboard.launch-instance'));
beforeEach(module('horizon.dashboard.project.workflow.launch-instance'));
beforeEach(inject(function($controller) {
scope = {
@ -65,7 +65,7 @@
describe('LaunchInstanceConfigHelpController', function() {
var ctrl;
beforeEach(module('hz.dashboard.launch-instance'));
beforeEach(module('horizon.dashboard.project.workflow.launch-instance'));
beforeEach(inject(function($controller) {
ctrl = $controller('LaunchInstanceConfigHelpController');

View File

@ -16,7 +16,7 @@
/*
* @ngdoc directive
* @name hz.dashboard.launch-instance:loadEdit
* @name horizon.dashboard.project.workflow.launch-instance:loadEdit
* @scope
* @element
* @description
@ -29,15 +29,15 @@
* See configuration.html for example usage.
*/
angular
.module('hz.dashboard.launch-instance')
.module('horizon.dashboard.project.workflow.launch-instance')
.directive('loadEdit', loadEdit);
loadEdit.$inject = [
'dashboardBasePath',
'horizon.dashboard.project.workflow.launch-instance.basePath',
'$timeout'
];
function loadEdit(path, $timeout) {
function loadEdit(basePath, $timeout) {
var directive = {
restrict: 'E',
scope: {
@ -46,7 +46,7 @@
key: '@'
},
link: link,
templateUrl: path + 'launch-instance/configuration/load-edit.html'
templateUrl: basePath + 'configuration/load-edit.html'
};
return directive;

View File

@ -17,7 +17,7 @@
'use strict';
angular
.module('hz.dashboard.launch-instance')
.module('horizon.dashboard.project.workflow.launch-instance')
.controller('LaunchInstanceFlavorHelpController', LaunchInstanceFlavorHelpController);
function LaunchInstanceFlavorHelpController() {

View File

@ -17,7 +17,7 @@
'use strict';
angular
.module('hz.dashboard.launch-instance')
.module('horizon.dashboard.project.workflow.launch-instance')
.controller('LaunchInstanceFlavorController', LaunchInstanceFlavorController);
LaunchInstanceFlavorController.$inject = [

View File

@ -20,7 +20,7 @@
describe('LaunchInstanceFlavorController', function () {
var ctrl, scope, model, defaults;
beforeEach(module('hz.dashboard.launch-instance'));
beforeEach(module('horizon.dashboard.project.workflow.launch-instance'));
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
@ -415,7 +415,7 @@
describe('LaunchInstanceFlavorHelpController', function () {
var ctrl;
beforeEach(module('hz.dashboard.launch-instance'));
beforeEach(module('horizon.dashboard.project.workflow.launch-instance'));
beforeEach(inject(function ($controller) {
ctrl = $controller('LaunchInstanceFlavorHelpController', {});

View File

@ -17,18 +17,18 @@
'use strict';
angular
.module('hz.dashboard.launch-instance')
.module('horizon.dashboard.project.workflow.launch-instance')
.directive('selectFlavorTable', selectFlavorTable);
selectFlavorTable.$inject = [
'dashboardBasePath',
'horizon.dashboard.project.workflow.launch-instance.basePath',
'horizon.framework.widgets.transfer-table.helpText',
'horizon.framework.widgets.charts.donutChartSettings'
];
/**
* @ngdoc directive
* @name hz.dashboard.launch-instance:selectFlavorTable
* @name horizon.dashboard.project.workflow.launch-instance:selectFlavorTable
* @scope true
* @element
* @param {boolean} isAvailableTable If true, the table is used as the
@ -52,7 +52,7 @@
* </select-flavor-table>
* '''
*/
function selectFlavorTable(path, transferTableHelpText, donutChartSettings) {
function selectFlavorTable(basePath, transferTableHelpText, donutChartSettings) {
var directive = {
restrict: 'E',
@ -64,7 +64,7 @@
isAvailableTable: '=?',
metadataDefs: '='
},
templateUrl: path + 'launch-instance/flavor/select-flavor-table.html'
templateUrl: basePath + 'flavor/select-flavor-table.html'
};
return directive;

View File

@ -1,24 +1,24 @@
(function () {
'use strict';
var module = angular.module('hz.dashboard.launch-instance');
var module = angular.module('horizon.dashboard.project.workflow.launch-instance');
/**
* @ngdoc controller
* @name hz.dashboard.launch-instance.LaunchInstanceKeypairCtrl
* @name horizon.dashboard.project.workflow.launch-instance.LaunchInstanceKeypairCtrl
* @description
* Allows selection of key pairs.
*/
module.controller('LaunchInstanceKeypairCtrl', [
'launchInstanceModel',
'$modal',
'dashboardBasePath',
'horizon.dashboard.project.workflow.launch-instance.basePath',
LaunchInstanceKeypairCtrl
]);
function LaunchInstanceKeypairCtrl(launchInstanceModel,
$modal,
dashboardBasePath) {
basePath) {
var ctrl = this;
ctrl.label = {
@ -44,7 +44,7 @@
displayedAllocated: []
};
ctrl.tableDetails = dashboardBasePath + 'launch-instance/keypair/keypair-details.html';
ctrl.tableDetails = basePath + 'keypair/keypair-details.html';
ctrl.tableHelp = {
noneAllocText: gettext('Select a key pair from the available key pairs below.')
@ -64,7 +64,7 @@
ctrl.createKeyPair = function () {
$modal.open({
templateUrl: dashboardBasePath + 'launch-instance/keypair/create-keypair.html',
templateUrl: basePath + 'keypair/create-keypair.html',
controller: 'LaunchInstanceCreateKeyPairCtrl as ctrl',
windowClass: 'modal-dialog-wizard'
}).result.then(
@ -74,7 +74,7 @@
result.id = result.name;
$modal.open({
templateUrl: dashboardBasePath + 'launch-instance/keypair/new-keypair.html',
templateUrl: basePath + 'keypair/new-keypair.html',
controller: 'LaunchInstanceNewKeyPairCtrl as ctrl',
windowClass: 'modal-dialog-wizard',
resolve: {
@ -92,7 +92,7 @@
ctrl.importKeyPair = function () {
$modal.open({
templateUrl: dashboardBasePath + 'launch-instance/keypair/import-keypair.html',
templateUrl: basePath + 'keypair/import-keypair.html',
controller: 'LaunchInstanceImportKeyPairCtrl as ctrl',
windowClass: 'modal-dialog-wizard'
}).result.then(
@ -110,7 +110,7 @@
/**
* @ngdoc controller
* @name hz.dashboard.launch-instance.LaunchInstanceKeypairHelpCtrl
* @name horizon.dashboard.project.workflow.launch-instance.LaunchInstanceKeypairHelpCtrl
* @description
* Provide help for selection of a key pair.
*/
@ -153,7 +153,7 @@
/**
* @ngdoc controller
* @name hz.dashboard.launch-instance.LaunchInstanceCreateKeyPairCtrl
* @name horizon.dashboard.project.workflow.launch-instance.LaunchInstanceCreateKeyPairCtrl
* @description
* Provide a dialog for creation of a new key pair.
*/
@ -196,7 +196,7 @@
/**
* @ngdoc controller
* @name hz.dashboard.launch-instance.LaunchInstanceNewKeyPairCtrl
* @name horizon.dashboard.project.workflow.launch-instance.LaunchInstanceNewKeyPairCtrl
* @description
* Provide a dialog for display of the information about a new
* public/private key pair.
@ -229,7 +229,7 @@
/**
* @ngdoc controller
* @name hz.dashboard.launch-instance.LaunchInstanceImportKeyPairCtrl
* @name horizon.dashboard.project.workflow.launch-instance.LaunchInstanceImportKeyPairCtrl
* @description
* Provide a dialog for import of an existing ssh public key.
*/

View File

@ -25,7 +25,7 @@
$provide.value('$modal', {});
}));
beforeEach(module('hz.dashboard'));
beforeEach(module('horizon.dashboard.project'));
beforeEach(inject(function($controller) {
var model = {
@ -79,7 +79,7 @@
describe('LaunchInstanceKeypairHelpCtrl', function() {
var ctrl;
beforeEach(module('hz.dashboard.launch-instance'));
beforeEach(module('horizon.dashboard.project.workflow.launch-instance'));
beforeEach(inject(function($controller) {
ctrl = $controller('LaunchInstanceKeypairHelpCtrl');
@ -104,7 +104,7 @@
$provide.value('horizon.framework.widgets.toast.service', {});
}));
beforeEach(module('hz.dashboard'));
beforeEach(module('horizon.dashboard.project'));
beforeEach(inject(function($controller) {
ctrl = $controller('LaunchInstanceCreateKeyPairCtrl');
@ -135,7 +135,7 @@
$provide.value('$modalInstance', {});
}));
beforeEach(module('hz.dashboard'));
beforeEach(module('horizon.dashboard.project'));
beforeEach(inject(function($controller) {
ctrl = $controller('LaunchInstanceNewKeyPairCtrl', { keypair: {} });
@ -163,7 +163,7 @@
$provide.value('horizon.framework.widgets.toast.service', {});
}));
beforeEach(module('hz.dashboard'));
beforeEach(module('horizon.dashboard.project'));
beforeEach(inject(function($controller) {
ctrl = $controller('LaunchInstanceImportKeyPairCtrl');
@ -191,7 +191,7 @@
describe('LaunchInstanceImportKeyPairHelpCtrl', function() {
var ctrl;
beforeEach(module('hz.dashboard.launch-instance'));
beforeEach(module('horizon.dashboard.project.workflow.launch-instance'));
beforeEach(inject(function($controller) {
ctrl = $controller('LaunchInstanceImportKeyPairHelpCtrl');

View File

@ -17,14 +17,14 @@
'use strict';
angular
.module('hz.dashboard.launch-instance')
.module('horizon.dashboard.project.workflow.launch-instance')
.controller('LaunchInstanceModalController', LaunchInstanceModalController);
LaunchInstanceModalController.$inject = [
'$scope',
'$modal',
'$window',
'hz.dashboard.launch-instance.modal-spec'
'horizon.dashboard.project.workflow.launch-instance.modal-spec'
];
function LaunchInstanceModalController($scope, $modal, $window, modalSpec) {

View File

@ -22,7 +22,7 @@
var scope;
var $window;
beforeEach(module('hz.dashboard'));
beforeEach(module('horizon.dashboard.project'));
beforeEach(module(function($provide) {
modal = {
open: function() {

View File

@ -6,13 +6,13 @@
/**
* @ngdoc overview
* @name hz.dashboard.launch-instance
* @name horizon.dashboard.project.workflow.launch-instance
*
* @description
* Manage workflow of creating server.
*/
var module = angular.module('hz.dashboard.launch-instance');
var module = angular.module('horizon.dashboard.project.workflow.launch-instance');
/**
* @ngdoc service

View File

@ -24,7 +24,7 @@
var neutronEnabled = false;
var novaExtensionsEnabled = false;
beforeEach(module('hz.dashboard.launch-instance'));
beforeEach(module('horizon.dashboard.project.workflow.launch-instance'));
beforeEach(module(function($provide) {
$provide.value('horizon.app.core.openstack-service-api.glance', {

View File

@ -17,13 +17,13 @@
'use strict';
angular
.module('hz.dashboard.launch-instance')
.module('horizon.dashboard.project.workflow.launch-instance')
.controller('LaunchInstanceWizardController', LaunchInstanceWizardController);
LaunchInstanceWizardController.$inject = [
'$scope',
'launchInstanceModel',
'hz.dashboard.launch-instance.workflow'
'horizon.dashboard.project.workflow.launch-instance.workflow'
];
function LaunchInstanceWizardController($scope, launchInstanceModel, launchInstanceWorkflow) {

View File

@ -26,11 +26,11 @@
};
var scope = {};
beforeEach(module('hz.dashboard'));
beforeEach(module('horizon.dashboard.project'));
beforeEach(module(function ($provide) {
$provide.value('serviceCatalog', {});
$provide.value('launchInstanceModel', model);
$provide.value('hz.dashboard.launch-instance.workflow', { thing: true });
$provide.value('horizon.dashboard.project.workflow.launch-instance.workflow', { thing: true });
}));
beforeEach(inject(function ($controller) {
spyOn(model, 'initialize');

View File

@ -17,54 +17,54 @@
'use strict';
angular
.module('hz.dashboard.launch-instance')
.factory('hz.dashboard.launch-instance.workflow', launchInstanceWorkflow);
.module('horizon.dashboard.project.workflow.launch-instance')
.factory('horizon.dashboard.project.workflow.launch-instance.workflow', launchInstanceWorkflow);
launchInstanceWorkflow.$inject = [
'dashboardBasePath',
'horizon.dashboard.project.workflow.launch-instance.basePath',
'horizon.app.core.workflow.factory'
];
function launchInstanceWorkflow(path, dashboardWorkflow) {
function launchInstanceWorkflow(basePath, dashboardWorkflow) {
return dashboardWorkflow({
title: gettext('Launch Instance'),
steps: [
{
title: gettext('Select Source'),
templateUrl: path + 'launch-instance/source/source.html',
helpUrl: path + 'launch-instance/source/source.help.html',
templateUrl: basePath + 'source/source.html',
helpUrl: basePath + 'source/source.help.html',
formName: 'launchInstanceSourceForm'
},
{
title: gettext('Flavor'),
templateUrl: path + 'launch-instance/flavor/flavor.html',
helpUrl: path + 'launch-instance/flavor/flavor.help.html',
templateUrl: basePath + 'flavor/flavor.html',
helpUrl: basePath + 'flavor/flavor.help.html',
formName: 'launchInstanceFlavorForm'
},
{
title: gettext('Networks'),
templateUrl: path + 'launch-instance/network/network.html',
helpUrl: path + 'launch-instance/network/network.help.html',
templateUrl: basePath + 'network/network.html',
helpUrl: basePath + 'network/network.help.html',
formName: 'launchInstanceNetworkForm',
requiredServiceTypes: ['network']
},
{
title: gettext('Security Groups'),
templateUrl: path + 'launch-instance/security-groups/security-groups.html',
helpUrl: path + 'launch-instance/security-groups/security-groups.help.html',
templateUrl: basePath + 'security-groups/security-groups.html',
helpUrl: basePath + 'security-groups/security-groups.help.html',
formName: 'launchInstanceAccessAndSecurityForm'
},
{
title: gettext('Key Pair'),
templateUrl: path + 'launch-instance/keypair/keypair.html',
helpUrl: path + 'launch-instance/keypair/keypair.help.html',
templateUrl: basePath + 'keypair/keypair.html',
helpUrl: basePath + 'keypair/keypair.help.html',
formName: 'launchInstanceKeypairForm'
},
{
title: gettext('Configuration'),
templateUrl: path + 'launch-instance/configuration/configuration.html',
helpUrl: path + 'launch-instance/configuration/configuration.help.html',
templateUrl: basePath + 'configuration/configuration.html',
helpUrl: basePath + 'configuration/configuration.help.html',
formName: 'launchInstanceConfigurationForm'
}
],

View File

@ -16,11 +16,11 @@
(function() {
'use strict';
describe('hz.dashboard.launch-instance.workflow tests', function () {
describe('horizon.dashboard.project.workflow.launch-instance.workflow tests', function () {
var launchInstanceWorkflow;
beforeEach(module('hz.dashboard'));
beforeEach(module('horizon.app.core'));
beforeEach(module('horizon.dashboard.project'));
beforeEach(module(function($provide) {
// Need to mock hz.framework.workflow from 'horizon'
var workflow = function(spec, decorators) {
@ -34,7 +34,7 @@
}));
beforeEach(inject(function ($injector) {
launchInstanceWorkflow = $injector.get('hz.dashboard.launch-instance.workflow');
launchInstanceWorkflow = $injector.get('horizon.dashboard.project.workflow.launch-instance.workflow');
}));
it('should be defined', function () {

View File

@ -17,9 +17,9 @@
'use strict';
angular
.module('hz.dashboard.launch-instance', [])
.constant('hz.dashboard.launch-instance.modal-spec', {
.module('horizon.dashboard.project.workflow.launch-instance', [])
.config(config)
.constant('horizon.dashboard.project.workflow.launch-instance.modal-spec', {
backdrop: 'static',
controller: 'ModalContainerController',
template: '<wizard ng-controller="LaunchInstanceWizardController"></wizard>',
@ -27,26 +27,40 @@
})
/**
* @name hz.dashboard.launch-instance.boot-source-types
* @name horizon.dashboard.project.workflow.launch-instance.boot-source-types
* @description Boot source types
*/
.constant('hz.dashboard.launch-instance.boot-source-types', {
.constant('horizon.dashboard.project.workflow.launch-instance.boot-source-types', {
IMAGE: 'image',
INSTANCE_SNAPSHOT: 'snapshot',
VOLUME: 'volume',
VOLUME_SNAPSHOT: 'volume_snapshot'
})
/**
* @ngdoc filter
* @name diskFormat
* @description
* Expects object and returns disk_format property value.
* Returns empty string if input is null or not an object.
* Uniquely required for the source step implementation of transfer tables
*/
.filter('diskFormat', diskFormat);
config.$inject = [
'$provide',
'$windowProvider'
];
/**
* @name horizon.dashboard.project.workflow.launch-instance.basePath
* @description Base path for the launch-instance code
*/
function config($provide, $windowProvider) {
var path = $windowProvider.$get().STATIC_URL + 'dashboard/project/workflow/launch-instance/';
$provide.constant('horizon.dashboard.project.workflow.launch-instance.basePath', path);
}
/**
* @ngdoc filter
* @name diskFormat
* @description
* Expects object and returns disk_format property value.
* Returns empty string if input is null or not an object.
* Uniquely required for the source step implementation of transfer tables
*/
function diskFormat() {
return filter;

View File

@ -0,0 +1,59 @@
/*
* (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
*
* 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.
*/
(function () {
'use strict';
describe('horizon.dashboard.project.workflow.launch-instance module', function() {
beforeEach(module('horizon.dashboard.project'));
it('should be defined.', function () {
expect(angular.module('horizon.dashboard.project.workflow.launch-instance')).toBeDefined();
});
describe('horizon.dashboard.project.workflow.launch-instance.modal-spec', function () {
var launchInstancedModalSpec;
beforeEach(inject(function ($injector) {
launchInstancedModalSpec =
$injector.get('horizon.dashboard.project.workflow.launch-instance.modal-spec');
}));
it('should be defined', function () {
expect(launchInstancedModalSpec).toBeDefined();
});
});
describe('horizon.dashboard.project.workflow.launch-instance.basePath', function () {
var basePath;
beforeEach(module('horizon.dashboard.project'));
beforeEach(inject(function ($injector) {
basePath = $injector.get('horizon.dashboard.project.workflow.launch-instance.basePath');
}));
it('should be defined', function () {
expect(basePath).toBeDefined();
});
it('should equal to "/static/dashboard/project/workflow/launch-instance/"', function () {
expect(basePath).toEqual('/static/dashboard/project/workflow/launch-instance/');
});
});
});
})();

View File

@ -23,7 +23,7 @@
* Controller for the Launch Instance - Network Step Help.
*/
angular
.module('hz.dashboard.launch-instance')
.module('horizon.dashboard.project.workflow.launch-instance')
.controller('LaunchInstanceNetworkHelpController', LaunchInstanceNetworkHelpController);
function LaunchInstanceNetworkHelpController() {

View File

@ -23,7 +23,7 @@
* Controller for the Launch Instance - Network Step.
*/
angular
.module('hz.dashboard.launch-instance')
.module('horizon.dashboard.project.workflow.launch-instance')
.controller('LaunchInstanceNetworkController', LaunchInstanceNetworkController);
LaunchInstanceNetworkController.$inject = ['$scope'];

View File

@ -18,7 +18,7 @@
describe('Launch Instance Network Step', function() {
beforeEach(module('hz.dashboard.launch-instance'));
beforeEach(module('horizon.dashboard.project.workflow.launch-instance'));
describe('LaunchInstanceNetworkController', function() {
var scope, ctrl;

View File

@ -0,0 +1,6 @@
<dl class="dl-horizontal key-pair-details">
<dt>{$ keyPairTableLabels.public_key $}</dt>
<dd>
<pre><code>{$ row.public_key $}</code></pre>
</dd>
</dl>

View File

@ -15,13 +15,13 @@
'use strict';
angular
.module('hz.dashboard.launch-instance')
.module('horizon.dashboard.project.workflow.launch-instance')
.controller('LaunchInstanceSecurityGroupsHelpController',
LaunchInstanceSecurityGroupsHelpController);
/**
* @ngdoc controller
* @name hz.dashboard.launch-instance.LaunchInstanceSecurityGroupsHelpController
* @name horizon.dashboard.project.workflow.launch-instance.LaunchInstanceSecurityGroupsHelpController
* @description
* Provide help for selection of security groups and key pairs.
*/

View File

@ -15,17 +15,17 @@
'use strict';
angular
.module('hz.dashboard.launch-instance')
.module('horizon.dashboard.project.workflow.launch-instance')
.controller('LaunchInstanceSecurityGroupsController', LaunchInstanceSecurityGroupsController);
LaunchInstanceSecurityGroupsController.$inject = [
'launchInstanceModel',
'dashboardBasePath'
'horizon.dashboard.project.workflow.launch-instance.basePath'
];
/**
* @ngdoc controller
* @name hz.dashboard.launch-instance.LaunchInstanceSecurityGroupsController
* @name horizon.dashboard.project.workflow.launch-instance.LaunchInstanceSecurityGroupsController
* @description
* Allows selection of security groups.
*/
@ -55,7 +55,7 @@
displayedAllocated: []
};
ctrl.tableDetails = basePath + 'launch-instance/security-groups/security-group-details.html';
ctrl.tableDetails = basePath + 'security-groups/security-group-details.html';
ctrl.tableHelp = {
/*eslint-disable max-len */

View File

@ -21,7 +21,7 @@
describe('LaunchInstanceSecurityGroupsController', function() {
var ctrl;
beforeEach(module('hz.dashboard.launch-instance'));
beforeEach(module('horizon.dashboard.project'));
beforeEach(inject(function($controller) {
var model = {
@ -30,8 +30,12 @@
},
securityGroups: [ 'group 1', 'group 2' ]
};
ctrl = $controller('LaunchInstanceSecurityGroupsController',
{ launchInstanceModel: model, dashboardBasePath: '' });
ctrl = $controller(
'LaunchInstanceSecurityGroupsController',
{
launchInstanceModel: model,
'horizon.dashboard.project.workflow.launch-instance.basePath': ''
});
}));
it('contains its general labels', function() {
@ -74,7 +78,7 @@
describe('LaunchInstanceSecurityGroupsHelpController', function() {
var ctrl;
beforeEach(module('hz.dashboard.launch-instance'));
beforeEach(module('horizon.dashboard.project'));
beforeEach(inject(function($controller) {
ctrl = $controller('LaunchInstanceSecurityGroupsHelpController');

View File

@ -23,7 +23,7 @@
* Launch Instance Wizard.
*/
angular
.module('hz.dashboard.launch-instance')
.module('horizon.dashboard.project.workflow.launch-instance')
.controller('LaunchInstanceSourceHelpController', LaunchInstanceSourceHelpController);
function LaunchInstanceSourceHelpController() {

View File

@ -27,12 +27,12 @@
var push = [].push;
angular
.module('hz.dashboard.launch-instance')
.module('horizon.dashboard.project.workflow.launch-instance')
.controller('LaunchInstanceSourceController', LaunchInstanceSourceController);
LaunchInstanceSourceController.$inject = [
'$scope',
'hz.dashboard.launch-instance.boot-source-types',
'horizon.dashboard.project.workflow.launch-instance.boot-source-types',
'bytesFilter',
'horizon.framework.widgets.charts.donutChartSettings',
'dateFilter',
@ -40,7 +40,7 @@
'diskFormatFilter',
'gbFilter',
'horizon.framework.widgets.charts.quotaChartDefaults',
'dashboardBasePath'
'horizon.dashboard.project.workflow.launch-instance.basePath'
];
function LaunchInstanceSourceController($scope,
@ -113,7 +113,7 @@
ctrl.tableData = {};
ctrl.helpText = {};
ctrl.maxInstanceCount = 1;
ctrl.sourceDetails = basePath + 'launch-instance/source/source-details.html';
ctrl.sourceDetails = basePath + 'source/source-details.html';
var selection = ctrl.selection = $scope.model.newInstanceSpec.source;

View File

@ -19,20 +19,20 @@
describe('Launch Instance Source Step', function() {
var noop = angular.noop;
beforeEach(module('hz.dashboard.launch-instance'));
beforeEach(module('horizon.dashboard.project'));
describe('LaunchInstanceSourceController', function() {
var scope, ctrl, $browser, deferred;
beforeEach(module(function($provide) {
$provide.value('hz.dashboard.launch-instance.boot-source-types', noop);
$provide.value('horizon.dashboard.project.workflow.launch-instance.boot-source-types', noop);
$provide.value('bytesFilter', noop);
$provide.value('horizon.framework.widgets.charts.donutChartSettings', noop);
$provide.value('dateFilter', noop);
$provide.value('decodeFilter', noop);
$provide.value('gbFilter', noop);
$provide.value('horizon.framework.widgets.charts.quotaChartDefaults', noop);
$provide.value('dashboardBasePath', '');
$provide.value('horizon.dashboard.project.workflow.launch-instance.basePath', '');
}));
beforeEach(inject(function($controller, $rootScope, _$browser_, $q) {
@ -62,6 +62,11 @@
scope.$apply();
}));
it('should be defined', function() {
expect(ctrl).toBeDefined();
});
it('has its own labels', function() {
expect(ctrl.label).toBeDefined();
expect(Object.keys(ctrl.label).length).toBeGreaterThan(0);

View File

@ -0,0 +1,30 @@
/*
* (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
*
* 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.
*/
(function () {
'use strict';
/**
* @ngdoc overview
* @name horizon.dashboard.project.workflow
* @description
* module to host project workflow modules.
*/
angular
.module('horizon.dashboard.project.workflow', [
'horizon.dashboard.project.workflow.launch-instance'
]);
})();

View File

@ -0,0 +1,25 @@
/*
* (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
*
* 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.
*/
(function () {
'use strict';
describe('horizon.dashboard.project.workflow', function () {
it('should be defined', function () {
expect(angular.module('horizon.dashboard.project.workflow')).toBeDefined();
});
});
})();

View File

@ -0,0 +1 @@
@import "launch-instance/launch-instance";

View File

@ -22,48 +22,17 @@ ADD_EXCEPTIONS = {}
ADD_INSTALLED_APPS = ['openstack_dashboard.dashboards.project']
ADD_ANGULAR_MODULES = [
'hz.dashboard.project',
'horizon.dashboard.project',
]
AUTO_DISCOVER_STATIC_FILES = True
LAUNCH_INST = 'dashboard/launch-instance/'
ADD_JS_FILES = [
'dashboard/dashboard.module.js',
LAUNCH_INST + 'launch-instance.module.js',
LAUNCH_INST + 'launch-instance-workflow.service.js',
LAUNCH_INST + 'launch-instance-modal.controller.js',
LAUNCH_INST + 'launch-instance-wizard.controller.js',
LAUNCH_INST + 'launch-instance-model.js',
LAUNCH_INST + 'source/source.controller.js',
LAUNCH_INST + 'source/source-help.controller.js',
LAUNCH_INST + 'flavor/flavor.controller.js',
LAUNCH_INST + 'flavor/select-flavor-table.directive.js',
LAUNCH_INST + 'flavor/flavor-help.controller.js',
LAUNCH_INST + 'network/network.controller.js',
LAUNCH_INST + 'network/network-help.controller.js',
LAUNCH_INST + 'security-groups/security-groups.controller.js',
LAUNCH_INST + 'security-groups/security-groups-help.controller.js',
LAUNCH_INST + 'keypair/keypair.js',
LAUNCH_INST + 'configuration/configuration.controller.js',
LAUNCH_INST + 'configuration/configuration-help.controller.js',
LAUNCH_INST + 'configuration/load-edit.directive.js',
]
ADD_JS_SPEC_FILES = [
'dashboard/dashboard.module.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',
LAUNCH_INST + 'launch-instance-wizard.controller.spec.js',
LAUNCH_INST + 'launch-instance-model.spec.js',
LAUNCH_INST + 'source/source.spec.js',
LAUNCH_INST + 'flavor/flavor.spec.js',
LAUNCH_INST + 'network/network.spec.js',
LAUNCH_INST + 'security-groups/security-groups.spec.js',
LAUNCH_INST + 'keypair/keypair.spec.js',
LAUNCH_INST + 'configuration/configuration.spec.js',
]
ADD_SCSS_FILES = [

View File

@ -2,16 +2,6 @@
'use strict';
angular
.module('hz.dashboard', [
'hz.dashboard.launch-instance'
])
.config(config);
config.$inject = ['$provide', '$windowProvider'];
function config($provide, $windowProvider) {
var path = $windowProvider.$get().STATIC_URL + 'dashboard/';
$provide.constant('dashboardBasePath', path);
}
.module('hz.dashboard', []);
})();

View File

@ -22,23 +22,4 @@
});
});
describe('hz.dashboard:constant:dashboardBasePath', function () {
var dashboardBasePath;
var staticUrl;
beforeEach(module('hz.dashboard'));
beforeEach(inject(function ($injector) {
dashboardBasePath = $injector.get('dashboardBasePath');
staticUrl = $injector.get('$window').STATIC_URL;
}));
it('should be defined', function () {
expect(dashboardBasePath).toBeDefined();
});
it('should get set correctly', function () {
expect(dashboardBasePath).toEqual(staticUrl + 'dashboard/');
});
});
})();

View File

@ -2,7 +2,6 @@
@import "/custom/variables";
@import "scss/variables";
@import "launch-instance/launch-instance";
// Custom Style Variables
@import "/custom/styles";

View File

@ -1,40 +0,0 @@
/*
* (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
*
* 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.
*/
(function () {
'use strict';
describe('hz.dashboard.launch-instance module', function() {
beforeEach(module('hz.dashboard'));
it('should be defined.', function () {
expect(angular.module('hz.dashboard.launch-instance')).toBeDefined();
});
describe('hz.dashboard.launch-instance.modal-spec', function () {
var launchInstancedModalSpec;
beforeEach(inject(function ($injector) {
launchInstancedModalSpec = $injector.get('hz.dashboard.launch-instance.modal-spec');
}));
it('should be defined', function () {
expect(launchInstancedModalSpec).toBeDefined();
});
});
});
})();