mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 14:39:30 -02:30
Merge pull request #1987 from anoek/1986
Split permissions list into two columns
This commit is contained in:
@@ -4,7 +4,7 @@ export default
|
|||||||
function(templateUrl) {
|
function(templateUrl) {
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
scope: false,
|
scope: true,
|
||||||
templateUrl: templateUrl('access/roleList'),
|
templateUrl: templateUrl('access/roleList'),
|
||||||
link: function(scope, element, attrs) {
|
link: function(scope, element, attrs) {
|
||||||
// given a list of roles (things like "project
|
// given a list of roles (things like "project
|
||||||
@@ -13,16 +13,19 @@ export default
|
|||||||
// concatenated/sorted list
|
// concatenated/sorted list
|
||||||
scope.access_list = []
|
scope.access_list = []
|
||||||
.concat(scope.permission.summary_fields
|
.concat(scope.permission.summary_fields
|
||||||
.direct_access.map(function(i) {
|
.direct_access.map((i) => {
|
||||||
i.role.explicit = true;
|
i.role.explicit = true;
|
||||||
return i.role;
|
return i.role;
|
||||||
}))
|
}))
|
||||||
.concat(scope.permission.summary_fields
|
.concat(scope.permission.summary_fields
|
||||||
.indirect_access.map(function(i) {
|
.indirect_access.map((i) => {
|
||||||
i.role.explicit = false;
|
i.role.explicit = false;
|
||||||
return i.role;
|
return i.role;
|
||||||
}))
|
}))
|
||||||
.sort(function(a, b) {
|
.filter((role) => {
|
||||||
|
return !!attrs.teamRoleList == !!role.team_id;
|
||||||
|
})
|
||||||
|
.sort((a, b) => {
|
||||||
if (a.name
|
if (a.name
|
||||||
.toLowerCase() > b.name
|
.toLowerCase() > b.name
|
||||||
.toLowerCase()) {
|
.toLowerCase()) {
|
||||||
|
|||||||
@@ -448,7 +448,13 @@ export default
|
|||||||
label: 'Role',
|
label: 'Role',
|
||||||
type: 'role',
|
type: 'role',
|
||||||
noSort: true,
|
noSort: true,
|
||||||
class: 'col-lg-9 col-md-9 col-sm-9 col-xs-8'
|
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
||||||
|
},
|
||||||
|
team_roles: {
|
||||||
|
label: 'Team Roles',
|
||||||
|
type: 'team_roles',
|
||||||
|
noSort: true,
|
||||||
|
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,7 +185,13 @@ export default
|
|||||||
label: 'Role',
|
label: 'Role',
|
||||||
type: 'role',
|
type: 'role',
|
||||||
noSort: true,
|
noSort: true,
|
||||||
class: 'col-lg-9 col-md-9 col-sm-9 col-xs-8'
|
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
||||||
|
},
|
||||||
|
team_roles: {
|
||||||
|
label: 'Team Roles',
|
||||||
|
type: 'team_roles',
|
||||||
|
noSort: true,
|
||||||
|
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -364,7 +364,13 @@ export default
|
|||||||
label: 'Role',
|
label: 'Role',
|
||||||
type: 'role',
|
type: 'role',
|
||||||
noSort: true,
|
noSort: true,
|
||||||
class: 'col-lg-9 col-md-9 col-sm-9 col-xs-8'
|
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
||||||
|
},
|
||||||
|
team_roles: {
|
||||||
|
label: 'Team Roles',
|
||||||
|
type: 'team_roles',
|
||||||
|
noSort: true,
|
||||||
|
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -76,7 +76,13 @@ export default
|
|||||||
label: 'Role',
|
label: 'Role',
|
||||||
type: 'role',
|
type: 'role',
|
||||||
noSort: true,
|
noSort: true,
|
||||||
class: 'col-lg-9 col-md-9 col-sm-9 col-xs-8'
|
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
||||||
|
},
|
||||||
|
team_roles: {
|
||||||
|
label: 'Team Roles',
|
||||||
|
type: 'team_roles',
|
||||||
|
noSort: true,
|
||||||
|
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -262,7 +262,13 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
label: 'Role',
|
label: 'Role',
|
||||||
type: 'role',
|
type: 'role',
|
||||||
noSort: true,
|
noSort: true,
|
||||||
class: 'col-lg-9 col-md-9 col-sm-9 col-xs-8'
|
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
||||||
|
},
|
||||||
|
team_roles: {
|
||||||
|
label: 'Team Roles',
|
||||||
|
type: 'team_roles',
|
||||||
|
noSort: true,
|
||||||
|
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -90,7 +90,13 @@ export default
|
|||||||
label: 'Role',
|
label: 'Role',
|
||||||
type: 'role',
|
type: 'role',
|
||||||
noSort: true,
|
noSort: true,
|
||||||
class: 'col-lg-9 col-md-9 col-sm-9 col-xs-8'
|
class: 'col-lg-4 col-md-4 col-sm-4 col-xs-4'
|
||||||
|
},
|
||||||
|
team_roles: {
|
||||||
|
label: 'Team Roles',
|
||||||
|
type: 'team_roles',
|
||||||
|
noSort: true,
|
||||||
|
class: 'col-lg-5 col-md-5 col-sm-5 col-xs-4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -458,6 +458,15 @@ angular.module('GeneratorHelpers', [systemStatus.name])
|
|||||||
<td ${classList}>
|
<td ${classList}>
|
||||||
<role-list class=\"RoleList\">
|
<role-list class=\"RoleList\">
|
||||||
</role-list>
|
</role-list>
|
||||||
|
</td>
|
||||||
|
`;
|
||||||
|
} else if (field.type === 'team_roles') {
|
||||||
|
classList = (field.columnClass) ?
|
||||||
|
Attr(field, 'columnClass') : "";
|
||||||
|
html += `
|
||||||
|
<td ${classList}>
|
||||||
|
<role-list class=\"RoleList\" team-role-list="true">
|
||||||
|
</role-list>
|
||||||
</td>
|
</td>
|
||||||
`;
|
`;
|
||||||
} else if (field.type === 'labels') {
|
} else if (field.type === 'labels') {
|
||||||
|
|||||||
Reference in New Issue
Block a user