Sort invite roles list by application display name - #357
Open
kayjoosten wants to merge 3 commits into
Open
kayjoosten wants to merge 3 commits into
kayjoosten wants to merge 3 commits into
Conversation
# If applied, this commit will... Sort the list of roles shown on the invite-roles page by application display name. # Why is this change needed? Prior to this change, the list of invite roles shown under /invite-roles was not sorted. Every request could return the roles in a different order, making the menu feel unpredictable and hard to scan. # How does it address the issue? This change adds a sortByApplicationDisplayName method to InviteRoleList that orders roles alphabetically and case insensitively by their application display name, falling back to the role name when a role has no applications. The InviteRolesController now sorts the list using the current locale before rendering it, matching the approach already used for the my-services overview. # Provide links to any relevant tickets, articles or other resources Closes #343
johanib
reviewed
Oct 1, 2026
| * Sorts the roles alphabetically (case-insensitively) by the display name of their | ||
| * first application, falling back to the role name for roles without applications. | ||
| */ | ||
| public function sortByApplicationDisplayName( |
Contributor
There was a problem hiding this comment.
Consideration: This currently changes the value of the value object.
I think it would be nicer if the initializeWith cals this function. That has two advantages: The value object state does not need to be changed anymore (one could argue that if the state needs to be changed it is not valid in the first place). And 2, the sortByApplicationDisplayName can become a pure function.
johanib
requested changes
Oct 1, 2026
johanib
left a comment
Contributor
There was a problem hiding this comment.
If point below is fixed, please merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The list of invite roles shown under
/invite-roleswas not sorted, so every visit could show the roles in a different, unpredictable order.Changes
InviteRoleList::sortByApplicationDisplayName(string $locale), which sorts roles alphabetically (case insensitively) by their application display name, falling back to the role name for roles without applications. This mirrors the sorting approach already used for/my-services.InviteRolesControllerto sort the list using the current locale before rendering.Testing
Ran the full QA suite locally (
composer check): composer-validate, phplint, phpmd, phpcs, license-headers, phpunit (147 tests, 281 assertions), phpstan. All green.Closes #343