mirror of
https://github.com/ansible/awx.git
synced 2026-01-29 15:24:42 -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: {
|
related: {
|
||||||
permissions: {
|
permissions: {
|
||||||
|
name: 'permissions',
|
||||||
disabled: '(organization === undefined ? true : false)',
|
disabled: '(organization === undefined ? true : false)',
|
||||||
// Do not transition the state if organization is undefined
|
// Do not transition the state if organization is undefined
|
||||||
ngClick: `(organization === undefined ? true : false)||$state.go('credentials.edit.permissions')`,
|
ngClick: `(organization === undefined ? true : false)||$state.go('credentials.edit.permissions')`,
|
||||||
@ -460,25 +461,16 @@ export default
|
|||||||
role: {
|
role: {
|
||||||
label: i18n._('Role'),
|
label: i18n._('Role'),
|
||||||
type: 'role',
|
type: 'role',
|
||||||
noSort: true,
|
nosort: true,
|
||||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
||||||
},
|
},
|
||||||
team_roles: {
|
team_roles: {
|
||||||
label: i18n._('Team Roles'),
|
label: i18n._('Team Roles'),
|
||||||
type: 'team_roles',
|
type: 'team_roles',
|
||||||
noSort: true,
|
nosort: true,
|
||||||
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4'
|
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": {
|
"notifications": {
|
||||||
include: "NotificationsList"
|
include: "NotificationsList"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
relatedSets: function() {
|
|
||||||
return {
|
|
||||||
notifications: {
|
|
||||||
iterator: 'notification',
|
|
||||||
url: 'api/v1/notification_templates/'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
@ -88,6 +88,7 @@ angular.module('InventoryFormDefinition', [])
|
|||||||
},
|
},
|
||||||
related: {
|
related: {
|
||||||
permissions: {
|
permissions: {
|
||||||
|
name: 'permissions',
|
||||||
awToolTip: i18n._('Please save before assigning permissions'),
|
awToolTip: i18n._('Please save before assigning permissions'),
|
||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
basePath: 'api/v1/inventories/{{$stateParams.inventory_id}}/access_list/',
|
basePath: 'api/v1/inventories/{{$stateParams.inventory_id}}/access_list/',
|
||||||
@ -119,66 +120,17 @@ angular.module('InventoryFormDefinition', [])
|
|||||||
role: {
|
role: {
|
||||||
label: i18n._('Role'),
|
label: i18n._('Role'),
|
||||||
type: 'role',
|
type: 'role',
|
||||||
noSort: true,
|
nosort: true,
|
||||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4',
|
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4',
|
||||||
},
|
},
|
||||||
team_roles: {
|
team_roles: {
|
||||||
label: i18n._('Team Roles'),
|
label: i18n._('Team Roles'),
|
||||||
type: 'team_roles',
|
type: 'team_roles',
|
||||||
noSort: true,
|
nosort: true,
|
||||||
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4',
|
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"
|
include: "CompletedJobsList"
|
||||||
},
|
},
|
||||||
permissions: {
|
permissions: {
|
||||||
|
name: 'permissions',
|
||||||
awToolTip: i18n._('Please save before assigning permissions'),
|
awToolTip: i18n._('Please save before assigning permissions'),
|
||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
basePath: 'api/v1/job_templates/{{$stateParams.job_template_id}}/access_list/',
|
basePath: 'api/v1/job_templates/{{$stateParams.job_template_id}}/access_list/',
|
||||||
@ -439,13 +440,13 @@ export default
|
|||||||
role: {
|
role: {
|
||||||
label: 'Role',
|
label: 'Role',
|
||||||
type: 'role',
|
type: 'role',
|
||||||
noSort: true,
|
nosort: true,
|
||||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4',
|
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4',
|
||||||
},
|
},
|
||||||
team_roles: {
|
team_roles: {
|
||||||
label: 'Team Roles',
|
label: 'Team Roles',
|
||||||
type: 'team_roles',
|
type: 'team_roles',
|
||||||
noSort: true,
|
nosort: true,
|
||||||
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4',
|
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -479,23 +480,6 @@ export default
|
|||||||
label: i18n._('Edit Survey'),
|
label: i18n._('Edit Survey'),
|
||||||
class: 'Form-primaryButton'
|
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: {
|
related: {
|
||||||
permissions: {
|
permissions: {
|
||||||
|
name: 'permissions',
|
||||||
awToolTip: i18n._('Please save before assigning permissions'),
|
awToolTip: i18n._('Please save before assigning permissions'),
|
||||||
basePath: 'api/v1/organizations/{{$stateParams.organization_id}}/access_list/',
|
basePath: 'api/v1/organizations/{{$stateParams.organization_id}}/access_list/',
|
||||||
search: {
|
search: {
|
||||||
@ -87,13 +88,13 @@ export default
|
|||||||
role: {
|
role: {
|
||||||
label: i18n._('Role'),
|
label: i18n._('Role'),
|
||||||
type: 'role',
|
type: 'role',
|
||||||
noSort: true,
|
nosort: true,
|
||||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
||||||
},
|
},
|
||||||
team_roles: {
|
team_roles: {
|
||||||
label: i18n._('Team Roles'),
|
label: i18n._('Team Roles'),
|
||||||
type: 'team_roles',
|
type: 'team_roles',
|
||||||
noSort: true,
|
nosort: true,
|
||||||
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4'
|
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: {
|
related: {
|
||||||
permissions: {
|
permissions: {
|
||||||
|
name: 'permissions',
|
||||||
awToolTip: i18n._('Please save before assigning permissions'),
|
awToolTip: i18n._('Please save before assigning permissions'),
|
||||||
djangoModel: 'access_list',
|
djangoModel: 'access_list',
|
||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
@ -248,13 +249,13 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
role: {
|
role: {
|
||||||
label: i18n._('Role'),
|
label: i18n._('Role'),
|
||||||
type: 'role',
|
type: 'role',
|
||||||
noSort: true,
|
nosort: true,
|
||||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4',
|
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4',
|
||||||
},
|
},
|
||||||
team_roles: {
|
team_roles: {
|
||||||
label: i18n._('Team Roles'),
|
label: i18n._('Team Roles'),
|
||||||
type: 'team_roles',
|
type: 'team_roles',
|
||||||
noSort: true,
|
nosort: true,
|
||||||
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4',
|
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -262,19 +263,6 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
notifications: {
|
notifications: {
|
||||||
include: "NotificationsList",
|
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: {
|
role: {
|
||||||
label: i18n._('Role'),
|
label: i18n._('Role'),
|
||||||
type: 'role',
|
type: 'role',
|
||||||
noSort: true,
|
nosort: true,
|
||||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
permissions: {
|
permissions: {
|
||||||
|
name: 'permissions',
|
||||||
basePath: 'api/v1/teams/{{$stateParams.team_id}}/roles/',
|
basePath: 'api/v1/teams/{{$stateParams.team_id}}/roles/',
|
||||||
search: {
|
search: {
|
||||||
page_size: '10',
|
page_size: '10',
|
||||||
@ -123,17 +124,17 @@ export default
|
|||||||
label: i18n._('Name'),
|
label: i18n._('Name'),
|
||||||
ngBind: 'permission.summary_fields.resource_name',
|
ngBind: 'permission.summary_fields.resource_name',
|
||||||
linkTo: '{{convertApiUrl(permission.related[permission.summary_fields.resource_type])}}',
|
linkTo: '{{convertApiUrl(permission.related[permission.summary_fields.resource_type])}}',
|
||||||
noSort: true
|
nosort: true
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
label: i18n._('Type'),
|
label: i18n._('Type'),
|
||||||
ngBind: 'permission.summary_fields.resource_type_display_name',
|
ngBind: 'permission.summary_fields.resource_type_display_name',
|
||||||
noSort: true
|
nosort: true
|
||||||
},
|
},
|
||||||
role: {
|
role: {
|
||||||
label: i18n._('Role'),
|
label: i18n._('Role'),
|
||||||
ngBind: 'permission.name',
|
ngBind: 'permission.name',
|
||||||
noSort: true
|
nosort: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fieldActions: {
|
fieldActions: {
|
||||||
|
|||||||
@ -171,6 +171,7 @@ export default
|
|||||||
//hideOnSuperuser: true // RBAC defunct
|
//hideOnSuperuser: true // RBAC defunct
|
||||||
},
|
},
|
||||||
permissions: {
|
permissions: {
|
||||||
|
name: 'permissions',
|
||||||
basePath: 'api/v1/users/{{$stateParams.user_id}}/roles/',
|
basePath: 'api/v1/users/{{$stateParams.user_id}}/roles/',
|
||||||
search: {
|
search: {
|
||||||
page_size: '10',
|
page_size: '10',
|
||||||
@ -190,17 +191,17 @@ export default
|
|||||||
label: i18n._('Name'),
|
label: i18n._('Name'),
|
||||||
ngBind: 'permission.summary_fields.resource_name',
|
ngBind: 'permission.summary_fields.resource_name',
|
||||||
linkTo: '{{convertApiUrl(permission.related[permission.summary_fields.resource_type])}}',
|
linkTo: '{{convertApiUrl(permission.related[permission.summary_fields.resource_type])}}',
|
||||||
noSort: true
|
nosort: true
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
label: i18n._('Type'),
|
label: i18n._('Type'),
|
||||||
ngBind: 'permission.summary_fields.resource_type_display_name',
|
ngBind: 'permission.summary_fields.resource_type_display_name',
|
||||||
noSort: true
|
nosort: true
|
||||||
},
|
},
|
||||||
role: {
|
role: {
|
||||||
label: i18n._('Role'),
|
label: i18n._('Role'),
|
||||||
ngBind: 'permission.name',
|
ngBind: 'permission.name',
|
||||||
noSort: true
|
nosort: true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
|||||||
@ -106,6 +106,7 @@ export default
|
|||||||
|
|
||||||
related: {
|
related: {
|
||||||
permissions: {
|
permissions: {
|
||||||
|
name: 'permissions',
|
||||||
awToolTip: i18n._('Please save before assigning permissions'),
|
awToolTip: i18n._('Please save before assigning permissions'),
|
||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
basePath: 'api/v1/workflow_job_templates/{{$stateParams.workflow_job_template_id}}/access_list/',
|
basePath: 'api/v1/workflow_job_templates/{{$stateParams.workflow_job_template_id}}/access_list/',
|
||||||
@ -139,13 +140,13 @@ export default
|
|||||||
role: {
|
role: {
|
||||||
label: i18n._('Role'),
|
label: i18n._('Role'),
|
||||||
type: 'role',
|
type: 'role',
|
||||||
noSort: true,
|
nosort: true,
|
||||||
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4',
|
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4',
|
||||||
},
|
},
|
||||||
team_roles: {
|
team_roles: {
|
||||||
label: i18n._('Team Roles'),
|
label: i18n._('Team Roles'),
|
||||||
type: 'team_roles',
|
type: 'team_roles',
|
||||||
noSort: true,
|
nosort: true,
|
||||||
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4',
|
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -187,19 +188,6 @@ export default
|
|||||||
label: i18n._('Workflow Editor'),
|
label: i18n._('Workflow Editor'),
|
||||||
class: 'Form-primaryButton'
|
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,
|
// loadingFinishedCount = 0,
|
||||||
// base = $location.path().replace(/^\//, '').split('/')[0],
|
// base = $location.path().replace(/^\//, '').split('/')[0],
|
||||||
master = {},
|
master = {},
|
||||||
id = $stateParams.job_template_id,
|
id = $stateParams.job_template_id;
|
||||||
relatedSets = {};
|
|
||||||
// checkSCMStatus, getPlaybooks, callback,
|
// checkSCMStatus, getPlaybooks, callback,
|
||||||
// choicesCount = 0;
|
// choicesCount = 0;
|
||||||
|
|
||||||
@ -144,8 +143,6 @@ angular.module('JobTemplatesHelper', ['Utilities'])
|
|||||||
scope.ask_credential_on_launch = (data.ask_credential_on_launch) ? true : false;
|
scope.ask_credential_on_launch = (data.ask_credential_on_launch) ? true : false;
|
||||||
master.ask_credential_on_launch = scope.ask_credential_on_launch;
|
master.ask_credential_on_launch = scope.ask_credential_on_launch;
|
||||||
|
|
||||||
relatedSets = form.relatedSets(data.related);
|
|
||||||
|
|
||||||
if (data.host_config_key) {
|
if (data.host_config_key) {
|
||||||
scope.example_config_key = data.host_config_key;
|
scope.example_config_key = data.host_config_key;
|
||||||
}
|
}
|
||||||
@ -163,7 +160,7 @@ angular.module('JobTemplatesHelper', ['Utilities'])
|
|||||||
scope.resetProjectToDefault();
|
scope.resetProjectToDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.$emit('jobTemplateLoaded', data.related.cloud_credential, master, relatedSets);
|
scope.$emit('jobTemplateLoaded', data.related.cloud_credential, master);
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors(scope, data, status, form, {
|
ProcessErrors(scope, data, status, form, {
|
||||||
|
|||||||
@ -78,6 +78,7 @@ function InventoriesEdit($scope, $rootScope, $compile, $location,
|
|||||||
});
|
});
|
||||||
|
|
||||||
$scope.inventory_obj = data;
|
$scope.inventory_obj = data;
|
||||||
|
$scope.name = data.name;
|
||||||
|
|
||||||
$scope.$emit('inventoryLoaded');
|
$scope.$emit('inventoryLoaded');
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1900,6 +1900,9 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
|||||||
for (fld in collection.fields) {
|
for (fld in collection.fields) {
|
||||||
html += `<th class="List-tableHeader list-header ${collection.fields[fld].columnClass}"
|
html += `<th class="List-tableHeader list-header ${collection.fields[fld].columnClass}"
|
||||||
id="${collection.iterator}-${fld}-header"
|
id="${collection.iterator}-${fld}-header"
|
||||||
|
base-path="${collection.basePath}"
|
||||||
|
collection="${collection.name}"
|
||||||
|
dataset="${collection.iterator}_dataset"
|
||||||
column-sort
|
column-sort
|
||||||
column-field="${fld}"
|
column-field="${fld}"
|
||||||
column-iterator="${collection.iterator}"
|
column-iterator="${collection.iterator}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user