diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-06-29 10:19:54 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-06-29 12:59:37 -0500 |
commit | 6cdbb1e687bcb787f749b51c472ec8449d0ca0e4 (patch) | |
tree | e4d60dc2698a01f309c96f65c6404239a2909bce | |
parent | 3d49246dc8cd28555f7c06608fc75dcd37ee1b08 (diff) | |
download | gitlab-ce-6cdbb1e687bcb787f749b51c472ec8449d0ca0e4.tar.gz |
Fix 'New merge request' button for users who don't have push access to canonical projectdm-empty-state-new-merge-request
-rw-r--r-- | app/views/projects/merge_requests/index.html.haml | 8 | ||||
-rw-r--r-- | changelogs/unreleased/dm-empty-state-new-merge-request.yml | 5 |
2 files changed, 10 insertions, 3 deletions
diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml index 86996e488a1..1e30cc09894 100644 --- a/app/views/projects/merge_requests/index.html.haml +++ b/app/views/projects/merge_requests/index.html.haml @@ -13,6 +13,9 @@ = render 'projects/last_push' +- merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) +- new_merge_request_path = namespace_project_new_merge_request_path(merge_project.namespace, merge_project) if merge_project + - if @project.merge_requests.exists? %div{ class: container_class } .top-area @@ -20,9 +23,8 @@ .nav-controls - if @can_bulk_update = button_tag "Edit Merge Requests", class: "btn js-bulk-update-toggle" - - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - if merge_project - = link_to namespace_project_new_merge_request_path(merge_project.namespace, merge_project), class: "btn btn-new", title: "New merge request" do + = link_to new_merge_request_path, class: "btn btn-new", title: "New merge request" do New merge request = render 'shared/issuable/search_bar', type: :merge_requests @@ -33,4 +35,4 @@ .merge-requests-holder = render 'merge_requests' - else - = render 'shared/empty_states/merge_requests', button_path: namespace_project_new_merge_request_path(@project.namespace, @project) + = render 'shared/empty_states/merge_requests', button_path: new_merge_request_path diff --git a/changelogs/unreleased/dm-empty-state-new-merge-request.yml b/changelogs/unreleased/dm-empty-state-new-merge-request.yml new file mode 100644 index 00000000000..5fad7a0f883 --- /dev/null +++ b/changelogs/unreleased/dm-empty-state-new-merge-request.yml @@ -0,0 +1,5 @@ +--- +title: Fix 'New merge request' button for users who don't have push access to canonical + project +merge_request: +author: |