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

[FEATURE] [DRAFT] Sort events by giving lesser priority to events with older start dates #964

Open
sandeep-ps opened this issue Jul 12, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@sandeep-ps
Copy link
Collaborator

sandeep-ps commented Jul 12, 2022

Is your feature request related to a problem? Please describe.
Currently, in the Illinois app, a lot of long-running events (with older start dates) appear at the top hiding the more recent events down below in the list of events.

Describe the solution you'd like
Please add a sort feature to the Events BB GET /events endpoint so that events with start dates less than a week from the current date are removed from the top of the list and appended at the end of the list.

Currently, the default output is:
Event 4 (May 1 - Aug 1)
Event 5 (May 15 - Aug 1)
Event 6 (June 30 - Aug 1)
Event 1 (Jul 10 - Jul 11)
Event 2 (Jul 15 - Nov 30)
Event 3 (Jul 16 - July 16)

Let's say the current date is July 14. After conditional sorting, for example, the output would be like this:
Event 1 (Jul 10 - Jul 11)
Event 2 (Jul 15 - Nov 30)
Event 3 (Jul 16 - July 16)
Event 4 (May 1 - Aug 1)
Event 5 (May 15 - Aug 1)
Event 6 (June 30 - Aug 1)

Let's make this a configuration BOOLEAN field called "SHOW_RECENT_EVENTS_FIRST" to disable or enable this feature.

Describe alternatives you've considered
Sorting in the app is another option, but this could be compute/memory intensive on the phone and hence could affect the performance of the app.

Additional context
It looks like MongoDB's conditional sort feature is what could be of use for this feature. Adding some resources for reference:
https://stackoverflow.com/questions/55159417/mongodb-conditional-sort.
https://www.mongodb.com/docs/manual/reference/operator/aggregation/addFields/

@sandeep-ps sandeep-ps added the enhancement New feature or request label Jul 12, 2022
@sandeep-ps sandeep-ps changed the title [FEATURE] [DRAFT] Sort events by giving lesser priority to events with older start dates [FEATURE] Sort events by giving lesser priority to events with older start dates Jul 12, 2022
@sandeep-ps sandeep-ps changed the title [FEATURE] Sort events by giving lesser priority to events with older start dates [FEATURE] [DRAFT] Sort events by giving lesser priority to events with older start dates Jul 12, 2022
@sandeep-ps sandeep-ps changed the title [FEATURE] [DRAFT] Sort events by giving lesser priority to events with older start dates [FEATURE] Sort events by giving lesser priority to events with older start dates Jul 12, 2022
@sandeep-ps
Copy link
Collaborator Author

Let's wait to develop this until further discussions next week. Thanks.

@sandeep-ps
Copy link
Collaborator Author

@bingzhang, this is currently on hold as a UI change on the Illinois app is being explored as a solution. I'm removing your assignment on this and marking it as DRAFT. I will close this after there is confirmation that the approach works fine. Thanks.

@sandeep-ps sandeep-ps changed the title [FEATURE] Sort events by giving lesser priority to events with older start dates [FEATURE] [DRAFT] Sort events by giving lesser priority to events with older start dates Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants