Cleaning code to remove eslint warnings from Launch Instance
Cleans up eslint warnings. Change-Id: I920f434c008c4679ce5758c70031d1ec5d26a2b7 Partial-Bug: 1554824
This commit is contained in:
parent
25edfa6bcb
commit
74fe0ac371
@ -25,7 +25,9 @@ rules:
|
|||||||
#############################################################################
|
#############################################################################
|
||||||
# Disabled Rules from eslint-config-openstack
|
# Disabled Rules from eslint-config-openstack
|
||||||
#############################################################################
|
#############################################################################
|
||||||
valid-jsdoc: 1
|
valid-jsdoc: [1, {
|
||||||
|
requireParamDescription: false
|
||||||
|
}]
|
||||||
no-undefined: 1
|
no-undefined: 1
|
||||||
brace-style: 1
|
brace-style: 1
|
||||||
no-extra-parens: 1
|
no-extra-parens: 1
|
||||||
|
@ -36,7 +36,10 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @name horizon.dashboard.project.images.basePath
|
* @name horizon.dashboard.project.images.basePath
|
||||||
|
* @param {Object} $provide
|
||||||
|
* @param {Object} $windowProvider
|
||||||
* @description Base path for the project dashboard
|
* @description Base path for the project dashboard
|
||||||
|
* @returns {undefined} Returns nothing
|
||||||
*/
|
*/
|
||||||
function config($provide, $windowProvider) {
|
function config($provide, $windowProvider) {
|
||||||
var path = $windowProvider.$get().STATIC_URL + 'dashboard/project/images/';
|
var path = $windowProvider.$get().STATIC_URL + 'dashboard/project/images/';
|
||||||
|
@ -38,7 +38,10 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @name horizon.dashboard.project.basePath
|
* @name horizon.dashboard.project.basePath
|
||||||
|
* @param {Object} $provide
|
||||||
|
* @param {Object} $windowProvider
|
||||||
* @description Base path for the project dashboard
|
* @description Base path for the project dashboard
|
||||||
|
* @returns {undefined} Returns nothing
|
||||||
*/
|
*/
|
||||||
function config($provide, $windowProvider) {
|
function config($provide, $windowProvider) {
|
||||||
var path = $windowProvider.$get().STATIC_URL + 'dashboard/project/';
|
var path = $windowProvider.$get().STATIC_URL + 'dashboard/project/';
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* The maximum size of user_data is 16 * 1024.
|
* The maximum size of user_data is 16 * 1024.
|
||||||
* @property {string} disk_config, default to `AUTO`.
|
* @property {string} disk_config, default to `AUTO`.
|
||||||
* @property {boolean} config_drive, default to false.
|
* @property {boolean} config_drive, default to false.
|
||||||
|
* @returns {undefined} Returns nothing
|
||||||
*/
|
*/
|
||||||
function LaunchInstanceConfigurationController() {
|
function LaunchInstanceConfigurationController() {
|
||||||
var ctrl = this;
|
var ctrl = this;
|
||||||
|
@ -146,7 +146,7 @@
|
|||||||
|
|
||||||
// Convenience function to return a sensible value instead of undefined
|
// Convenience function to return a sensible value instead of undefined
|
||||||
function defaultIfUndefined(value, defaultValue) {
|
function defaultIfUndefined(value, defaultValue) {
|
||||||
return (angular.isUndefined(value)) ? defaultValue : value;
|
return angular.isUndefined(value) ? defaultValue : value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -29,14 +29,19 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngdoc directive
|
* @ngdoc directive
|
||||||
* @name horizon.dashboard.project.workflow.launch-instance:selectFlavorTable
|
* @name selectFlavorTable
|
||||||
* @scope true
|
* @scope true
|
||||||
* @element
|
* @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.
|
* "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.
|
* 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
|
* table to only show relevant items when search is used
|
||||||
*
|
*
|
||||||
* The transfer table provides a constant containing default labels when no
|
* The transfer table provides a constant containing default labels when no
|
||||||
@ -52,6 +57,7 @@
|
|||||||
* displayed-items="selectFlavorCtrl.displayedAvailableFlavorFacades">
|
* displayed-items="selectFlavorCtrl.displayedAvailableFlavorFacades">
|
||||||
* </select-flavor-table>
|
* </select-flavor-table>
|
||||||
* '''
|
* '''
|
||||||
|
* @returns {undefined} Returns nothing
|
||||||
*/
|
*/
|
||||||
function selectFlavorTable(basePath, transferTableHelpText, donutChartSettings, tooltipService) {
|
function selectFlavorTable(basePath, transferTableHelpText, donutChartSettings, tooltipService) {
|
||||||
|
|
||||||
|
@ -31,9 +31,15 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngdoc controller
|
* @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
|
* @description
|
||||||
* Provide a dialog for creation of a new key pair.
|
* Provide a dialog for creation of a new key pair.
|
||||||
|
* @returns {undefined} Returns nothing
|
||||||
*/
|
*/
|
||||||
function LaunchInstanceCreateKeyPairController($modalInstance, existingKeypairs, nova,
|
function LaunchInstanceCreateKeyPairController($modalInstance, existingKeypairs, nova,
|
||||||
toastService, keypairDownloadService) {
|
toastService, keypairDownloadService) {
|
||||||
|
@ -30,9 +30,14 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngdoc controller
|
* @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
|
* @description
|
||||||
* Provide a dialog for import of an existing ssh public key.
|
* Provide a dialog for import of an existing ssh public key.
|
||||||
|
* @returns {undefined} Returns nothing
|
||||||
*/
|
*/
|
||||||
function LaunchInstanceImportKeyPairController($modalInstance, novaAPI, toastService, basePath) {
|
function LaunchInstanceImportKeyPairController($modalInstance, novaAPI, toastService, basePath) {
|
||||||
var ctrl = this;
|
var ctrl = this;
|
||||||
|
@ -30,9 +30,14 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngdoc controller
|
* @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
|
* @description
|
||||||
* Allows selection of key pairs.
|
* Allows selection of key pairs.
|
||||||
|
* @returns {undefined} No return value
|
||||||
*/
|
*/
|
||||||
function LaunchInstanceKeypairController(basePath, launchInstanceModel, $modal, toastService) {
|
function LaunchInstanceKeypairController(basePath, launchInstanceModel, $modal, toastService) {
|
||||||
var ctrl = this;
|
var ctrl = this;
|
||||||
@ -69,6 +74,7 @@
|
|||||||
* Allocate the new key pair (after import or create) if nothing is
|
* Allocate the new key pair (after import or create) if nothing is
|
||||||
* already allocated.
|
* already allocated.
|
||||||
* @param {Object} newKeyPair The new key pair object to add
|
* @param {Object} newKeyPair The new key pair object to add
|
||||||
|
* @returns {undefined} No return value
|
||||||
*/
|
*/
|
||||||
function allocateNewKeyPair(newKeyPair) {
|
function allocateNewKeyPair(newKeyPair) {
|
||||||
if (ctrl.tableData.allocated.length === 0) {
|
if (ctrl.tableData.allocated.length === 0) {
|
||||||
@ -81,6 +87,7 @@
|
|||||||
* @name createKeyPair
|
* @name createKeyPair
|
||||||
* @description
|
* @description
|
||||||
* Launches the modal to create a key pair.
|
* Launches the modal to create a key pair.
|
||||||
|
* @returns {undefined} No return value
|
||||||
*/
|
*/
|
||||||
function createKeyPair() {
|
function createKeyPair() {
|
||||||
$modal.open({
|
$modal.open({
|
||||||
@ -99,7 +106,8 @@
|
|||||||
* @description
|
* @description
|
||||||
* Informs the user about the created key pair and sets controller
|
* Informs the user about the created key pair and sets controller
|
||||||
* values accordingly.
|
* 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) {
|
function notifyUserAndAssign(newKeypair) {
|
||||||
toastService.add('success', gettext('Created keypair: ' + newKeypair.name));
|
toastService.add('success', gettext('Created keypair: ' + newKeypair.name));
|
||||||
@ -113,6 +121,7 @@
|
|||||||
* @name importKeyPair
|
* @name importKeyPair
|
||||||
* @description
|
* @description
|
||||||
* Launches the modal to import a key pair.
|
* Launches the modal to import a key pair.
|
||||||
|
* @returns {undefined} No return value
|
||||||
*/
|
*/
|
||||||
function importKeyPair() {
|
function importKeyPair() {
|
||||||
$modal.open({
|
$modal.open({
|
||||||
|
@ -34,6 +34,17 @@
|
|||||||
* @ngdoc service
|
* @ngdoc service
|
||||||
* @name launchInstanceModel
|
* @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
|
* @description
|
||||||
* This is the M part in MVC design pattern for launch instance
|
* This is the M part in MVC design pattern for launch instance
|
||||||
* wizard workflow. It is responsible for providing data to the
|
* 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
|
* user's input from view for creation of new instance. It is
|
||||||
* also the center point of communication between launch instance
|
* also the center point of communication between launch instance
|
||||||
* UI and services API.
|
* UI and services API.
|
||||||
|
* @returns {Object} The model
|
||||||
*/
|
*/
|
||||||
function launchInstanceModel(
|
function launchInstanceModel(
|
||||||
$q,
|
$q,
|
||||||
@ -231,7 +243,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setDefaultValues(defaults) {
|
function setDefaultValues(defaults) {
|
||||||
if (!defaults) { return; }
|
if (!defaults) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ('config_drive' in defaults) {
|
if ('config_drive' in defaults) {
|
||||||
model.newInstanceSpec.config_drive = defaults.config_drive;
|
model.newInstanceSpec.config_drive = defaults.config_drive;
|
||||||
}
|
}
|
||||||
@ -544,9 +558,10 @@
|
|||||||
|
|
||||||
// Metadata Definitions
|
// Metadata Definitions
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Metadata definitions provide supplemental information in source image detail
|
* Metadata definitions provide supplemental information in source image
|
||||||
* rows and are used on the metadata tab for adding metadata to the instance.
|
* detail rows and are used on the metadata tab for adding metadata to the
|
||||||
|
* instance.
|
||||||
*/
|
*/
|
||||||
function getMetadataDefinitions() {
|
function getMetadataDefinitions() {
|
||||||
// Metadata definitions often apply to multiple resource types. It is optimal to make a
|
// Metadata definitions often apply to multiple resource types. It is optimal to make a
|
||||||
|
@ -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
|
* @description Base path for the launch-instance code
|
||||||
|
* @returns {undefined} No return value
|
||||||
*/
|
*/
|
||||||
function config($provide, $windowProvider) {
|
function config($provide, $windowProvider) {
|
||||||
var path = $windowProvider.$get().STATIC_URL + 'dashboard/project/workflow/launch-instance/';
|
var path = $windowProvider.$get().STATIC_URL + 'dashboard/project/workflow/launch-instance/';
|
||||||
@ -60,6 +63,7 @@
|
|||||||
* Expects object and returns the image type value.
|
* Expects object and returns the image type value.
|
||||||
* Returns empty string if input is null or not an object.
|
* Returns empty string if input is null or not an object.
|
||||||
* Uniquely required for the source step implementation of transfer tables
|
* Uniquely required for the source step implementation of transfer tables
|
||||||
|
* @returns {function} The filter
|
||||||
*/
|
*/
|
||||||
function diskFormat() {
|
function diskFormat() {
|
||||||
return filter;
|
return filter;
|
||||||
|
@ -25,9 +25,12 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngdoc controller
|
* @ngdoc controller
|
||||||
* @name horizon.dashboard.project.workflow.launch-instance.LaunchInstanceSecurityGroupsController
|
* @name LaunchInstanceSecurityGroupsController
|
||||||
|
* @param {Object} launchInstanceModel
|
||||||
|
* @param {string} basePath
|
||||||
* @description
|
* @description
|
||||||
* Allows selection of security groups.
|
* Allows selection of security groups.
|
||||||
|
* @returns {undefined} No return value
|
||||||
*/
|
*/
|
||||||
function LaunchInstanceSecurityGroupsController(launchInstanceModel, basePath) {
|
function LaunchInstanceSecurityGroupsController(launchInstanceModel, basePath) {
|
||||||
var ctrl = this;
|
var ctrl = this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user