From 9c53d03f7e4bcc90f0ea02cacbc79a2b60439d10 Mon Sep 17 00:00:00 2001 From: Kelly Domico Date: Fri, 8 Jul 2016 09:39:26 -0700 Subject: [PATCH] Fix lint warnings and errors --- src/app/view/application.directive.js | 4 +++- src/app/view/application.directive.spec.js | 4 +--- .../cluster/organization/cluster-organization.module.js | 3 ++- src/app/view/endpoints/clusters/clusters.module.js | 6 +++--- src/app/view/endpoints/endpoints.module.js | 4 ++-- .../model/application/application-state.service.js | 2 +- .../model/application/application-state.service.spec.js | 4 ++-- .../view/applications/application/application.module.js | 2 +- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/app/view/application.directive.js b/src/app/view/application.directive.js index 1554cfe814..955be20ed7 100644 --- a/src/app/view/application.directive.js +++ b/src/app/view/application.directive.js @@ -130,7 +130,9 @@ var account = this.modelManager.retrieve('app.model.account'); // Fetch the list of services instances + /* eslint-disable */ // TODO: If this fails, we should show a notification message + /* eslint-enable */ this.modelManager.retrieve('app.model.serviceInstance') .list() .then(function onSuccess(data) { @@ -148,7 +150,7 @@ } else { var userServiceInstanceModel = that.modelManager.retrieve('app.model.serviceInstance.user'); // Need to get the user's service list to determine if they have any connected - return userServiceInstanceModel.list().then(function() { + return userServiceInstanceModel.list().then(function () { // Developer - allow user to connect services, if we have some and none are connected that.showRegistration = userServiceInstanceModel.numValid === 0; }); diff --git a/src/app/view/application.directive.spec.js b/src/app/view/application.directive.spec.js index 25ec2f872a..190f6d15c3 100644 --- a/src/app/view/application.directive.spec.js +++ b/src/app/view/application.directive.spec.js @@ -8,7 +8,7 @@ Scheme: 'https', Host: 'api.test.com', Path: '' - } + }; beforeEach(module('templates')); beforeEach(module('green-box-console')); @@ -160,7 +160,6 @@ expect(applicationCtrl.serverFailedToRespond).toBe(false); }); - it('invoke `login` method - failure with bad credentials', function () { applicationCtrl.loggedIn = false; $httpBackend.when('POST', '/pp/v1/auth/login/uaa').respond(400, {}); @@ -279,7 +278,6 @@ }); it('should not show service instance registration if we have registered services', function () { - var mockUser = {id: 1, username: 'dev', registered: true}; var future = 50000 + (new Date()).getTime() / 1000; $httpBackend.when('GET', '/pp/v1/cnsis/registered').respond(200, [ diff --git a/src/app/view/endpoints/clusters/cluster/organization/cluster-organization.module.js b/src/app/view/endpoints/clusters/cluster/organization/cluster-organization.module.js index 669782e357..b71f3fe6ec 100644 --- a/src/app/view/endpoints/clusters/cluster/organization/cluster-organization.module.js +++ b/src/app/view/endpoints/clusters/cluster/organization/cluster-organization.module.js @@ -24,7 +24,8 @@ '$stateParams' ]; - function ClusterOrgController(modelManager, $stateParams) { } + function ClusterOrgController(modelManager, $stateParams) {} // eslint-disable-line no-unused-vars angular.extend(ClusterOrgController.prototype, {}); + })(); diff --git a/src/app/view/endpoints/clusters/clusters.module.js b/src/app/view/endpoints/clusters/clusters.module.js index 389fb2c904..e8e622c334 100644 --- a/src/app/view/endpoints/clusters/clusters.module.js +++ b/src/app/view/endpoints/clusters/clusters.module.js @@ -1,4 +1,4 @@ -(function() { +(function () { 'use strict'; angular @@ -27,8 +27,8 @@ return new Clusters(); } - function Clusters() { } + function Clusters() {} - angular.extend(Clusters.prototype, { }); + angular.extend(Clusters.prototype, {}); })(); diff --git a/src/app/view/endpoints/endpoints.module.js b/src/app/view/endpoints/endpoints.module.js index 728557b2fb..8f1b4ec06b 100644 --- a/src/app/view/endpoints/endpoints.module.js +++ b/src/app/view/endpoints/endpoints.module.js @@ -1,4 +1,4 @@ -(function() { +(function () { 'use strict'; angular @@ -46,7 +46,7 @@ angular.extend(Endpoints.prototype, { - onLoggedIn: function() { + onLoggedIn: function () { var menu = this.modelManager.retrieve('app.model.navigation').menu; menu.addMenuItem('endpoints', 'endpoint.dashboard', gettext('Endpoints')); } diff --git a/src/plugins/cloud-foundry/model/application/application-state.service.js b/src/plugins/cloud-foundry/model/application/application-state.service.js index 7d41fffa39..7d6262e15b 100644 --- a/src/plugins/cloud-foundry/model/application/application-state.service.js +++ b/src/plugins/cloud-foundry/model/application/application-state.service.js @@ -13,7 +13,7 @@ /** * @function stateServiceFactory - * @name cloud-foundry.model.application.stateService + * @memberof cloud-foundry.model.application * @description Service to map app states to user-friendly state names, presentation and actions. * @returns {object} The Application State Service */ diff --git a/src/plugins/cloud-foundry/model/application/application-state.service.spec.js b/src/plugins/cloud-foundry/model/application/application-state.service.spec.js index b709812c3c..0b4b5aa5a9 100644 --- a/src/plugins/cloud-foundry/model/application/application-state.service.spec.js +++ b/src/plugins/cloud-foundry/model/application/application-state.service.spec.js @@ -11,7 +11,7 @@ appStateService = $injector.get('cloud-foundry.model.application.stateService'); })); - afterEach(function() { + afterEach(function () { $httpBackend.verifyNoOutstandingExpectation(); $httpBackend.verifyNoOutstandingRequest(); }); @@ -31,7 +31,7 @@ }; var instances = []; var running = 0; - _.each(instanceSstates, function(s) { + _.each(instanceSstates, function (s) { instances.push({state: s}); if (s === 'RUNNING') { running++; } }); diff --git a/src/plugins/cloud-foundry/view/applications/application/application.module.js b/src/plugins/cloud-foundry/view/applications/application/application.module.js index 521c95e4e7..31764b1bad 100644 --- a/src/plugins/cloud-foundry/view/applications/application/application.module.js +++ b/src/plugins/cloud-foundry/view/applications/application/application.module.js @@ -155,7 +155,7 @@ var that = this; this.ready = false; this.model.getAppSummary(this.cnsiGuid, this.id, true) - .finally(function() { + .finally(function () { that.ready = true; });