fix: show special roles at the end of the list#806
Conversation
|
Before caring about the tests, I'd love to know if this is matching the code standards 😼 |
I like the approach! Building two groups (normal and special) and then sorting those groups according to the weight prop sounds reasonable and gives us the expected result. 👍 |
kulmann
left a comment
There was a problem hiding this comment.
Code-wise this looks good to me.
rhafer
left a comment
There was a problem hiding this comment.
Sorry, but I am not really convinced that this approach is good. What exactly makes a role "special"? And even if we think they're somehow special, I don't think we should hardcode that somewhere deep in the code.
Roles already have weights for ordering them. We just set the weight to 0 everywhere and then try some clever sorting based on the number of permissions they grant. Maybe that is the wrong approach. Why not just initialize the weights correctly from the beginning and just sort by weights?
Same question here. Why do we override the backend weight? If something is wrong, we should change the weight in the backend. |
0861272 to
8cb3ff9
Compare
|
@tbsbdr can the gatekeeper give us their opinion I'd rather show |
|
I'd prefer the order like you propsed it. |
8cb3ff9 to
5599eb6
Compare
f8dcbe2 to
dce298e
Compare
dce298e to
211cd1d
Compare
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: