Skip to content

Order users by Redmine's display name format - #46

Merged
mboremski merged 2 commits into
xmera-circle:developfrom
mboremski:feature/reorder-user-list
Aug 27, 2026
Merged

Order users by Redmine's display name format#46
mboremski merged 2 commits into
xmera-circle:developfrom
mboremski:feature/reorder-user-list

Conversation

@mboremski

Copy link
Copy Markdown
Collaborator

Fixes #2

The user list was always sorted by last name, regardless of the 'Users display format' setting. On an installation showing 'Firstname Lastname' the list therefore looked unsorted to the people reading it.

Sort by the name as Redmine renders it instead. The key lives in RedmineWorkload::WlUserSorting because two call sites need it:

  • WlUserSelection#allowed_to_display -- the filter's user list
  • GroupWorkload#sorted_user_workload -- the rows of the workload table. The class name stays the first element of the key, so GroupUserDummy still comes before the real users.

GroupUserDummy aliases name to lastname and delegates id to its group, so it works with the same key.

The test asserts the order flips between 'lastname_comma_firstname' and 'firstname_lastname'. It builds a fresh selection inside each with_settings block, because User#name memoizes and would otherwise serve the name from before the setting changed.

Thank you very much for your contribution! We highly appreciate that.

Please compare your branch with the develop branch of this repository.

Fixes #2

The user list was always sorted by last name, regardless of the 'Users
display format' setting. On an installation showing 'Firstname Lastname'
the list therefore looked unsorted to the people reading it.

Sort by the name as Redmine renders it instead. The key lives in
RedmineWorkload::WlUserSorting because two call sites need it:

* WlUserSelection#allowed_to_display -- the filter's user list
* GroupWorkload#sorted_user_workload -- the rows of the workload table.
  The class name stays the first element of the key, so GroupUserDummy
  still comes before the real users.

GroupUserDummy aliases name to lastname and delegates id to its group, so
it works with the same key.

The test asserts the order flips between 'lastname_comma_firstname' and
'firstname_lastname'. It builds a fresh selection inside each
with_settings block, because User#name memoizes and would otherwise serve
the name from before the setting changed.
@mboremski mboremski self-assigned this Aug 27, 2026
@mboremski
mboremski merged commit 7263104 into xmera-circle:develop Aug 27, 2026
3 checks passed
@mboremski
mboremski deleted the feature/reorder-user-list branch August 27, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant