Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x] Users Listing: Allow for configuring default sort field & direction #9671

Merged
merged 4 commits into from
Mar 7, 2024

Conversation

duncanmcclean
Copy link
Member

This pull request introduces two new config options to Statamic's users config file, allowing developers to configure the default sort field & direction for the Users Listing Table.

At the moment, users are returned in ascending order by their email. However, it's possible that developers may wish users to be ordered by other fields like last_login_at instead.

Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably also control the order of how the users tag sorts them too.

Right now it doesn't perform any default sort. It's just the order they are inserted into the Stache.

Having this generic config only control the control panel seems a bit odd.

You can set the default sort by adding a defaultOrderBy method to the Users.php tag class.

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.

None yet

2 participants