mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
Merge pull request #5064 from mabashian/4782-permissions-lists
Fixed permissions list sorting across app
This commit is contained in:
commit
cf6dc42417
@ -424,6 +424,7 @@ export default
|
||||
|
||||
related: {
|
||||
permissions: {
|
||||
name: 'permissions',
|
||||
disabled: '(organization === undefined ? true : false)',
|
||||
// Do not transition the state if organization is undefined
|
||||
ngClick: `(organization === undefined ? true : false)||$state.go('credentials.edit.permissions')`,
|
||||
@ -460,25 +461,16 @@ export default
|
||||
role: {
|
||||
label: i18n._('Role'),
|
||||
type: 'role',
|
||||
noSort: true,
|
||||
nosort: true,
|
||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
||||
},
|
||||
team_roles: {
|
||||
label: i18n._('Team Roles'),
|
||||
type: 'team_roles',
|
||||
noSort: true,
|
||||
nosort: true,
|
||||
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
relatedSets: function(urls) {
|
||||
return {
|
||||
permissions: {
|
||||
iterator: 'permission',
|
||||
url: urls.access_list,
|
||||
}
|
||||
};
|
||||
}
|
||||
};}]);
|
||||
|
||||
@ -339,14 +339,6 @@ export default
|
||||
"notifications": {
|
||||
include: "NotificationsList"
|
||||
}
|
||||
},
|
||||
relatedSets: function() {
|
||||
return {
|
||||
notifications: {
|
||||
iterator: 'notification',
|
||||
url: 'api/v1/notification_templates/'
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
@ -88,6 +88,7 @@ angular.module('InventoryFormDefinition', [])
|
||||
},
|
||||
related: {
|
||||
permissions: {
|
||||
name: 'permissions',
|
||||
awToolTip: i18n._('Please save before assigning permissions'),
|
||||
dataPlacement: 'top',
|
||||
basePath: 'api/v1/inventories/{{$stateParams.inventory_id}}/access_list/',
|
||||
@ -119,66 +120,17 @@ angular.module('InventoryFormDefinition', [])
|
||||
role: {
|
||||
label: i18n._('Role'),
|
||||
type: 'role',
|
||||
noSort: true,
|
||||
nosort: true,
|
||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4',
|
||||
},
|
||||
team_roles: {
|
||||
label: i18n._('Team Roles'),
|
||||
type: 'team_roles',
|
||||
noSort: true,
|
||||
nosort: true,
|
||||
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4',
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
relatedSets: function() {
|
||||
return {
|
||||
permissions: {
|
||||
awToolTip: i18n._('Please save before assigning permissions'),
|
||||
dataPlacement: 'top',
|
||||
basePath: 'inventories/:id/access_list/',
|
||||
type: 'collection',
|
||||
title: i18n._('Permissions'),
|
||||
iterator: 'permission',
|
||||
index: false,
|
||||
open: false,
|
||||
searchType: 'select',
|
||||
actions: {
|
||||
add: {
|
||||
ngClick: "addPermission",
|
||||
label: i18n._('Add'),
|
||||
awToolTip: i18n._('Add a permission'),
|
||||
actionClass: 'btn List-buttonSubmit',
|
||||
buttonContent: '+ ' + i18n._('ADD'),
|
||||
ngShow: '(inventory_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||
}
|
||||
},
|
||||
|
||||
fields: {
|
||||
username: {
|
||||
key: true,
|
||||
label: i18n._('User'),
|
||||
linkBase: 'users',
|
||||
class: 'col-lg-3 col-md-3 col-sm-3 col-xs-4'
|
||||
},
|
||||
role: {
|
||||
label: i18n._('Role'),
|
||||
type: 'role',
|
||||
noSort: true,
|
||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4',
|
||||
noSearch: true
|
||||
},
|
||||
team_roles: {
|
||||
label: i18n._('Team Roles'),
|
||||
type: 'team_roles',
|
||||
noSort: true,
|
||||
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4',
|
||||
noSearch: true
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
};}]);
|
||||
|
||||
@ -406,6 +406,7 @@ export default
|
||||
include: "CompletedJobsList"
|
||||
},
|
||||
permissions: {
|
||||
name: 'permissions',
|
||||
awToolTip: i18n._('Please save before assigning permissions'),
|
||||
dataPlacement: 'top',
|
||||
basePath: 'api/v1/job_templates/{{$stateParams.job_template_id}}/access_list/',
|
||||
@ -439,13 +440,13 @@ export default
|
||||
role: {
|
||||
label: 'Role',
|
||||
type: 'role',
|
||||
noSort: true,
|
||||
nosort: true,
|
||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4',
|
||||
},
|
||||
team_roles: {
|
||||
label: 'Team Roles',
|
||||
type: 'team_roles',
|
||||
noSort: true,
|
||||
nosort: true,
|
||||
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4',
|
||||
}
|
||||
}
|
||||
@ -479,23 +480,6 @@ export default
|
||||
label: i18n._('Edit Survey'),
|
||||
class: 'Form-primaryButton'
|
||||
}
|
||||
},
|
||||
|
||||
relatedSets: function(urls) {
|
||||
return {
|
||||
completed_jobs: {
|
||||
iterator: 'completed_job',
|
||||
url: urls.jobs + '?or__status=successful&or__status=failed&or__status=error&or__status=canceled'
|
||||
},
|
||||
permissions: {
|
||||
iterator: 'permission',
|
||||
url: urls.access_list
|
||||
},
|
||||
notifications: {
|
||||
iterator: 'notification',
|
||||
url: '/api/v1/notification_templates/'
|
||||
}
|
||||
};
|
||||
}
|
||||
};}])
|
||||
|
||||
|
||||
@ -54,6 +54,7 @@ export default
|
||||
|
||||
related: {
|
||||
permissions: {
|
||||
name: 'permissions',
|
||||
awToolTip: i18n._('Please save before assigning permissions'),
|
||||
basePath: 'api/v1/organizations/{{$stateParams.organization_id}}/access_list/',
|
||||
search: {
|
||||
@ -87,13 +88,13 @@ export default
|
||||
role: {
|
||||
label: i18n._('Role'),
|
||||
type: 'role',
|
||||
noSort: true,
|
||||
nosort: true,
|
||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
||||
},
|
||||
team_roles: {
|
||||
label: i18n._('Team Roles'),
|
||||
type: 'team_roles',
|
||||
noSort: true,
|
||||
nosort: true,
|
||||
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4'
|
||||
}
|
||||
}
|
||||
@ -103,18 +104,6 @@ export default
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
relatedSets: function(urls) {
|
||||
return {
|
||||
permissions: {
|
||||
iterator: 'permission',
|
||||
url: urls.access_list
|
||||
},
|
||||
notifications: {
|
||||
iterator: 'notification',
|
||||
url: '/api/v1/notification_templates/'
|
||||
}
|
||||
};
|
||||
}
|
||||
};}])
|
||||
|
||||
|
||||
@ -216,6 +216,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
||||
|
||||
related: {
|
||||
permissions: {
|
||||
name: 'permissions',
|
||||
awToolTip: i18n._('Please save before assigning permissions'),
|
||||
djangoModel: 'access_list',
|
||||
dataPlacement: 'top',
|
||||
@ -248,13 +249,13 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
||||
role: {
|
||||
label: i18n._('Role'),
|
||||
type: 'role',
|
||||
noSort: true,
|
||||
nosort: true,
|
||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4',
|
||||
},
|
||||
team_roles: {
|
||||
label: i18n._('Team Roles'),
|
||||
type: 'team_roles',
|
||||
noSort: true,
|
||||
nosort: true,
|
||||
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4',
|
||||
}
|
||||
}
|
||||
@ -262,19 +263,6 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
||||
notifications: {
|
||||
include: "NotificationsList",
|
||||
}
|
||||
},
|
||||
|
||||
relatedSets: function(urls) {
|
||||
return {
|
||||
permissions: {
|
||||
iterator: 'permission',
|
||||
url: urls.access_list
|
||||
},
|
||||
notifications: {
|
||||
iterator: 'notification',
|
||||
url: '/api/v1/notification_templates/'
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
};}])
|
||||
|
||||
@ -97,12 +97,13 @@ export default
|
||||
role: {
|
||||
label: i18n._('Role'),
|
||||
type: 'role',
|
||||
noSort: true,
|
||||
nosort: true,
|
||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
||||
}
|
||||
}
|
||||
},
|
||||
permissions: {
|
||||
name: 'permissions',
|
||||
basePath: 'api/v1/teams/{{$stateParams.team_id}}/roles/',
|
||||
search: {
|
||||
page_size: '10',
|
||||
@ -123,17 +124,17 @@ export default
|
||||
label: i18n._('Name'),
|
||||
ngBind: 'permission.summary_fields.resource_name',
|
||||
linkTo: '{{convertApiUrl(permission.related[permission.summary_fields.resource_type])}}',
|
||||
noSort: true
|
||||
nosort: true
|
||||
},
|
||||
type: {
|
||||
label: i18n._('Type'),
|
||||
ngBind: 'permission.summary_fields.resource_type_display_name',
|
||||
noSort: true
|
||||
nosort: true
|
||||
},
|
||||
role: {
|
||||
label: i18n._('Role'),
|
||||
ngBind: 'permission.name',
|
||||
noSort: true
|
||||
nosort: true
|
||||
}
|
||||
},
|
||||
fieldActions: {
|
||||
|
||||
@ -171,6 +171,7 @@ export default
|
||||
//hideOnSuperuser: true // RBAC defunct
|
||||
},
|
||||
permissions: {
|
||||
name: 'permissions',
|
||||
basePath: 'api/v1/users/{{$stateParams.user_id}}/roles/',
|
||||
search: {
|
||||
page_size: '10',
|
||||
@ -190,17 +191,17 @@ export default
|
||||
label: i18n._('Name'),
|
||||
ngBind: 'permission.summary_fields.resource_name',
|
||||
linkTo: '{{convertApiUrl(permission.related[permission.summary_fields.resource_type])}}',
|
||||
noSort: true
|
||||
nosort: true
|
||||
},
|
||||
type: {
|
||||
label: i18n._('Type'),
|
||||
ngBind: 'permission.summary_fields.resource_type_display_name',
|
||||
noSort: true
|
||||
nosort: true
|
||||
},
|
||||
role: {
|
||||
label: i18n._('Role'),
|
||||
ngBind: 'permission.name',
|
||||
noSort: true
|
||||
nosort: true
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
|
||||
@ -106,6 +106,7 @@ export default
|
||||
|
||||
related: {
|
||||
permissions: {
|
||||
name: 'permissions',
|
||||
awToolTip: i18n._('Please save before assigning permissions'),
|
||||
dataPlacement: 'top',
|
||||
basePath: 'api/v1/workflow_job_templates/{{$stateParams.workflow_job_template_id}}/access_list/',
|
||||
@ -139,13 +140,13 @@ export default
|
||||
role: {
|
||||
label: i18n._('Role'),
|
||||
type: 'role',
|
||||
noSort: true,
|
||||
nosort: true,
|
||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4',
|
||||
},
|
||||
team_roles: {
|
||||
label: i18n._('Team Roles'),
|
||||
type: 'team_roles',
|
||||
noSort: true,
|
||||
nosort: true,
|
||||
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4',
|
||||
}
|
||||
}
|
||||
@ -187,19 +188,6 @@ export default
|
||||
label: i18n._('Workflow Editor'),
|
||||
class: 'Form-primaryButton'
|
||||
}
|
||||
},
|
||||
|
||||
relatedSets: function(urls) {
|
||||
return {
|
||||
permissions: {
|
||||
iterator: 'permission',
|
||||
url: urls.access_list
|
||||
},
|
||||
notifications: {
|
||||
iterator: 'notification',
|
||||
url: '/api/v1/notification_templates/'
|
||||
}
|
||||
};
|
||||
}
|
||||
};}])
|
||||
|
||||
|
||||
@ -31,8 +31,7 @@ angular.module('JobTemplatesHelper', ['Utilities'])
|
||||
// loadingFinishedCount = 0,
|
||||
// base = $location.path().replace(/^\//, '').split('/')[0],
|
||||
master = {},
|
||||
id = $stateParams.job_template_id,
|
||||
relatedSets = {};
|
||||
id = $stateParams.job_template_id;
|
||||
// checkSCMStatus, getPlaybooks, callback,
|
||||
// choicesCount = 0;
|
||||
|
||||
@ -144,8 +143,6 @@ angular.module('JobTemplatesHelper', ['Utilities'])
|
||||
scope.ask_credential_on_launch = (data.ask_credential_on_launch) ? true : false;
|
||||
master.ask_credential_on_launch = scope.ask_credential_on_launch;
|
||||
|
||||
relatedSets = form.relatedSets(data.related);
|
||||
|
||||
if (data.host_config_key) {
|
||||
scope.example_config_key = data.host_config_key;
|
||||
}
|
||||
@ -163,7 +160,7 @@ angular.module('JobTemplatesHelper', ['Utilities'])
|
||||
scope.resetProjectToDefault();
|
||||
}
|
||||
|
||||
scope.$emit('jobTemplateLoaded', data.related.cloud_credential, master, relatedSets);
|
||||
scope.$emit('jobTemplateLoaded', data.related.cloud_credential, master);
|
||||
})
|
||||
.error(function (data, status) {
|
||||
ProcessErrors(scope, data, status, form, {
|
||||
|
||||
@ -78,6 +78,7 @@ function InventoriesEdit($scope, $rootScope, $compile, $location,
|
||||
});
|
||||
|
||||
$scope.inventory_obj = data;
|
||||
$scope.name = data.name;
|
||||
|
||||
$scope.$emit('inventoryLoaded');
|
||||
})
|
||||
|
||||
@ -1900,6 +1900,9 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
||||
for (fld in collection.fields) {
|
||||
html += `<th class="List-tableHeader list-header ${collection.fields[fld].columnClass}"
|
||||
id="${collection.iterator}-${fld}-header"
|
||||
base-path="${collection.basePath}"
|
||||
collection="${collection.name}"
|
||||
dataset="${collection.iterator}_dataset"
|
||||
column-sort
|
||||
column-field="${fld}"
|
||||
column-iterator="${collection.iterator}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user