1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Fixed jshint errors

This commit is contained in:
Ken Hoes 2016-12-16 11:23:24 -05:00
parent 11a1ca987f
commit c8f1f11816
4 changed files with 16 additions and 17 deletions

View File

@ -5,7 +5,7 @@
*************************************************/
/* jshint unused: vars */
export default ['$compile','templateUrl', 'i18n', 'generateList',
export default ['$compile','templateUrl', 'i18n', 'generateList',
'ProjectList', 'TemplateList', 'InventoryList', 'CredentialList',
function($compile, templateUrl, i18n, generateList,
ProjectList, TemplateList, InventoryList, CredentialList) {
@ -71,7 +71,7 @@ export default ['$compile','templateUrl', 'i18n', 'generateList',
case 'workflow_templates':
list.name = 'workflow_templates';
list.iterator = 'workflow_template',
list.iterator = 'workflow_template';
list.basePath = 'workflow_job_templates';
list.fields = {
name: list.fields.name,
@ -114,7 +114,7 @@ export default ['$compile','templateUrl', 'i18n', 'generateList',
// section 1 and section 2 elements produce sibling scopes
// This means events propogated from section 2 are not received in section 1
// The following code directly accesses the right scope by list table id
multiselect_scope = angular.element('#AddPermissions-body').find(`#${type}_table`).scope()
multiselect_scope = angular.element('#AddPermissions-body').find(`#${type}_table`).scope();
deselectedIdx = _.findIndex(multiselect_scope[type], {id: resource.id});
multiselect_scope[type][deselectedIdx].isSelected = false;
};

View File

@ -11,7 +11,7 @@
* Controller for handling permissions adding
*/
export default ['$rootScope', '$scope', '$state', 'i18n', 'CreateSelect2', 'GetBasePath', 'Rest', '$q', 'Wait', 'ProcessErrors',
export default ['$rootScope', '$scope', '$state', 'i18n', 'CreateSelect2', 'GetBasePath', 'Rest', '$q', 'Wait', 'ProcessErrors',
function(rootScope, scope, $state, i18n, CreateSelect2, GetBasePath, Rest, $q, Wait, ProcessErrors) {
init();
@ -51,7 +51,7 @@ function(rootScope, scope, $state, i18n, CreateSelect2, GetBasePath, Rest, $q, W
/*
<div ng-repeat="(type, roleSet) in keys">
<select
ng-show="tab[type]"
ng-show="tab[type]"
id="{{type}}-role-select" class="form-control"
ng-model="roleSelection[type]"
ng-options="value.name for (key , value) in roleSet">
@ -75,7 +75,7 @@ function(rootScope, scope, $state, i18n, CreateSelect2, GetBasePath, Rest, $q, W
}
// aggregate name/descriptions for each available role, based on resource type
// reasoning:
// reasoning:
function aggregateKey(item, type){
_.merge(scope.keys[type], _.omit(item.summary_fields.object_roles, 'read_role'));
}
@ -126,12 +126,12 @@ function(rootScope, scope, $state, i18n, CreateSelect2, GetBasePath, Rest, $q, W
//Wait('start');
// builds an array of role entities to apply to current user or team
let roles = _(scope.selected).map( (resources, type) =>{
let roles = _(scope.selected).map( (resources, type) => {
return _.map(resources, (resource) => {
return resource.summary_fields.object_roles[scope.roleSelection[type]]
return resource.summary_fields.object_roles[scope.roleSelection[type]];
});
}).flattenDeep().value();
Rest.setUrl(scope.owner.related.roles);
$q.all( _.map(roles, (entity) => Rest.post({id: entity.id})) )

View File

@ -5,8 +5,8 @@
*************************************************/
/* jshint unused: vars */
export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateList', 'ProjectList',
'InventoryList', 'CredentialList', '$compile', 'generateList', 'GetBasePath', 'SelectionInit',
export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateList', 'ProjectList',
'InventoryList', 'CredentialList', '$compile', 'generateList', 'GetBasePath', 'SelectionInit',
function(addPermissionsTeamsList, addPermissionsUsersList, TemplateList, ProjectList,
InventoryList, CredentialList, $compile, generateList, GetBasePath, SelectionInit) {
return {
@ -21,7 +21,7 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL
let listMap, list, list_html;
listMap = {
Teams: addPermissionsTeamsList,
Teams: addPermissionsTeamsList,
Users: addPermissionsUsersList,
Projects: ProjectList,
JobTemplates: TemplateList,
@ -63,7 +63,7 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL
case 'WorkflowTemplates':
list.name = 'workflow_templates';
list.iterator = 'workflow_template',
list.iterator = 'workflow_template';
list.basePath = 'workflow_job_templates';
list.fields = {
name: list.fields.name,
@ -75,14 +75,14 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL
username: list.fields.username,
first_name: list.fields.first_name,
last_name: list.fields.last_name
}
};
break;
default:
list.fields = {
name: list.fields.name,
description: list.fields.description
};
}
}
list_html = generateList.build({
mode: 'edit',

View File

@ -119,7 +119,6 @@ export default
iterator: 'role',
open: false,
index: false,
actions: {},
emptyListText: i18n._('No permissions have been granted'),
fields: {
name: {
@ -159,7 +158,7 @@ export default
buttonContent: '&#43; ' + i18n._('ADD PERMISSIONS'),
ngShow: '(puser_obj.summary_fields.user_capabilities.edit || canAdd)'
}
}
}
}
},
};}]); //InventoryForm