mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 15:27:47 -02:30
Fixed jshint errors
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* jshint unused: vars */
|
/* jshint unused: vars */
|
||||||
export default ['$compile','templateUrl', 'i18n', 'generateList',
|
export default ['$compile','templateUrl', 'i18n', 'generateList',
|
||||||
'ProjectList', 'TemplateList', 'InventoryList', 'CredentialList',
|
'ProjectList', 'TemplateList', 'InventoryList', 'CredentialList',
|
||||||
function($compile, templateUrl, i18n, generateList,
|
function($compile, templateUrl, i18n, generateList,
|
||||||
ProjectList, TemplateList, InventoryList, CredentialList) {
|
ProjectList, TemplateList, InventoryList, CredentialList) {
|
||||||
@@ -71,7 +71,7 @@ export default ['$compile','templateUrl', 'i18n', 'generateList',
|
|||||||
|
|
||||||
case 'workflow_templates':
|
case 'workflow_templates':
|
||||||
list.name = 'workflow_templates';
|
list.name = 'workflow_templates';
|
||||||
list.iterator = 'workflow_template',
|
list.iterator = 'workflow_template';
|
||||||
list.basePath = 'workflow_job_templates';
|
list.basePath = 'workflow_job_templates';
|
||||||
list.fields = {
|
list.fields = {
|
||||||
name: list.fields.name,
|
name: list.fields.name,
|
||||||
@@ -114,7 +114,7 @@ export default ['$compile','templateUrl', 'i18n', 'generateList',
|
|||||||
// section 1 and section 2 elements produce sibling scopes
|
// section 1 and section 2 elements produce sibling scopes
|
||||||
// This means events propogated from section 2 are not received in section 1
|
// 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
|
// 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});
|
deselectedIdx = _.findIndex(multiselect_scope[type], {id: resource.id});
|
||||||
multiselect_scope[type][deselectedIdx].isSelected = false;
|
multiselect_scope[type][deselectedIdx].isSelected = false;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
* Controller for handling permissions adding
|
* 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) {
|
function(rootScope, scope, $state, i18n, CreateSelect2, GetBasePath, Rest, $q, Wait, ProcessErrors) {
|
||||||
|
|
||||||
init();
|
init();
|
||||||
@@ -51,7 +51,7 @@ function(rootScope, scope, $state, i18n, CreateSelect2, GetBasePath, Rest, $q, W
|
|||||||
/*
|
/*
|
||||||
<div ng-repeat="(type, roleSet) in keys">
|
<div ng-repeat="(type, roleSet) in keys">
|
||||||
<select
|
<select
|
||||||
ng-show="tab[type]"
|
ng-show="tab[type]"
|
||||||
id="{{type}}-role-select" class="form-control"
|
id="{{type}}-role-select" class="form-control"
|
||||||
ng-model="roleSelection[type]"
|
ng-model="roleSelection[type]"
|
||||||
ng-options="value.name for (key , value) in roleSet">
|
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
|
// aggregate name/descriptions for each available role, based on resource type
|
||||||
// reasoning:
|
// reasoning:
|
||||||
function aggregateKey(item, type){
|
function aggregateKey(item, type){
|
||||||
_.merge(scope.keys[type], _.omit(item.summary_fields.object_roles, 'read_role'));
|
_.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');
|
//Wait('start');
|
||||||
|
|
||||||
// builds an array of role entities to apply to current user or team
|
// 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 _.map(resources, (resource) => {
|
||||||
return resource.summary_fields.object_roles[scope.roleSelection[type]]
|
return resource.summary_fields.object_roles[scope.roleSelection[type]];
|
||||||
});
|
});
|
||||||
}).flattenDeep().value();
|
}).flattenDeep().value();
|
||||||
|
|
||||||
Rest.setUrl(scope.owner.related.roles);
|
Rest.setUrl(scope.owner.related.roles);
|
||||||
|
|
||||||
$q.all( _.map(roles, (entity) => Rest.post({id: entity.id})) )
|
$q.all( _.map(roles, (entity) => Rest.post({id: entity.id})) )
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* jshint unused: vars */
|
/* jshint unused: vars */
|
||||||
export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateList', 'ProjectList',
|
export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateList', 'ProjectList',
|
||||||
'InventoryList', 'CredentialList', '$compile', 'generateList', 'GetBasePath', 'SelectionInit',
|
'InventoryList', 'CredentialList', '$compile', 'generateList', 'GetBasePath', 'SelectionInit',
|
||||||
function(addPermissionsTeamsList, addPermissionsUsersList, TemplateList, ProjectList,
|
function(addPermissionsTeamsList, addPermissionsUsersList, TemplateList, ProjectList,
|
||||||
InventoryList, CredentialList, $compile, generateList, GetBasePath, SelectionInit) {
|
InventoryList, CredentialList, $compile, generateList, GetBasePath, SelectionInit) {
|
||||||
return {
|
return {
|
||||||
@@ -21,7 +21,7 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL
|
|||||||
let listMap, list, list_html;
|
let listMap, list, list_html;
|
||||||
|
|
||||||
listMap = {
|
listMap = {
|
||||||
Teams: addPermissionsTeamsList,
|
Teams: addPermissionsTeamsList,
|
||||||
Users: addPermissionsUsersList,
|
Users: addPermissionsUsersList,
|
||||||
Projects: ProjectList,
|
Projects: ProjectList,
|
||||||
JobTemplates: TemplateList,
|
JobTemplates: TemplateList,
|
||||||
@@ -63,7 +63,7 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL
|
|||||||
|
|
||||||
case 'WorkflowTemplates':
|
case 'WorkflowTemplates':
|
||||||
list.name = 'workflow_templates';
|
list.name = 'workflow_templates';
|
||||||
list.iterator = 'workflow_template',
|
list.iterator = 'workflow_template';
|
||||||
list.basePath = 'workflow_job_templates';
|
list.basePath = 'workflow_job_templates';
|
||||||
list.fields = {
|
list.fields = {
|
||||||
name: list.fields.name,
|
name: list.fields.name,
|
||||||
@@ -75,14 +75,14 @@ export default ['addPermissionsTeamsList', 'addPermissionsUsersList', 'TemplateL
|
|||||||
username: list.fields.username,
|
username: list.fields.username,
|
||||||
first_name: list.fields.first_name,
|
first_name: list.fields.first_name,
|
||||||
last_name: list.fields.last_name
|
last_name: list.fields.last_name
|
||||||
}
|
};
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
list.fields = {
|
list.fields = {
|
||||||
name: list.fields.name,
|
name: list.fields.name,
|
||||||
description: list.fields.description
|
description: list.fields.description
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
list_html = generateList.build({
|
list_html = generateList.build({
|
||||||
mode: 'edit',
|
mode: 'edit',
|
||||||
|
|||||||
@@ -119,7 +119,6 @@ export default
|
|||||||
iterator: 'role',
|
iterator: 'role',
|
||||||
open: false,
|
open: false,
|
||||||
index: false,
|
index: false,
|
||||||
actions: {},
|
|
||||||
emptyListText: i18n._('No permissions have been granted'),
|
emptyListText: i18n._('No permissions have been granted'),
|
||||||
fields: {
|
fields: {
|
||||||
name: {
|
name: {
|
||||||
@@ -159,7 +158,7 @@ export default
|
|||||||
buttonContent: '+ ' + i18n._('ADD PERMISSIONS'),
|
buttonContent: '+ ' + i18n._('ADD PERMISSIONS'),
|
||||||
ngShow: '(puser_obj.summary_fields.user_capabilities.edit || canAdd)'
|
ngShow: '(puser_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};}]); //InventoryForm
|
};}]); //InventoryForm
|
||||||
|
|||||||
Reference in New Issue
Block a user