Sort by vote isn't sorting correctly

RESOLVED FIXED

Status

()

bugzilla.mozilla.org
Extensions: ProductDashboard
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: lizzard, Assigned: glob)

Tracking

Production

Details

The product dashboard for popularity by product isn't sorting correctly. So, for example, if you look at the most voted on bugs for Toolkit,
https://bugzilla.mozilla.org/page.cgi?id=productdashboard.html&tab=popularity&product=Toolkit&bug_status=open

And sort by number of votes, you get 90, then 9, then 86, then 8. 

I'd like to be able to see the list sorted by most popular bug.

Comment 1

3 years ago
WFM on first page load (since it defaults to sorted by votes), but doesn't work once the column headers are clicked. 

Seems like the datatable needs to be told to use numeric sort:
https://github.com/mozilla/webtools-bmo-bugzilla/blob/master/extensions/ProductDashboard/web/js/popularity.js

-  { key:"count", label:"Count", sortable:true },
+  { key:"count", label:"Count", sortable:true, parser: 'number' },

Or else we set the values to be ints not a string, by removing the quotes here: 
https://github.com/mozilla/webtools-bmo-bugzilla/blob/master/extensions/ProductDashboard/template/en/default/pages/productdashboard/popularity.html.tmpl#L18
fixes count on popularity and duplicates, and also treats bug ids as integers:

To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   7dc675f..3a4ca4b  master -> master
Assignee: nobody → glob
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.