diff --git a/horizon/static/auth/login/login.spec.js b/horizon/static/auth/login/login.spec.js index e6083c0012..16d77794a8 100644 --- a/horizon/static/auth/login/login.spec.js +++ b/horizon/static/auth/login/login.spec.js @@ -40,7 +40,7 @@ toBeVisible: function() { return { compare: function(actual) { - var pass = (actual.css('display') !== 'none'); + var pass = actual.css('display') !== 'none'; var result = { pass: pass, message: pass ? diff --git a/horizon/static/framework/util/extensible/extensible.service.js b/horizon/static/framework/util/extensible/extensible.service.js index ffb98fb727..d94e3888eb 100644 --- a/horizon/static/framework/util/extensible/extensible.service.js +++ b/horizon/static/framework/util/extensible/extensible.service.js @@ -233,7 +233,7 @@ return items.filter(function filterItems(item) { return item._ext && item._ext.position === position; }).sort(function sortItems(a, b) { - return (a._ext.priority - b._ext.priority) || 1; + return a._ext.priority - b._ext.priority || 1; }); } diff --git a/horizon/static/framework/util/filters/filters.js b/horizon/static/framework/util/filters/filters.js index 7191c8a1c4..4e1529fda6 100644 --- a/horizon/static/framework/util/filters/filters.js +++ b/horizon/static/framework/util/filters/filters.js @@ -41,7 +41,7 @@ yesNoFilter.$inject = ['horizon.framework.util.i18n.gettext']; function yesNoFilter(gettext) { return function (input) { - return (input ? gettext("Yes") : gettext("No")); + return input ? gettext("Yes") : gettext("No"); }; } diff --git a/horizon/static/framework/util/i18n/i18n.js b/horizon/static/framework/util/i18n/i18n.js index dbdc09de3d..c49e368e18 100644 --- a/horizon/static/framework/util/i18n/i18n.js +++ b/horizon/static/framework/util/i18n/i18n.js @@ -42,7 +42,9 @@ */ function getText($window) { // If no global function, revert to just returning given text. - var gettextFunc = $window.gettext || function (x) { return x; }; + var gettextFunc = $window.gettext || function (x) { + return x; + }; // Eventually, could delete the window gettext references here, // or provide an appropriate method. diff --git a/horizon/static/framework/util/i18n/i18n.spec.js b/horizon/static/framework/util/i18n/i18n.spec.js index 04d2e8bc03..e3c27bd2f8 100644 --- a/horizon/static/framework/util/i18n/i18n.spec.js +++ b/horizon/static/framework/util/i18n/i18n.spec.js @@ -38,7 +38,9 @@ describe("injected window.gettext", function () { beforeEach(module(function ($provide) { - var $window = { gettext: function (x) { return x.replace(/good/, 'bad'); } }; + var $window = { gettext: function (x) { + return x.replace(/good/, 'bad'); + }}; $provide.value('$window', $window); })); diff --git a/horizon/static/framework/widgets/charts/pie-chart.directive.js b/horizon/static/framework/widgets/charts/pie-chart.directive.js index cdc789b1c1..3add96befa 100644 --- a/horizon/static/framework/widgets/charts/pie-chart.directive.js +++ b/horizon/static/framework/widgets/charts/pie-chart.directive.js @@ -150,7 +150,9 @@ var pie = d3.layout.pie() .sort(null) - .value(function (d) { return d.value; }); + .value(function (d) { + return d.value; + }); } var unwatch = scope.$watch('chartData', updateChart); @@ -174,7 +176,9 @@ scope.model.total = scope.chartData.maxLimit; scope.model.totalLabel = gettext('Max'); } else { - scope.model.total = d3.sum(scope.chartData.data, function (d) { return d.value; }); + scope.model.total = d3.sum(scope.chartData.data, function (d) { + return d.value; + }); scope.model.totalLabel = gettext('Total'); } scope.model.tooltipData.enabled = false; @@ -199,7 +203,9 @@ } }); - chart.on('mouseenter', function (d) { showTooltip(d, this); }) + chart.on('mouseenter', function (d) { + showTooltip(d, this); + }) .on('mouseleave', clearTooltip); // Animate the slice rendering diff --git a/horizon/static/framework/widgets/metadata/display/metadata-display.controller.js b/horizon/static/framework/widgets/metadata/display/metadata-display.controller.js index e3d07a7a1d..6d1a2d1fb0 100644 --- a/horizon/static/framework/widgets/metadata/display/metadata-display.controller.js +++ b/horizon/static/framework/widgets/metadata/display/metadata-display.controller.js @@ -62,8 +62,7 @@ if (item.parent) { item.parent.addedCount -= 1; } - } - else if (!item.custom) { + } else if (!item.custom) { ctrl.hide = false; } } diff --git a/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.spec.js b/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.spec.js index 2ed6d5b969..c067007a54 100644 --- a/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.spec.js +++ b/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.spec.js @@ -102,14 +102,16 @@ it("returns required", function() { var error = {required: true}; ctrl.text = {required: "texreq"}; - + /*eslint-disable no-undefined */ expect(ctrl.formatErrorMessage(undefined, error)).toBe('texreq'); + /*eslint-enable no-undefined */ }); it("returns nothing when nothing for error", function() { var error = {}; - + /*eslint-disable no-undefined */ expect(ctrl.formatErrorMessage(undefined, error)).toBeUndefined(); + /*eslint-enable no-undefined */ }); }); diff --git a/horizon/static/framework/widgets/metadata/tree/tree.spec.js b/horizon/static/framework/widgets/metadata/tree/tree.spec.js index adfc41c00e..822666ab3d 100644 --- a/horizon/static/framework/widgets/metadata/tree/tree.spec.js +++ b/horizon/static/framework/widgets/metadata/tree/tree.spec.js @@ -205,7 +205,7 @@ $scope = $injector.get('$rootScope').$new(); var serviceName = 'horizon.framework.widgets.metadata.tree.service'; - item = new ($injector.get(serviceName).Item)(); + item = new ($injector.get(serviceName)).Item(); $scope.item = item.fromProperty('test', namespaces[0].properties['test:A:6']); var markup = ' ctrl.allocated.sourceItems.length) { ctrl.allocated.sourceItems.push(item); ctrl.allocatedIds[item.id] = true; - } // Swap out items if only one allocation allowed - else if (ctrl.limits.maxAllocation === 1) { + } else if (ctrl.limits.maxAllocation === 1) { var temp = ctrl.allocated.sourceItems.pop(); delete ctrl.allocatedIds[temp.id]; // When swapping out, Smart-Table $watch is diff --git a/horizon/static/framework/widgets/transfer-table/transfer-table.controller.spec.js b/horizon/static/framework/widgets/transfer-table/transfer-table.controller.spec.js index 17c0b40ab0..bf3333f12b 100644 --- a/horizon/static/framework/widgets/transfer-table/transfer-table.controller.spec.js +++ b/horizon/static/framework/widgets/transfer-table/transfer-table.controller.spec.js @@ -27,7 +27,9 @@ beforeEach(module(function($provide) { // we will mock scope and timeout in this test // because we aren't concern with rendering results - var timeout = function(fn) { fn(); }; + var timeout = function(fn) { + fn(); + }; // we will mock parse and attrs // because we want to control the parameters diff --git a/horizon/static/framework/widgets/transfer-table/transfer-table.directive.js b/horizon/static/framework/widgets/transfer-table/transfer-table.directive.js index 3536c8b96f..3d46fe72b8 100644 --- a/horizon/static/framework/widgets/transfer-table/transfer-table.directive.js +++ b/horizon/static/framework/widgets/transfer-table/transfer-table.directive.js @@ -48,7 +48,7 @@ transferTable.$inject = [ 'horizon.framework.widgets.basePath' ]; function transferTable(path) { - var directive = { + return { controller: 'transferTableController', controllerAs: 'trCtrl', restrict: ' E', @@ -58,8 +58,6 @@ link: link }; - return directive; - ////////////////////// function link(scope, element, attrs, ctrl, transclude) { @@ -80,8 +78,7 @@ transclude(availableScope, function(clone) { available.append(clone.filter('table')); }); - } - else { + } else { transclude(scope, function(clone) { allocated.append(clone.filter('allocated')); available.append(clone.filter('available')); diff --git a/horizon/static/framework/widgets/wizard/wizard.spec.js b/horizon/static/framework/widgets/wizard/wizard.spec.js index 79b945af08..d302fdef5c 100644 --- a/horizon/static/framework/widgets/wizard/wizard.spec.js +++ b/horizon/static/framework/widgets/wizard/wizard.spec.js @@ -191,7 +191,11 @@ }); it("checks steps' readiness", function() { - var checkedStep = {checkReadiness: function() { return true; }}; + var checkedStep = { + checkReadiness: function() { + return true; + } + }; $scope.workflow = { steps: [{}, checkedStep, {}] }; diff --git a/openstack_dashboard/dashboards/admin/static/dashboard/admin/flavors/filters/has-extras.filter.spec.js b/openstack_dashboard/dashboards/admin/static/dashboard/admin/flavors/filters/has-extras.filter.spec.js index 5cd9503936..6c53f4125e 100644 --- a/openstack_dashboard/dashboards/admin/static/dashboard/admin/flavors/filters/has-extras.filter.spec.js +++ b/openstack_dashboard/dashboards/admin/static/dashboard/admin/flavors/filters/has-extras.filter.spec.js @@ -32,7 +32,7 @@ }); it('returns No when object is undefined or has no properties', function() { - expect(hasExtras(undefined)).not.toBeTruthy(); + expect(hasExtras()).not.toBeTruthy(); expect(hasExtras({})).not.toBeTruthy(); expect(hasExtras('string')).not.toBeTruthy(); expect(hasExtras(1)).not.toBeTruthy(); diff --git a/openstack_dashboard/dashboards/identity/static/dashboard/identity/users/table/table.controller.spec.js b/openstack_dashboard/dashboards/identity/static/dashboard/identity/users/table/table.controller.spec.js index 7870e76f08..3a186df8b5 100644 --- a/openstack_dashboard/dashboards/identity/static/dashboard/identity/users/table/table.controller.spec.js +++ b/openstack_dashboard/dashboards/identity/static/dashboard/identity/users/table/table.controller.spec.js @@ -23,13 +23,20 @@ function fakePolicy() { return { then: function(successFn, errorFn) { - if (policy.allowed) { successFn(); } - else { errorFn(); } + if (policy.allowed) { + successFn(); + } else { + errorFn(); + } } }; } - function fakePromise() { return { success: angular.noop }; } - function fakeToast() { return { add: angular.noop }; } + function fakePromise() { + return { success: angular.noop }; + } + function fakeToast() { + return { add: angular.noop }; + } var controller, toastService, policyAPI, keystoneAPI; diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/configuration/configuration.controller.spec.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/configuration/configuration.controller.spec.js index c1c87d991f..b6b45c304d 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/configuration/configuration.controller.spec.js +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/configuration/configuration.controller.spec.js @@ -30,7 +30,9 @@ it('has correct disk configuration options', function() { expect(ctrl.diskConfigOptions).toBeDefined(); expect(ctrl.diskConfigOptions.length).toBe(2); - var vals = ctrl.diskConfigOptions.map(function(x) { return x.value; }); + var vals = ctrl.diskConfigOptions.map(function(x) { + return x.value; + }); expect(vals).toContain('AUTO'); expect(vals).toContain('MANUAL'); }); diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/flavor/flavor.spec.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/flavor/flavor.spec.js index b50b6c5075..a1434d4b59 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/flavor/flavor.spec.js +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/flavor/flavor.spec.js @@ -401,7 +401,9 @@ describe('defaultIfUndefined', function () { it('returns the given default if value is undefined', function () { + /*eslint-disable no-undefined */ expect(ctrl.defaultIfUndefined(undefined, 'defValue')).toBe('defValue'); + /*eslint-enable no-undefined */ }); it('returns the value if defined', function () { diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/flavor/select-flavor-table.directive.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/flavor/select-flavor-table.directive.js index 8e70caba43..77472f2e72 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/flavor/select-flavor-table.directive.js +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/flavor/select-flavor-table.directive.js @@ -108,7 +108,9 @@ // This table used in "allocated" portion of transfer table scope.showSearchBar = false; // Always show items - scope.showItemFunc = function () { return true; }; + scope.showItemFunc = function () { + return true; + }; scope.itemClickAction = transferTableController.deallocate; scope.noneAvailableText = transferTableHelpText.noneAllocText; scope.itemButtonClasses = "fa fa-minus"; diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-modal.service.spec.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-modal.service.spec.js index 2cdb639ebf..65fa2f6a83 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-modal.service.spec.js +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-modal.service.spec.js @@ -72,7 +72,10 @@ spyOn(modal, 'open').and .returnValue({ result: { - then: function(x, y) { successFunc = x; errFunc = y; } + then: function(x, y) { + successFunc = x; + errFunc = y; + } } }); func(launchContext); @@ -88,7 +91,10 @@ spyOn(modal, 'open').and .returnValue({ result: { - then: function(x, y) { successFunc = x; errFunc = y; } + then: function(x, y) { + successFunc = x; + errFunc = y; + } } }); func(launchContext); diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js index 928c608063..3adf3bb707 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.js @@ -407,7 +407,7 @@ * size for validating vol_size field */ function checkVolumeForImage() { - var source = selection ? selection[0] : undefined; + var source = selection[0]; if (source && ctrl.currentBootSource === bootSourceTypes.IMAGE) { var imageGb = source.size * 1e-9; @@ -418,7 +418,9 @@ var volumeSizeObj = { minVolumeSize: ctrl.minVolumeSize }; ctrl.minVolumeSizeError = interpolate(volumeSizeText, volumeSizeObj, true); } else { + /*eslint-disable no-undefined */ ctrl.minVolumeSize = undefined; + /*eslint-enable no-undefined */ } } diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js index 065f92cb3d..13208d7ac7 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/source/source.controller.spec.js @@ -78,7 +78,9 @@ it('defines the correct boot source options', function() { expect(ctrl.bootSourcesOptions).toBeDefined(); var types = ['image', 'snapshot', 'volume', 'volume_snapshot']; - var opts = ctrl.bootSourcesOptions.map(function(x) { return x.type; }); + var opts = ctrl.bootSourcesOptions.map(function(x) { + return x.type; + }); types.forEach(function(key) { expect(opts).toContain(key); }); diff --git a/openstack_dashboard/static/app/core/images/filters/image-type.filter.spec.js b/openstack_dashboard/static/app/core/images/filters/image-type.filter.spec.js index 38eb962ed9..b267b5efef 100644 --- a/openstack_dashboard/static/app/core/images/filters/image-type.filter.spec.js +++ b/openstack_dashboard/static/app/core/images/filters/image-type.filter.spec.js @@ -39,7 +39,7 @@ }); it('returns Image for undefined', function () { - expect(imageTypeFilter(undefined)).toBe('Image'); + expect(imageTypeFilter()).toBe('Image'); }); }); diff --git a/openstack_dashboard/static/app/core/openstack-service-api/cinder-extensions.service.spec.js b/openstack_dashboard/static/app/core/openstack-service-api/cinder-extensions.service.spec.js index 63062b8321..ff2aa61f3b 100644 --- a/openstack_dashboard/static/app/core/openstack-service-api/cinder-extensions.service.spec.js +++ b/openstack_dashboard/static/app/core/openstack-service-api/cinder-extensions.service.spec.js @@ -21,9 +21,15 @@ beforeEach(module('horizon.app.core.openstack-service-api')); beforeEach(module(function($provide) { - cinderAPI = {getExtensions: function() {return {then: angular.noop}; }}; - q = {defer: function() { return {resolve: angular.noop}; }}; - $provide.value('$cacheFactory', function() {return "cache"; }); + cinderAPI = {getExtensions: function() { + return {then: angular.noop}; + }}; + q = {defer: function() { + return {resolve: angular.noop}; + }}; + $provide.value('$cacheFactory', function() { + return "cache"; + }); $provide.value('$q', q); $provide.value('horizon.app.core.openstack-service-api.cinder', cinderAPI); })); diff --git a/openstack_dashboard/static/app/core/openstack-service-api/common-test.mock.js b/openstack_dashboard/static/app/core/openstack-service-api/common-test.mock.js index 2d6a908727..7cf6faefc1 100644 --- a/openstack_dashboard/static/app/core/openstack-service-api/common-test.mock.js +++ b/openstack_dashboard/static/app/core/openstack-service-api/common-test.mock.js @@ -63,7 +63,9 @@ function testCall(apiService, service, toastService, config) { // 'promise' simulates a promise, including a self-referential success // handler. - var promise = {error: angular.noop, success: function() { return this; }}; + var promise = {error: angular.noop, success: function() { + return this; + }}; spyOn(apiService, config.method).and.returnValue(promise); spyOn(promise, 'error'); service[config.func].apply(null, config.testInput); diff --git a/openstack_dashboard/static/app/core/openstack-service-api/glance.service.js b/openstack_dashboard/static/app/core/openstack-service-api/glance.service.js index b4c46786d1..b9e37e895d 100644 --- a/openstack_dashboard/static/app/core/openstack-service-api/glance.service.js +++ b/openstack_dashboard/static/app/core/openstack-service-api/glance.service.js @@ -275,7 +275,7 @@ * filters. For example "name" : "fedora" would filter on the fedora name. */ function getImages(params) { - var config = (params) ? { 'params' : params} : {}; + var config = params ? { 'params' : params} : {}; return apiService.get('/api/glance/images/', config) .error(function () { toastService.add('error', gettext('Unable to retrieve the images.')); @@ -340,7 +340,7 @@ * enabled. */ function getNamespaces(params, suppressError) { - var config = (params) ? {'params' : params} : {}; + var config = params ? {'params' : params} : {}; config.cache = true; var promise = apiService.get('/api/glance/metadefs/namespaces/', config); diff --git a/openstack_dashboard/static/app/core/openstack-service-api/keystone.service.js b/openstack_dashboard/static/app/core/openstack-service-api/keystone.service.js index 9bd4fb7ff3..d3d668d361 100644 --- a/openstack_dashboard/static/app/core/openstack-service-api/keystone.service.js +++ b/openstack_dashboard/static/app/core/openstack-service-api/keystone.service.js @@ -72,7 +72,7 @@ // Users function getUsers(params) { - var config = (params) ? {'params': params} : {}; + var config = params ? {'params': params} : {}; return apiService.get('/api/keystone/users/', config) .error(function () { toastService.add('error', gettext('Unable to retrieve the users.')); @@ -247,7 +247,7 @@ // Projects function getProjects(params) { - var config = (params) ? {'params': params} : {}; + var config = params ? {'params': params} : {}; return apiService.get('/api/keystone/projects/', config) .error(function () { toastService.add('error', gettext('Unable to retrieve the projects.')); diff --git a/openstack_dashboard/static/app/core/openstack-service-api/nova-extensions.service.spec.js b/openstack_dashboard/static/app/core/openstack-service-api/nova-extensions.service.spec.js index d97943392e..3959fad68d 100644 --- a/openstack_dashboard/static/app/core/openstack-service-api/nova-extensions.service.spec.js +++ b/openstack_dashboard/static/app/core/openstack-service-api/nova-extensions.service.spec.js @@ -23,9 +23,15 @@ beforeEach(module('horizon.app.core.openstack-service-api')); beforeEach(module(function($provide) { - novaAPI = {getExtensions: function() {return {then: angular.noop}; }}; - q = {defer: function() { return {resolve: angular.noop}; }}; - $provide.value('$cacheFactory', function() {return "cache"; }); + novaAPI = {getExtensions: function() { + return {then: angular.noop}; + }}; + q = {defer: function() { + return {resolve: angular.noop}; + }}; + $provide.value('$cacheFactory', function() { + return "cache"; + }); $provide.value('$q', q); $provide.value('horizon.app.core.openstack-service-api.nova', novaAPI); })); diff --git a/openstack_dashboard/static/app/core/openstack-service-api/nova.service.js b/openstack_dashboard/static/app/core/openstack-service-api/nova.service.js index 5f055700aa..dfc1d60726 100644 --- a/openstack_dashboard/static/app/core/openstack-service-api/nova.service.js +++ b/openstack_dashboard/static/app/core/openstack-service-api/nova.service.js @@ -281,8 +281,12 @@ */ function getFlavors(isPublic, getExtras) { var config = {'params': {}}; - if (isPublic) { config.params.is_public = 'true'; } - if (getExtras) { config.params.get_extras = 'true'; } + if (isPublic) { + config.params.is_public = 'true'; + } + if (getExtras) { + config.params.get_extras = 'true'; + } return apiService.get('/api/nova/flavors/', config) .success(function (data) { // The colon character ':' in the flavor data causes problems when used @@ -319,8 +323,12 @@ */ function getFlavor(id, getExtras, getAccessList) { var config = {'params': {}}; - if (getExtras) { config.params.get_extras = 'true'; } - if (getAccessList) { config.params.get_access_list = 'true'; } + if (getExtras) { + config.params.get_extras = 'true'; + } + if (getAccessList) { + config.params.get_access_list = 'true'; + } return apiService.get('/api/nova/flavors/' + id + '/' , config) .error(function () { toastService.add('error', gettext('Unable to retrieve the flavor.')); diff --git a/openstack_dashboard/static/app/core/openstack-service-api/policy.service.js b/openstack_dashboard/static/app/core/openstack-service-api/policy.service.js index e1997c76fe..327aa8dc0b 100644 --- a/openstack_dashboard/static/app/core/openstack-service-api/policy.service.js +++ b/openstack_dashboard/static/app/core/openstack-service-api/policy.service.js @@ -108,8 +108,12 @@ return deferred.promise; function success(response) { - if (response.data.allowed) { deferred.resolve(); } - else { deferred.reject(); } + if (response.data.allowed) { + deferred.resolve(); + } + else { + deferred.reject(); + } } } } diff --git a/openstack_dashboard/static/app/core/openstack-service-api/policy.service.spec.js b/openstack_dashboard/static/app/core/openstack-service-api/policy.service.spec.js index c2677dfafa..646836695b 100644 --- a/openstack_dashboard/static/app/core/openstack-service-api/policy.service.spec.js +++ b/openstack_dashboard/static/app/core/openstack-service-api/policy.service.spec.js @@ -70,13 +70,17 @@ }; var deferred = { - then: function(callback) { callback(response); }, + then: function(callback) { + callback(response); + }, reject: angular.noop, resolve: angular.noop }; var service; - var q = { defer: function() { return deferred; }}; + var q = { defer: function() { + return deferred; + }}; //////////////// diff --git a/openstack_dashboard/static/app/core/openstack-service-api/service-catalog.service.spec.js b/openstack_dashboard/static/app/core/openstack-service-api/service-catalog.service.spec.js index 8dd20e5fe9..1621c3e01e 100644 --- a/openstack_dashboard/static/app/core/openstack-service-api/service-catalog.service.spec.js +++ b/openstack_dashboard/static/app/core/openstack-service-api/service-catalog.service.spec.js @@ -28,10 +28,18 @@ userSession = {get: angular.noop}; $provide.value('horizon.app.core.openstack-service-api.userSession', userSession); deferred = {promise: angular.noop, reject: angular.noop, resolve: angular.noop}; - q = {all: function() {return {then: angular.noop}; }, - defer: function() { return deferred; }}; + q = { + all: function() { + return {then: angular.noop}; + }, + defer: function() { + return deferred; + } + }; $provide.value('$q', q); - $provide.value('$cacheFactory', function() { return 'cache'; }); + $provide.value('$cacheFactory', function() { + return 'cache'; + }); })); beforeEach( diff --git a/openstack_dashboard/static/app/core/openstack-service-api/user-session.service.spec.js b/openstack_dashboard/static/app/core/openstack-service-api/user-session.service.spec.js index 63bfe90c65..5d40360050 100644 --- a/openstack_dashboard/static/app/core/openstack-service-api/user-session.service.spec.js +++ b/openstack_dashboard/static/app/core/openstack-service-api/user-session.service.spec.js @@ -24,7 +24,9 @@ beforeEach(module(function($provide) { keystoneAPI = {getCurrentUserSession: angular.noop}; $provide.value('horizon.app.core.openstack-service-api.keystone', keystoneAPI); - $provide.value('$cacheFactory', function() { return 'cache'; }); + $provide.value('$cacheFactory', function() { + return 'cache'; + }); })); beforeEach(inject(['horizon.app.core.openstack-service-api.userSession', function(userSession) { diff --git a/openstack_dashboard/static/app/tech-debt/image-form.controller.js b/openstack_dashboard/static/app/tech-debt/image-form.controller.js index 0784d2bcaa..665ff46120 100644 --- a/openstack_dashboard/static/app/tech-debt/image-form.controller.js +++ b/openstack_dashboard/static/app/tech-debt/image-form.controller.js @@ -24,7 +24,9 @@ ctrl.copyFrom = angular.element('#id_image_url').val(); ctrl.diskFormat = angular.element('#id_disk_format option:selected').val(); ctrl.selectImageFormat = function (path) { - if (!path) { return; } + if (!path) { + return; + } var format = path.substr(path.lastIndexOf(".") + 1).toLowerCase().replace(/[^a-z0-9]+/gi, ""); /* eslint-disable angular/ng_angularelement */