Issue #8711 new

Allow sorting of the Pull Request list by column other than last updated (BB-9817)

Bitbucket Bot
created an issue

As the title states. Allow sorting by things other than the current forced order of last updated. This could be PR number, open date or even author.

Comments (9)

  1. Victor Yap

    One "workaround" for this is, simply going to the "branches" page. There, pull requests are sorted by branch. You'll be missing the columns for pull request statistics, but, at least the items won't constantly re-order themselves in a madly chaotic dance.

  2. Victor Yap

    ಠ ̨ರೃ —「JavaScript, JavaScript. Does whatever a JavaScript does. Can it swing from a web? No, it can't, it's a JavaScript.」

    $(document).ready(function(){
        document.bitbucket_augment = {
            sort_pull_requests_by_title: function(){
                var rows = $("table.pullrequest-list tbody tr");
                rows.remove()
                sorted = rows.sort(function(a,b){
                    var a_txt = $(a).find(".title div a").text().substring(6);
                    var b_txt = $(b).find(".title div a").text().substring(6);
                    return a_txt > b_txt;
                });
                sorted.each(function(i, elem){
                    $("table.pullrequest-list tbody").append(elem);
                });
            }
        };
        var filter_control = $("ul.filter-control")
        if(filter_control){
            filter_control.append('<li><a href="#sort_by_title" onclick="document.bitbucket_augment.sort_pull_requests_by_title(); return false;">Sort By Title</a></li>');
        }
    });
    

    There, I fixed it.

    The above JavaScript can also be injected using brower extensions, such as "Custom JavaScript for Websites" for Chrome.

  3. Log in to comment