-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Added new enum-based sortBy query argument #2660
Conversation
🦋 Changeset is good to goLatest commit: 0da88ac We got this. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Oh this is great 🎉 I've been wanting to fix this issue for ages. Thanks @Vultraz 🙌🏼 |
...heh. Seems Node 10 doesn't have |
Reduced changeset level to minor since this doesn't actually break |
Might need some work to make the Admin UI use this, but that could be done separately. |
I really like this, and it's definitely something I want to pull in. One challenge that I want to think through before we merge it (because it will be hard to change later) is the naming. I had this as an IRL conversation with @molomby , but I don't like the use of the term This is something I need to think through a bit more deeply and work out a solution for (which might just require me to change my brain). |
Hmm 🤔 IMO, since either |
@timleslie, sure you're not getting that backwards? When we spoke in Jan I'm pretty sure you agreed The reasoning was that "order" implies the list itself has a natural or explicit ordering stored within it. Eg. a list with a A "sort" on the other hand, is something you apply to one or more arbitrary keys in a more dynamic fashion. Eg. I'm going to sort this set of buildings by Similar to the vibe portrayed here. |
I'm really keen to get this merged but have to ask... should the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I think this is correct. Should get sign off from @timleslie too though before merging.
Righto, I think this is good to go. Let's 🚢 this thing and see what happens! Thanks for the implementation @Vultraz and for your patience while we got around to fully reviewing it 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's 🚢
Righto, I think this is good to go. Let's 🚢 this thing and see what happens! Thanks for the implementation @Vultraz and for your patience while we got around to fully reviewing it 👍 |
No problem! 😃 @Nikodermus I think you were waiting for this. |
Resolves #183
Used
sortBy
as suggested by @molomby. I also made it so you can specify multiple sort options for multi-field/column sorting (which both MongoDB and Knex support).for example.
The single-criteria sort also works:
Generated enum example:
@timleslie