ocket8888 commented on a change in pull request #4196: TP: Provides the ability
to view all users for a given role
URL: https://github.com/apache/trafficcontrol/pull/4196#discussion_r375949871
##########
File path: traffic_portal/app/src/modules/private/roles/users/index.js
##########
@@ -30,8 +30,8 @@ module.exports =
angular.module('trafficPortal.private.roles.users', [])
roles:
function($stateParams, roleService) {
return
roleService.getRoles({ id: $stateParams.roleId });
},
- roleUsers:
function($stateParams, userService) {
- return
userService.getUsers({ roleId: $stateParams.roleId });
+ roleUsers:
function(roles, userService) {
+ return
userService.getUsers({ role: roles[0].name });
Review comment:
Well in a proper Angular test bed we'd be mocking up services like the API
so it doesn't depend on an actual, running instance of TO. But since we know
that this code is always running in a world where it's connected to a TO where
it's authenticated and users must have roles, we do know that the list of all
roles must not be empty.
So I guess if we have no immediate plans to remove the tests' dependency on
TO (and I don't think we do) then we can let this go.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services