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

Incorporate priority in sorting #23

Merged
merged 9 commits into from
Dec 11, 2023
Merged

Incorporate priority in sorting #23

merged 9 commits into from
Dec 11, 2023

Conversation

benmelz
Copy link
Member

@benmelz benmelz commented Sep 22, 2023

Makes it so the message sorting logic considers message priority first and (minimum) route sort order second

I didn't end up incorporating the date/time values because the implementation was really gross and in the grand scheme of things, I think not really necessary (it would sparsely be triggered, and not super impactful, considering we implemented #13).

Closes #6

@benmelz benmelz changed the title Incorporate priority sorting Incorporate priority in sorting Sep 22, 2023
function filterPublicMessages(publicMessages, routeAbbreviations) {
return publicMessages.filter((message) => {
if ((routeAbbreviations instanceof Array) && (message['Routes'].length > 0)) {
return message['Routes'].some((route) => route['RouteAbbreviation'].includes(route.abbreviation));
Copy link
Contributor

Choose a reason for hiding this comment

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

I would understand not wanting to do it here, but since you basically rewrote it all anyway.... #15 mentions removing all filtered out routes. If you want to keep that separate though then fine

separate PRs for separate issues! blahblahblah

@benmelz benmelz merged commit 7dd408a into main Dec 11, 2023
1 check passed
@benmelz benmelz deleted the priority-sort branch December 11, 2023 21:05
@benmelz benmelz mentioned this pull request Dec 14, 2023
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.

Incorporate "Priority" levels in sorting
2 participants