Skip to content

Commit

Permalink
Pleasing the JSHint gods
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgliss committed Jul 21, 2015
1 parent c75e20a commit a826bd1
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 28 deletions.
6 changes: 2 additions & 4 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
tests/
lemur/static/lemur/scripts/lib/
lemur/static/lemur/dist/
lemur/static/lemur/vendor/
lemur/static//dist/
lemur/static/app/vendor/
8 changes: 4 additions & 4 deletions lemur/static/app/angular/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ lemur.factory('LemurRestangular', function (Restangular, $location, $auth) {
RestangularConfigurer.setBaseUrl('http://localhost:5000/api/1');
RestangularConfigurer.setDefaultHttpFields({withCredentials: true});

RestangularConfigurer.addResponseInterceptor(function (data, operation, what, url, response, deferred) {
RestangularConfigurer.addResponseInterceptor(function (data, operation) {
var extractedData;

// .. to look for getList operations
if (operation === "getList") {
if (operation === 'getList') {
// .. and handle the data and meta data
extractedData = data.items;
extractedData.total = data.total;
Expand All @@ -79,7 +79,7 @@ lemur.factory('LemurRestangular', function (Restangular, $location, $auth) {
return extractedData;
});

RestangularConfigurer.addFullRequestInterceptor(function (element, operation, route, url, headers, params, httpConfig) {
RestangularConfigurer.addFullRequestInterceptor(function (element, operation, route, url, headers, params) {
// We want to make sure the user is auth'd before any requests
if (!$auth.isAuthenticated()) {
$location.path('/login');
Expand All @@ -97,7 +97,7 @@ lemur.factory('LemurRestangular', function (Restangular, $location, $auth) {
newParams.sortDir = params[item];
} else if (item.indexOf(f) > -1) {
var key = regExp.exec(item)[1];
newParams['filter'] = key + ";" + params[item];
newParams.filter = key + ';' + params[item];
} else {
newParams[item] = params[item];
}
Expand Down
4 changes: 2 additions & 2 deletions lemur/static/app/angular/authentication/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ angular.module('lemur')
AuthenticationService.authenticate = function (provider) {
$auth.authenticate(provider)
.then(
function (user) {
function () {
UserService.getCurrentUser();
$rootScope.$emit('user:login');
$location.url('/certificates');
Expand Down Expand Up @@ -56,7 +56,7 @@ angular.module('lemur')
body: 'You have been successfully logged out.'
});
$location.path('/');
})
});
};

});
4 changes: 2 additions & 2 deletions lemur/static/app/angular/authorities/authority/authority.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ angular.module('lemur')
$scope.loading = false;
$scope.create = function (authority) {
WizardHandler.wizard().context.loading = true;
AuthorityService.create(authority).then(function (resposne) {
AuthorityService.create(authority).then(function () {
WizardHandler.wizard().context.loading = false;
$modalInstance.close();
})
});
};

PluginService.get('issuer').then(function (plugins) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ angular.module('lemur')

$scope.create = function (certificate) {
WizardHandler.wizard().context.loading = true;
CertificateService.create(certificate).then(function (response) {
CertificateService.create(certificate).then(function () {
WizardHandler.wizard().context.loading = false;
$modalInstance.close();
});
Expand Down
13 changes: 6 additions & 7 deletions lemur/static/app/angular/certificates/services.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* Created by kglisson on 1/19/15.
*/
'use strict';

angular.module('lemur')
.service('CertificateApi', function (LemurRestangular, DomainService) {
LemurRestangular.extendModel('certificates', function (obj) {
Expand Down Expand Up @@ -102,7 +101,7 @@ angular.module('lemur')
CertificateService.create = function (certificate) {
certificate.attachSubAltName();
return CertificateApi.post(certificate).then(
function (response) {
function () {
toaster.pop({
type: 'success',
title: certificate.name,
Expand Down Expand Up @@ -132,8 +131,8 @@ angular.module('lemur')
};

CertificateService.upload = function (certificate) {
CertificateApi.customPOST(certificate, "upload").then(
function (response) {
CertificateApi.customPOST(certificate, 'upload').then(
function () {
toaster.pop({
type: 'success',
title: certificate.name,
Expand Down Expand Up @@ -163,7 +162,7 @@ angular.module('lemur')
certificate.privateKey = response.key;
}
},
function (response) {
function () {
toaster.pop({
type: 'error',
title: certificate.name,
Expand Down
2 changes: 2 additions & 0 deletions lemur/static/app/angular/components/filters.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

angular.module('lemur').
filter('titleCase', function () {
return function (str) {
Expand Down
9 changes: 4 additions & 5 deletions lemur/static/app/angular/dashboard/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ angular.module('lemur')
controller: 'DashboardController'
});
})
.controller('DashboardController', function ($scope, $rootScope, $filter, $location, LemurRestangular, ngTableParams) {
.controller('DashboardController', function ($scope, $rootScope, $filter, $location, LemurRestangular) {

var baseStats = LemurRestangular.all('stats');
var baseAccounts = LemurRestangular.all('accounts');

baseAccounts.getList()
Expand Down Expand Up @@ -78,16 +77,16 @@ angular.module('lemur')

LemurRestangular.all('certificates').customGET('stats', {metric: 'issuer'})
.then(function (data) {
$scope.issuers = data['items'];
$scope.issuers = data.items;
});

LemurRestangular.all('certificates').customGET('stats', {metric: 'bits'})
.then(function (data) {
$scope.bits = data['items'];
$scope.bits = data.items;
});

LemurRestangular.all('certificates').customGET('stats', {metric: 'not_after'})
.then(function (data) {
$scope.expiring = {labels: data['items']['labels'], values: [data['items']['values']]};
$scope.expiring = {labels: data.items.labels, values: [data.items.values]};
});
});
2 changes: 2 additions & 0 deletions lemur/static/app/angular/domains/services.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

angular.module('lemur')
.service('DomainApi', function (LemurRestangular) {
return LemurRestangular.all('domains');
Expand Down
4 changes: 3 additions & 1 deletion lemur/static/app/angular/elbs/services.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

angular.module('lemur')
.service('ELBApi', function (LemurRestangular, ListenerService) {
.service('ELBApi', function (LemurRestangular) {
LemurRestangular.extendModel('elbs', function (obj) {
return angular.extend(obj, {
attachListener: function (listener) {
Expand Down
2 changes: 2 additions & 0 deletions lemur/static/app/angular/listeners/services.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

angular.module('lemur')
.service('ListenerApi', function (LemurRestangular) {
return LemurRestangular.all('listeners');
Expand Down
2 changes: 2 additions & 0 deletions lemur/static/app/angular/plugins/services.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

angular.module('lemur')
.service('PluginApi', function (LemurRestangular) {
return LemurRestangular.all('plugins');
Expand Down
4 changes: 3 additions & 1 deletion lemur/static/app/angular/roles/services.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

angular.module('lemur')
.service('RoleApi', function (LemurRestangular) {
LemurRestangular.extendModel('roles', function (obj) {
Expand Down Expand Up @@ -108,7 +110,7 @@ angular.module('lemur')
role.username = response.username;
}
},
function (response) {
function () {
toaster.pop({
type: 'error',
title: role.name,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@
"pretest": "npm install && npm run build_static",
"build_static": "gulp build",
"prelint": "npm install",
"lint": "jshint app/",
"lint": "jshint lemur/static/app/",
"test": "gulp test"
},
"devDependencies": {
"jshint": "^2.8.0",
"karma-chrome-launcher": "^0.2.0"
}
}

0 comments on commit a826bd1

Please sign in to comment.