Cleaning code to remove eslint warnings from Launch Instance

Cleans up eslint warnings.

Change-Id: I920f434c008c4679ce5758c70031d1ec5d26a2b7
Partial-Bug: 1554824
This commit is contained in:
Matt Borland 2016-03-08 10:36:52 -07:00
parent 25edfa6bcb
commit 74fe0ac371
12 changed files with 73 additions and 16 deletions

View File

@ -25,7 +25,9 @@ rules:
#############################################################################
# Disabled Rules from eslint-config-openstack
#############################################################################
valid-jsdoc: 1
valid-jsdoc: [1, {
requireParamDescription: false
}]
no-undefined: 1
brace-style: 1
no-extra-parens: 1

View File

@ -36,7 +36,10 @@
/**
* @name horizon.dashboard.project.images.basePath
* @param {Object} $provide
* @param {Object} $windowProvider
* @description Base path for the project dashboard
* @returns {undefined} Returns nothing
*/
function config($provide, $windowProvider) {
var path = $windowProvider.$get().STATIC_URL + 'dashboard/project/images/';

View File

@ -38,7 +38,10 @@
/**
* @name horizon.dashboard.project.basePath
* @param {Object} $provide
* @param {Object} $windowProvider
* @description Base path for the project dashboard
* @returns {undefined} Returns nothing
*/
function config($provide, $windowProvider) {
var path = $windowProvider.$get().STATIC_URL + 'dashboard/project/';

View File

@ -31,6 +31,7 @@
* The maximum size of user_data is 16 * 1024.
* @property {string} disk_config, default to `AUTO`.
* @property {boolean} config_drive, default to false.
* @returns {undefined} Returns nothing
*/
function LaunchInstanceConfigurationController() {
var ctrl = this;

View File

@ -146,7 +146,7 @@
// Convenience function to return a sensible value instead of undefined
function defaultIfUndefined(value, defaultValue) {
return (angular.isUndefined(value)) ? defaultValue : value;
return angular.isUndefined(value) ? defaultValue : value;
}
/*

View File

@ -29,14 +29,19 @@
/**
* @ngdoc directive
* @name horizon.dashboard.project.workflow.launch-instance:selectFlavorTable
* @name selectFlavorTable
* @scope true
* @element
* @param {boolean} isAvailableTable If true, the table is used as the
* @param {string} basePath
* @param {Object} transferTableHelpText
* @param {Object} donutChartSettings
* @param {Object} tooltipService
* @description
* {boolean} isAvailableTable If true, the table is used as the
* "available" portion of the transfer table.
* @param {object} items An array of flavor "facade" objects that include the data
* {object} items An array of flavor "facade" objects that include the data
* needed by each column, as well as chart data for each flavor.
* @param {object} displayed-items Same as items, but filtered by the directives smart
* {object} displayed-items Same as items, but filtered by the directives smart
* table to only show relevant items when search is used
*
* The transfer table provides a constant containing default labels when no
@ -52,6 +57,7 @@
* displayed-items="selectFlavorCtrl.displayedAvailableFlavorFacades">
* </select-flavor-table>
* '''
* @returns {undefined} Returns nothing
*/
function selectFlavorTable(basePath, transferTableHelpText, donutChartSettings, tooltipService) {

View File

@ -31,9 +31,15 @@
/**
* @ngdoc controller
* @name horizon.dashboard.project.workflow.launch-instance.LaunchInstanceCreateKeyPairController
* @name LaunchInstanceCreateKeyPairController
* @param {Object} $modalInstance
* @param {Object} existingKeypairs
* @param {Object} nova
* @param {Object} toastService
* @param {Object} keypairDownloadService
* @description
* Provide a dialog for creation of a new key pair.
* @returns {undefined} Returns nothing
*/
function LaunchInstanceCreateKeyPairController($modalInstance, existingKeypairs, nova,
toastService, keypairDownloadService) {

View File

@ -30,9 +30,14 @@
/**
* @ngdoc controller
* @name horizon.dashboard.project.workflow.launch-instance.LaunchInstanceImportKeyPairController
* @name LaunchInstanceImportKeyPairController
* @param {Object} $modalInstance
* @param {Object} novaAPI
* @param {Object} toastService
* @param {string} basePath
* @description
* Provide a dialog for import of an existing ssh public key.
* @returns {undefined} Returns nothing
*/
function LaunchInstanceImportKeyPairController($modalInstance, novaAPI, toastService, basePath) {
var ctrl = this;

View File

@ -30,9 +30,14 @@
/**
* @ngdoc controller
* @name horizon.dashboard.project.workflow.launch-instance.LaunchInstanceKeypairController
* @name LaunchInstanceKeypairController
* @param {string} basePath
* @param {Object} launchInstanceModel
* @param {Object} $modal
* @param {Object} toastService
* @description
* Allows selection of key pairs.
* @returns {undefined} No return value
*/
function LaunchInstanceKeypairController(basePath, launchInstanceModel, $modal, toastService) {
var ctrl = this;
@ -69,6 +74,7 @@
* Allocate the new key pair (after import or create) if nothing is
* already allocated.
* @param {Object} newKeyPair The new key pair object to add
* @returns {undefined} No return value
*/
function allocateNewKeyPair(newKeyPair) {
if (ctrl.tableData.allocated.length === 0) {
@ -81,6 +87,7 @@
* @name createKeyPair
* @description
* Launches the modal to create a key pair.
* @returns {undefined} No return value
*/
function createKeyPair() {
$modal.open({
@ -99,7 +106,8 @@
* @description
* Informs the user about the created key pair and sets controller
* values accordingly.
* @param {Object} newKeyPair The new key pair object
* @param {Object} newKeypair The new key pair object
* @returns {undefined} No return value
*/
function notifyUserAndAssign(newKeypair) {
toastService.add('success', gettext('Created keypair: ' + newKeypair.name));
@ -113,6 +121,7 @@
* @name importKeyPair
* @description
* Launches the modal to import a key pair.
* @returns {undefined} No return value
*/
function importKeyPair() {
$modal.open({

View File

@ -34,6 +34,17 @@
* @ngdoc service
* @name launchInstanceModel
*
* @param {Object} $q
* @param {Object} $log
* @param {Object} cinderAPI
* @param {Object} glanceAPI
* @param {Object} neutronAPI
* @param {Object} novaAPI
* @param {Object} novaExtensions
* @param {Object} securityGroup
* @param {Object} serviceCatalog
* @param {Object} settings
* @param {Object} toast
* @description
* This is the M part in MVC design pattern for launch instance
* wizard workflow. It is responsible for providing data to the
@ -41,6 +52,7 @@
* user's input from view for creation of new instance. It is
* also the center point of communication between launch instance
* UI and services API.
* @returns {Object} The model
*/
function launchInstanceModel(
$q,
@ -231,7 +243,9 @@
}
function setDefaultValues(defaults) {
if (!defaults) { return; }
if (!defaults) {
return;
}
if ('config_drive' in defaults) {
model.newInstanceSpec.config_drive = defaults.config_drive;
}
@ -544,9 +558,10 @@
// Metadata Definitions
/**
* Metadata definitions provide supplemental information in source image detail
* rows and are used on the metadata tab for adding metadata to the instance.
/*
* Metadata definitions provide supplemental information in source image
* detail rows and are used on the metadata tab for adding metadata to the
* instance.
*/
function getMetadataDefinitions() {
// Metadata definitions often apply to multiple resource types. It is optimal to make a

View File

@ -45,8 +45,11 @@
];
/**
* @name horizon.dashboard.project.workflow.launch-instance.basePath
* @name config
* @param {Object} $provide
* @param {Object} $windowProvider
* @description Base path for the launch-instance code
* @returns {undefined} No return value
*/
function config($provide, $windowProvider) {
var path = $windowProvider.$get().STATIC_URL + 'dashboard/project/workflow/launch-instance/';
@ -60,6 +63,7 @@
* Expects object and returns the image type value.
* Returns empty string if input is null or not an object.
* Uniquely required for the source step implementation of transfer tables
* @returns {function} The filter
*/
function diskFormat() {
return filter;

View File

@ -25,9 +25,12 @@
/**
* @ngdoc controller
* @name horizon.dashboard.project.workflow.launch-instance.LaunchInstanceSecurityGroupsController
* @name LaunchInstanceSecurityGroupsController
* @param {Object} launchInstanceModel
* @param {string} basePath
* @description
* Allows selection of security groups.
* @returns {undefined} No return value
*/
function LaunchInstanceSecurityGroupsController(launchInstanceModel, basePath) {
var ctrl = this;