mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
Updates jshint settings
This commit is contained in:
20
.jshintrc
20
.jshintrc
@@ -3,15 +3,29 @@
|
|||||||
"jquery": true,
|
"jquery": true,
|
||||||
"esnext": true,
|
"esnext": true,
|
||||||
"globalstrict": true,
|
"globalstrict": true,
|
||||||
"globals": { "angular":false, "alert":false, "$AnsibleConfig":true, "$basePath":true, "jsyaml":false, "_":false, "d3":false, "Donut3D":false, "nv":false },
|
"curly": true,
|
||||||
|
"immed": true,
|
||||||
|
"latedef": "nofunc",
|
||||||
|
"noarg": true,
|
||||||
|
"nonew": true,
|
||||||
|
"notypeof": true,
|
||||||
|
"globals": {
|
||||||
|
"angular":false,
|
||||||
|
"alert":false,
|
||||||
|
"$AnsibleConfig":true,
|
||||||
|
"$basePath":true,
|
||||||
|
"jsyaml":false,
|
||||||
|
"_":false,
|
||||||
|
"d3":false,
|
||||||
|
"Donut3D":false,
|
||||||
|
"nv":false
|
||||||
|
},
|
||||||
"strict": false,
|
"strict": false,
|
||||||
"quotmark": false,
|
"quotmark": false,
|
||||||
"smarttabs": true,
|
|
||||||
"trailing": true,
|
"trailing": true,
|
||||||
"undef": true,
|
"undef": true,
|
||||||
"unused": true,
|
"unused": true,
|
||||||
"eqeqeq": true,
|
"eqeqeq": true,
|
||||||
"indent": 4,
|
"indent": 4,
|
||||||
"onevar": true,
|
|
||||||
"newcap": false
|
"newcap": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
// > password_strength = green
|
// > password_strength = green
|
||||||
// It also controls password validation. Passwords are rejected if the score is not > password_strength.
|
// It also controls password validation. Passwords are rejected if the score is not > password_strength.
|
||||||
|
|
||||||
session_timeout: 1800, // Number of seconds before an inactive session is automatically timed out and forced to log in again.
|
session_timeout: 1800, // Number of seconds before an inactive session is automatically timed out and forced to log in again.
|
||||||
// Separate from time out value set in API.
|
// Separate from time out value set in API.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -527,7 +527,9 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
|
|
||||||
if($scope.survey_enabled === true && $scope.survey_exists!==true){
|
if($scope.survey_enabled === true && $scope.survey_exists!==true){
|
||||||
$scope.$emit("PromptForSurvey");
|
$scope.$emit("PromptForSurvey");
|
||||||
} else $scope.$emit("GatherFormFields");
|
} else {
|
||||||
|
$scope.$emit("GatherFormFields");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -634,7 +636,9 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
' project or make the playbooks available on the file system.', 'alert-info');
|
' project or make the playbooks available on the file system.', 'alert-info');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else Wait('stop');
|
else {
|
||||||
|
Wait('stop');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Detect and alert user to potential SCM status issues
|
// Detect and alert user to potential SCM status issues
|
||||||
@@ -964,7 +968,9 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
|
|
||||||
if($scope.survey_enabled === true && $scope.survey_exists!==true){
|
if($scope.survey_enabled === true && $scope.survey_exists!==true){
|
||||||
$scope.$emit("PromptForSurvey");
|
$scope.$emit("PromptForSurvey");
|
||||||
} else $scope.$emit("GatherFormFields");
|
} else {
|
||||||
|
$scope.$emit("GatherFormFields");
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1021,11 +1027,12 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
if($scope.survey_enabled === true && $scope.survey_exists!==true){
|
if($scope.survey_enabled === true && $scope.survey_exists!==true){
|
||||||
$scope.$emit("PromptForSurvey");
|
$scope.$emit("PromptForSurvey");
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
PlaybookRun({
|
PlaybookRun({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
id: id
|
id: id
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// handler for 'Enable Survey' button
|
// handler for 'Enable Survey' button
|
||||||
@@ -1063,4 +1070,4 @@ JobTemplatesEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$l
|
|||||||
'GetBasePath', 'md5Setup', 'ParseTypeChange', 'JobStatusToolTip', 'FormatDate', 'Wait', 'Stream', 'Empty', 'Prompt',
|
'GetBasePath', 'md5Setup', 'ParseTypeChange', 'JobStatusToolTip', 'FormatDate', 'Wait', 'Stream', 'Empty', 'Prompt',
|
||||||
'ParseVariableString', 'ToJSON', 'SchedulesControllerInit', 'JobsControllerInit', 'JobsListUpdate', 'GetChoices',
|
'ParseVariableString', 'ToJSON', 'SchedulesControllerInit', 'JobsControllerInit', 'JobsListUpdate', 'GetChoices',
|
||||||
'SchedulesListInit', 'SchedulesList', 'CallbackHelpInit', 'PlaybookRun' , 'SurveyControllerInit', '$sce'
|
'SchedulesListInit', 'SchedulesList', 'CallbackHelpInit', 'PlaybookRun' , 'SurveyControllerInit', '$sce'
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1074,8 +1074,9 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
msg: 'Failed to retrieve inventory source. GET status: ' + status });
|
msg: 'Failed to retrieve inventory source. GET status: ' + status });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
modal_scope.$emit('groupVariablesLoaded'); // JT-- "groupVariablesLoaded" is where the schedule info is loaded, so I make a call after the sources_scope.source has been loaded
|
modal_scope.$emit('groupVariablesLoaded'); // JT-- "groupVariablesLoaded" is where the schedule info is loaded, so I make a call after the sources_scope.source has been loaded
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (sources_scope.removeScopeSourceTypeOptionsReady) {
|
if (sources_scope.removeScopeSourceTypeOptionsReady) {
|
||||||
|
|||||||
@@ -1208,10 +1208,12 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
|||||||
keys;
|
keys;
|
||||||
|
|
||||||
function listSort(a,b) {
|
function listSort(a,b) {
|
||||||
if (parseInt(a,10) < parseInt(b,10))
|
if (parseInt(a,10) < parseInt(b,10)) {
|
||||||
return -1;
|
return -1;
|
||||||
if (parseInt(a,10) > parseInt(b,10))
|
}
|
||||||
|
if (parseInt(a,10) > parseInt(b,10)) {
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1276,10 +1278,12 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
|||||||
idx, key, keys, newKeys, tasks, t;
|
idx, key, keys, newKeys, tasks, t;
|
||||||
|
|
||||||
function listSort(a,b) {
|
function listSort(a,b) {
|
||||||
if (parseInt(a,10) < parseInt(b,10))
|
if (parseInt(a,10) < parseInt(b,10)) {
|
||||||
return -1;
|
return -1;
|
||||||
if (parseInt(a,10) > parseInt(b,10))
|
}
|
||||||
|
if (parseInt(a,10) > parseInt(b,10)) {
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1385,15 +1389,19 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
|||||||
keys = Object.keys(filteredListB);
|
keys = Object.keys(filteredListB);
|
||||||
keys.sort(function compare(a, b) {
|
keys.sort(function compare(a, b) {
|
||||||
if (filteredListB[a].name === filteredListB[b].name) {
|
if (filteredListB[a].name === filteredListB[b].name) {
|
||||||
if (filteredListB[a].counter < filteredListB[b].counter)
|
if (filteredListB[a].counter < filteredListB[b].counter) {
|
||||||
return -1;
|
return -1;
|
||||||
if (filteredListB[a].counter >filteredListB[b].counter)
|
}
|
||||||
|
if (filteredListB[a].counter >filteredListB[b].counter) {
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (filteredListB[a].name < filteredListB[b].name)
|
if (filteredListB[a].name < filteredListB[b].name) {
|
||||||
return -1;
|
return -1;
|
||||||
if (filteredListB[a].name > filteredListB[b].name)
|
}
|
||||||
|
if (filteredListB[a].name > filteredListB[b].name) {
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// a must be equal to b
|
// a must be equal to b
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1453,10 +1461,12 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
|||||||
keys = Object.keys(filteredListB);
|
keys = Object.keys(filteredListB);
|
||||||
|
|
||||||
keys.sort(function(a,b) {
|
keys.sort(function(a,b) {
|
||||||
if (filteredListB[a].name > filteredListB[b].name)
|
if (filteredListB[a].name > filteredListB[b].name) {
|
||||||
return 1;
|
return 1;
|
||||||
if (filteredListB[a].name < filteredListB[b].name)
|
}
|
||||||
|
if (filteredListB[a].name < filteredListB[b].name) {
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
// a must be equal to b
|
// a must be equal to b
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -111,7 +111,9 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
|
|||||||
if(scope.prompt_for_vars===false && scope.survey_enabled===true){
|
if(scope.prompt_for_vars===false && scope.survey_enabled===true){
|
||||||
scope.$emit('GetExtraVars');
|
scope.$emit('GetExtraVars');
|
||||||
}
|
}
|
||||||
else scope.$emit('BuildData');
|
else {
|
||||||
|
scope.$emit('BuildData');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -831,7 +833,9 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
|
|||||||
else if (!Empty(scope.survey_enabled) && scope.survey_enabled===true) {
|
else if (!Empty(scope.survey_enabled) && scope.survey_enabled===true) {
|
||||||
scope.$emit('PromptForSurvey', html, url);
|
scope.$emit('PromptForSurvey', html, url);
|
||||||
}
|
}
|
||||||
else scope.$emit('StartPlaybookRun', url);
|
else {
|
||||||
|
scope.$emit('StartPlaybookRun', url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -1021,4 +1025,4 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -95,7 +95,9 @@ angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'Job
|
|||||||
if(scope.$parent.portalMode===true){
|
if(scope.$parent.portalMode===true){
|
||||||
$window.open('/#/jobs/' + job.id, '_blank');
|
$window.open('/#/jobs/' + job.id, '_blank');
|
||||||
}
|
}
|
||||||
else $location.url('/jobs/' + job.id);
|
else {
|
||||||
|
$location.url('/jobs/' + job.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LogViewer({
|
LogViewer({
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ angular.module('PermissionsHelper', [])
|
|||||||
} else {
|
} else {
|
||||||
scope.projectrequired = true;
|
scope.projectrequired = true;
|
||||||
html = "<dl>\n" +
|
html = "<dl>\n" +
|
||||||
"<dt>Create</dt>\n" +
|
"<dt>Create</dt>\n" +
|
||||||
"<dd>Allow the user or team to create job templates. This implies that they have the Run and Check permissions.</dd>\n" +
|
"<dd>Allow the user or team to create job templates. This implies that they have the Run and Check permissions.</dd>\n" +
|
||||||
"<dt>Run</dt>\n" +
|
"<dt>Run</dt>\n" +
|
||||||
"<dd>Allow the user or team to run a job template from the project against the inventory. In Run mode modules will " +
|
"<dd>Allow the user or team to run a job template from the project against the inventory. In Run mode modules will " +
|
||||||
"be executed, and changes to the inventory will occur.</dd>\n" +
|
"be executed, and changes to the inventory will occur.</dd>\n" +
|
||||||
|
|||||||
@@ -73,7 +73,9 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
|
|||||||
if(scope.can_edit === false){
|
if(scope.can_edit === false){
|
||||||
$('#survey-save-button').attr('disabled', "disabled");
|
$('#survey-save-button').attr('disabled', "disabled");
|
||||||
}
|
}
|
||||||
else $('#survey-save-button').attr('ng-disabled', "survey_questions.length<1 ");
|
else {
|
||||||
|
$('#survey-save-button').attr('ng-disabled', "survey_questions.length<1 ");
|
||||||
|
}
|
||||||
element = angular.element(document.getElementById('survey-save-button'));
|
element = angular.element(document.getElementById('survey-save-button'));
|
||||||
$compile(element)(scope);
|
$compile(element)(scope);
|
||||||
|
|
||||||
@@ -513,7 +515,9 @@ angular.module('SurveyHelper', [ 'Utilities', 'RestServices', 'SchedulesHelper',
|
|||||||
if(scope.mode === 'add'){
|
if(scope.mode === 'add'){
|
||||||
questions = [];
|
questions = [];
|
||||||
}
|
}
|
||||||
else scope.survey_questions = [];
|
else {
|
||||||
|
scope.survey_questions = [];
|
||||||
|
}
|
||||||
$(me).dialog('close');
|
$(me).dialog('close');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -100,8 +100,9 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job
|
|||||||
scope.update = function(){
|
scope.update = function(){
|
||||||
var val = [];
|
var val = [];
|
||||||
angular.forEach(scope.cbModel, function(v,k){
|
angular.forEach(scope.cbModel, function(v,k){
|
||||||
if (v)
|
if (v) {
|
||||||
val.push(k);
|
val.push(k);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (val.length>0){
|
if (val.length>0){
|
||||||
scope.ngModel.value = val;
|
scope.ngModel.value = val;
|
||||||
|
|||||||
@@ -425,10 +425,11 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
|
|||||||
list.iterator + ".id }}\" ng-click=\"toggle_" + list.iterator + "(" + list.iterator + ".id, true)\" ng-value=\"1\" " +
|
list.iterator + ".id }}\" ng-click=\"toggle_" + list.iterator + "(" + list.iterator + ".id, true)\" ng-value=\"1\" " +
|
||||||
"ng-false-value=\"0\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
|
"ng-false-value=\"0\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
|
||||||
}
|
}
|
||||||
else // its assumed that options.input_type = checkbox
|
else { // its assumed that options.input_type = checkbox
|
||||||
html += "<td><input type=\"checkbox\" ng-model=\"" + list.iterator + ".checked\" name=\"check_{{" +
|
html += "<td><input type=\"checkbox\" ng-model=\"" + list.iterator + ".checked\" name=\"check_{{" +
|
||||||
list.iterator + ".id }}\" ng-click=\"toggle_" + list.iterator + "(" + list.iterator + ".id, true)\" ng-true-value=\"1\" " +
|
list.iterator + ".id }}\" ng-click=\"toggle_" + list.iterator + "(" + list.iterator + ".id, true)\" ng-true-value=\"1\" " +
|
||||||
"ng-false-value=\"0\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
|
"ng-false-value=\"0\" id=\"check_{{" + list.iterator + ".id}}\" /></td>";
|
||||||
|
}
|
||||||
} else if ((options.mode === 'edit' || options.mode === 'summary') && list.fieldActions) {
|
} else if ((options.mode === 'edit' || options.mode === 'summary') && list.fieldActions) {
|
||||||
|
|
||||||
// Row level actions
|
// Row level actions
|
||||||
|
|||||||
@@ -63,14 +63,16 @@ angular.module('PromptDialog', ['Utilities'])
|
|||||||
|
|
||||||
focus = function() {
|
focus = function() {
|
||||||
var focusableElement = focusableChildren[currentIndex];
|
var focusableElement = focusableChildren[currentIndex];
|
||||||
if (focusableElement)
|
if (focusableElement) {
|
||||||
focusableElement.focus();
|
focusableElement.focus();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
focusPrevious = function () {
|
focusPrevious = function () {
|
||||||
currentIndex--;
|
currentIndex--;
|
||||||
if (currentIndex < 0)
|
if (currentIndex < 0) {
|
||||||
currentIndex = numElements - 1;
|
currentIndex = numElements - 1;
|
||||||
|
}
|
||||||
|
|
||||||
focus();
|
focus();
|
||||||
|
|
||||||
@@ -79,8 +81,9 @@ angular.module('PromptDialog', ['Utilities'])
|
|||||||
|
|
||||||
focusNext = function () {
|
focusNext = function () {
|
||||||
currentIndex++;
|
currentIndex++;
|
||||||
if (currentIndex >= numElements)
|
if (currentIndex >= numElements) {
|
||||||
currentIndex = 0;
|
currentIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
focus();
|
focus();
|
||||||
|
|
||||||
@@ -118,4 +121,4 @@ angular.module('PromptDialog', ['Utilities'])
|
|||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user