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

Fixes admin sorting on fields without a natural order #70

Merged

Conversation

mdesantis
Copy link
Contributor

Most of the fields that allow sorting in the admin have a natural
order (id, created_at, etc), so sorting on them asc/desc makes sense
and works. However, fields like "state" and "processing", will only
have no natural ordering and sorting on them will only group them
together. This is really stange when you're paginating because records
on page 2, can come back up on page 3.

This fixes that by adding a second ordering by id: :asc on those fields.

Most of the fields that allow sorting in the admin have a natural
order (id, created_at, etc), so sorting on them asc/desc makes sense
and works. However, fields like "state" and "processing", will only
have no natural ordering and sorting on them will only group them
together. This is really stange when you're paginating because records
on page 2, can come back up on page 3.

This fixes that by adding a second ordering by id: :asc on those fields.
Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

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

@mdesantis @seantaylor these changes look good to me, thank you 🍰

@mdesantis mdesantis merged commit 876f2b4 into solidusio:master Aug 2, 2019
@mdesantis mdesantis deleted the pr-29/seantaylor/fix/admin-sorting branch August 2, 2019 13:12
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.

2 participants