JSHint fixes

This commit is contained in:
Akita Noek
2016-05-27 14:39:08 -04:00
parent 240b35c8d4
commit 22300347f0
8 changed files with 15 additions and 16 deletions

View File

@@ -23,7 +23,7 @@ export default
return i.role; return i.role;
})) }))
.filter((role) => { .filter((role) => {
return !!attrs.teamRoleList == !!role.team_id; return Boolean(attrs.teamRoleList) === Boolean(role.team_id);
}) })
.sort((a, b) => { .sort((a, b) => {
if (a.name if (a.name

View File

@@ -74,7 +74,7 @@ export default
var licenseInfo = FeaturesService.getLicenseInfo(); var licenseInfo = FeaturesService.getLicenseInfo();
scope.licenseType = licenseInfo ? licenseInfo.license_type : null; scope.licenseType = licenseInfo ? licenseInfo.license_type : null;
if (!licenseInfo) { if (!licenseInfo) {
console.warn("License info not loaded correctly"); console.warn("License info not loaded correctly"); // jshint ignore:line
} }
}) })
.catch(function (response) { .catch(function (response) {

View File

@@ -162,7 +162,7 @@ export function UsersAdd($scope, $rootScope, $compile, $location, $log,
generator.reset(); generator.reset();
$scope.user_type_options = user_type_options; $scope.user_type_options = user_type_options;
$scope.user_type = user_type_options[0] $scope.user_type = user_type_options[0];
$scope.$watch('user_type', user_type_sync($scope)); $scope.$watch('user_type', user_type_sync($scope));
CreateSelect2({ CreateSelect2({
@@ -271,7 +271,7 @@ export function UsersEdit($scope, $rootScope, $location,
generator.reset(); generator.reset();
$scope.user_type_options = user_type_options; $scope.user_type_options = user_type_options;
$scope.user_type = user_type_options[0] $scope.user_type = user_type_options[0];
$scope.$watch('user_type', user_type_sync($scope)); $scope.$watch('user_type', user_type_sync($scope));
var setScopeFields = function(data){ var setScopeFields = function(data){

View File

@@ -20,7 +20,7 @@ export default
angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', listGenerator.name, 'ModalDialog', angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper', 'SearchHelper', 'PaginationHelpers', listGenerator.name, 'ModalDialog',
'GeneratorHelpers']) 'GeneratorHelpers'])
.factory('EditSchedule', ['SchedulerInit', '$rootScope', 'Wait', 'Rest', .factory('EditSchedule', ['SchedulerInit', '$rootScope', 'Wait', 'Rest',
'ProcessErrors', 'GetBasePath', 'SchedulePost', '$state', 'ProcessErrors', 'GetBasePath', 'SchedulePost', '$state',
function(SchedulerInit, $rootScope, Wait, Rest, ProcessErrors, function(SchedulerInit, $rootScope, Wait, Rest, ProcessErrors,
GetBasePath, SchedulePost, $state) { GetBasePath, SchedulePost, $state) {
@@ -176,7 +176,7 @@ export default
}; };
}]) }])
.factory('AddSchedule', ['$location', '$rootScope', '$stateParams', .factory('AddSchedule', ['$location', '$rootScope', '$stateParams',
'SchedulerInit', 'Wait', 'GetBasePath', 'Empty', 'SchedulePost', '$state', 'Rest', 'ProcessErrors', 'SchedulerInit', 'Wait', 'GetBasePath', 'Empty', 'SchedulePost', '$state', 'Rest', 'ProcessErrors',
function($location, $rootScope, $stateParams, SchedulerInit, function($location, $rootScope, $stateParams, SchedulerInit,
Wait, GetBasePath, Empty, SchedulePost, $state, Rest, Wait, GetBasePath, Empty, SchedulePost, $state, Rest,
@@ -295,8 +295,7 @@ export default
}]) }])
.factory('SchedulePost', ['Rest', 'ProcessErrors', 'RRuleToAPI', 'Wait', .factory('SchedulePost', ['Rest', 'ProcessErrors', 'RRuleToAPI', 'Wait',
'ToJSON', function(Rest, ProcessErrors, RRuleToAPI, Wait) {
function(Rest, ProcessErrors, RRuleToAPI, Wait, ToJSON) {
return function(params) { return function(params) {
var scope = params.scope, var scope = params.scope,
url = params.url, url = params.url,
@@ -326,8 +325,8 @@ export default
schedule.extra_data = JSON.stringify(extra_vars); schedule.extra_data = JSON.stringify(extra_vars);
} }
else if(scope.extraVars){ else if(scope.extraVars){
schedule.extra_data = scope.parseType === 'yaml' ? schedule.extra_data = scope.parseType === 'yaml' ?
(scope.extraVars === '---' ? "" : jsyaml.safeLoad(scope.extraVars)) : scope.extraVars; (scope.extraVars === '---' ? "" : jsyaml.safeLoad(scope.extraVars)) : scope.extraVars;
} }
Rest.setUrl(url); Rest.setUrl(url);
if (mode === 'add') { if (mode === 'add') {

View File

@@ -80,7 +80,7 @@
group_id: id group_id: id
}); });
}; };
$scope.showFailedHosts = function(x, y, z){ $scope.showFailedHosts = function() {
$state.go('inventoryManage', {failed: true}, {reload: true}); $state.go('inventoryManage', {failed: true}, {reload: true});
}; };
$scope.scheduleGroup = function(id) { $scope.scheduleGroup = function(id) {
@@ -91,7 +91,7 @@
$scope.$parent.groupsSelected = selection.length > 0 ? true : false; $scope.$parent.groupsSelected = selection.length > 0 ? true : false;
$scope.$parent.groupsSelectedItems = selection.selectedItems; $scope.$parent.groupsSelectedItems = selection.selectedItems;
}); });
$scope.$on('PostRefresh', () =>{ $scope.$on('PostRefresh', () => {
$scope.groups.forEach( (group, index) => { $scope.groups.forEach( (group, index) => {
var group_status, hosts_status; var group_status, hosts_status;
group_status = GetSyncStatusMsg({ group_status = GetSyncStatusMsg({

View File

@@ -8,7 +8,7 @@ import {ManageHostsAdd, ManageHostsEdit} from './hosts.route';
export default export default
angular.module('manageHosts', []) angular.module('manageHosts', [])
.run(['$stateExtender', '$state', function($stateExtender, $state){ .run(['$stateExtender', function($stateExtender){
$stateExtender.addState(ManageHostsAdd); $stateExtender.addState(ManageHostsAdd);
$stateExtender.addState(ManageHostsEdit); $stateExtender.addState(ManageHostsEdit);
}]); }]);

View File

@@ -61,7 +61,7 @@ export default
data.summary_fields[form.fields[fld].sourceModel][form.fields[fld].sourceField]; data.summary_fields[form.fields[fld].sourceModel][form.fields[fld].sourceField];
} }
} }
$scope.canEdit = data['script'] !== null; $scope.canEdit = data.script !== null;
if (!$scope.canEdit) { if (!$scope.canEdit) {
$scope.script = "Script contents hidden"; $scope.script = "Script contents hidden";
} }

View File

@@ -108,7 +108,7 @@ export default
} }
}) })
.error(function (ret,status_code) { .error(function (ret,status_code) {
if (status_code == 403) { if (status_code === 403) {
/* user doesn't have access to see the project, no big deal. */ /* user doesn't have access to see the project, no big deal. */
} else { } else {
Alert('Missing Playbooks', 'Unable to retrieve the list of playbooks for this project. Choose a different ' + Alert('Missing Playbooks', 'Unable to retrieve the list of playbooks for this project. Choose a different ' +
@@ -198,7 +198,7 @@ export default
} }
}) })
.error(function (data, status) { .error(function (data, status) {
if (status == 403) { if (status === 403) {
/* User doesn't have read access to the project, no problem. */ /* User doesn't have read access to the project, no problem. */
} else { } else {
ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to get project ' + $scope.project + ProcessErrors($scope, data, status, form, { hdr: 'Error!', msg: 'Failed to get project ' + $scope.project +