Repository navigation
Sort invite roles list by application display name - #357
Merged
Merged
Conversation
johanib
reviewed
Oct 1, 2026
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.
# 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
If applied, this commit will make sortByApplicationDisplayName return a new sorted InviteRoleList instead of mutating the existing one. Why is this change needed? Prior to this change, sortByApplicationDisplayName mutated the InviteRoleList value object in place, which is unexpected for a value object and made the method harder to reason about and test. How does it address the issue? This change makes sortByApplicationDisplayName a pure function: it copies the roles, sorts the copy, and returns a new InviteRoleList built through the constructor, leaving the original instance untouched. The controller and tests are updated to use the returned list. Provide links to any relevant tickets, articles or other resources Addresses review feedback on PR #357.
kayjoosten
force-pushed
the
343-sort-invite-roles
branch
from
October 19, 2026 07:47
7e08e00 to
91e281b
Compare
johanib
approved these changes
Oct 20, 2026
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