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

feat(v2): Sort disruptions by start or end date #1143

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jzimbel-mbta
Copy link
Member

Summary of changes

Asana Ticket: 🏹 Implement sort by date functionality

Based on the ticket's acceptance criteria, I needed to maintain the state of each sortable column. Otherwise, one of these behaviors would be necessary:

  • toggling the sort direction for one column toggles it for all of them, or
  • changing the active sorted column resets the previous sorted column to a default
    (this is what the v1 disruptions table does)

The new sorting filters look like:

%{
  ...
  sort: %{field_name => :asc | :desc},
  active_sort: field_name
}

which allows us to remember the sort direction of all columns, even when they are not active.

Reviewer Checklist

  • Meets ticket's acceptance criteria
  • Any new or changed functions have typespecs
  • Tests were added for any new functionality (don't just rely on Codecov)
  • This branch was deployed to the staging environment and is currently running with no unexpected increase in warnings, and no errors or crashes.

@jzimbel-mbta jzimbel-mbta requested review from a team and Whoops and removed request for a team March 5, 2025 14:40
@jzimbel-mbta
Copy link
Member Author

Still finishing up tests!

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