#4393 Fix the new PR drop-down button
Merged 5 years ago by pingou. Opened 5 years ago by pingou.

@@ -376,12 +376,13 @@ 

     _b.show();

     $("#pr-dropdown-forklist .pr-dropdown-spinner").hide();

  }

+ {% endif %}

  

  $("#pr-button").one("click",

    function() {

    var _pr_url = "{{ url_for('internal_ns.get_pull_request_ready_branch') }}";

  

- 

+   {% if g.repo_committer %}

    var data = {

          repo: "{{ repo.name }}",

          namespace: "{{ repo.namespace if repo.namespace }}",
@@ -402,6 +403,8 @@ 

        _b.show();

        $("#pr-dropdown-mainlist .pr-dropdown-spinner").hide();

    })

+   {% endif %}

+ 

    var data = {

          repo: "{{ repo.name }}",

          namespace: "{{ repo.namespace if repo.namespace }}",
@@ -424,7 +427,6 @@ 

    })

    }

  );

- {% endif %}

  

  {% endif %}

  </script>

Currently we only populate the new PR drop-down button if the user
is a maintainer, however, if the user has a fork, the drop-down
button should work.
So instead of preventing the entire button from working, we've
adjusted so that only the main project is considered if the user
is a maintainer and the fork is considered everytime otherwise.

Fixes https://pagure.io/pagure/issue/4310

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

pretty please pagure-ci rebuild

5 years ago

rebased onto 10d747b

5 years ago

Pull-Request has been merged by pingou

5 years ago