Closed chigby closed 3 years ago
Yeah, I suppose not considering articles when sorting by name is maybe a question for @redshiftzero. Initially I didn't think about it, but when I was scrolling through locally, I noticed all the organizations with "The" at the beginning were next to each other. I think it depends on how we think people want to use the list and if, for example, "The New York Times" should be under "T" or "N".
nice, I think removing articles is a good choice since we have so many news organizations beginning with The (and this seems to be a standard approach)
@chigby I have resolved the merge conflict modifying my code for sorting by different attributes based on your changes in the PR. Please review and check if looks good. If seems good to you, can merge then
@SaptakS Your change looks great, though while I was looking at it locally I realized there was a problem with my title sorting regular expression. I fixed it in https://github.com/freedomofpress/securethenews/pull/290/commits/ae45db103523ff579ec6ed384a0518ee5284a375 but if you could give it a quick check to make sure, then we can get this merged.
Regex fix looks good. Nice catch!
Fixes #278
This pull request changes the sorting of the leaderboard to sort by news organization name after sorting by the score.
I've chosen to add
lodash
as a dependency here since its sorting capabilities are more flexible and more in line with the kind of sorting we want to perform here. This doesn't even really add that much to the "weight" of our JS. According to the documentation, if we just import the single function we want, it will only even add the small subset of lodash code that we're using into the final bundle.