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

Dexex organize docket sorting (WIP) #5556

Draft
wants to merge 6 commits into
base: staging
Choose a base branch
from

Conversation

Mwindo
Copy link
Contributor

@Mwindo Mwindo commented Nov 15, 2024

This is a work in progress. Please ignore for now.

We have several different methods for sorting docket-related things scattered throughout the codebase. This PR attempts to collect them in one place, refactoring and renaming them for clarity as need be.

…rialSessionDetails, which does not say what it sorts by and is imported in places that seem unrelated to getting formatted trial session details, with a more intuitive sorting function that does the same thing
@Mwindo Mwindo changed the title Dexex organize docket sorting Dexex organize docket sorting (WIP) Nov 15, 2024
Comment on lines -474 to -478
if (isReversed) {
// reversing AFTER the sort keeps sorting stable
return docketEntries.reverse().sort(sortUndefined);
}
return docketEntries.sort(sortUndefined);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We were sorting the whole list twice rather than improving our a custom comparison function to allow us to sort once.

@@ -0,0 +1,76 @@
const getSortableDocketNumber = (docketNumber?: string) => {
Copy link
Contributor Author

@Mwindo Mwindo Nov 18, 2024

Choose a reason for hiding this comment

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

This file is just logic moved over from Case.ts.

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.

1 participant