-
-
Notifications
You must be signed in to change notification settings - Fork 778
Add "Sort Order" field to Application model and order by it #804
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
Conversation
Order user Application list by sort order Add sort order field to Application creation Add sort order field to Application updating
|
Thanks! It looks generally good. I have no problem going with this design, might be a couple nitpicks for a deep look before merge but otherwise looking good. However there might be a more user friendly UX. Do you know about sortable drag and drop list? The one where you have "Apple" on one line, "Banana" on the second, and you can swap orders between them? I think it would be more intuitive than inputting a number. you can implement this by labeling the "sort order" of Apps from 0-N, and then when the user drag and drop you upload a new sequence, or swap the index of two apps. I would prefer the full update approach since we are displaying Apps on one page anyways so there won't be too much. Let me know if you are up to it! |
|
Another option would be to use decimals when reordering, this way only one app has to be updated in the database. E.g. You have this order (the number is the sort order index) When now reordering Orange between Apple and Banana it would get the sort order 1.5. But the full update proposal from eternal-flame-AD is fine too. |
|
I am not sure when I will get around to making any improvements to this pull request, but happy for others to contribute if they would like to round out this feature. |
|
@jberlyn Do you still plan on finishing this PR or are you open to me finishing it when I got some spare time to spend since it seems there is community need for this? |
More than happy for you to take a look at it. |
|
I will push a pull request today to add drag and drop on sortOrder |


This is my attempt at resolving:
#358
This adds a new field to Application called "Sort Order". When fetching the list of Applications by user, it will order by this Sort Order. By default, Applications will have a Sort Order of 0.
This is my first time contributing to a Go codebase, I am not familiar with the database tooling so I am unsure if this will automatically migrate the Application table to include the "Sort Order" column.
Happy to take feedback on this feature implementation.