summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2017-05-26 19:42:02 +0000
committerFatih Acet <acetfatih@gmail.com>2017-05-26 19:42:02 +0000
commit8968171c9e58708f6f0922a1a337bb622bd8b9b5 (patch)
treea9630f0e3634a976f6493558e9b1645624c544cb /app/views
parent3605e4307ddf373071c0353a066c50fcead01e45 (diff)
parent099a9e016e8c09609fbbbc96c6bca4781f87d487 (diff)
downloadgitlab-ce-8968171c9e58708f6f0922a1a337bb622bd8b9b5.tar.gz
Merge branch '32447-remove-source-branch-is-displayed-to-mergers-who-cannot-actually-delete-the-source-branch-from-a-forked-project' into 'master'
Disable "Remove source branch" in MR Widget for users who can't remove, and re-add checkbox to MR form Closes #32447 and #32907 See merge request !11558
Diffstat (limited to 'app/views')
-rw-r--r--app/views/shared/issuable/form/_merge_params.html.haml10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/views/shared/issuable/form/_merge_params.html.haml b/app/views/shared/issuable/form/_merge_params.html.haml
index d23f79be2be..271150ed318 100644
--- a/app/views/shared/issuable/form/_merge_params.html.haml
+++ b/app/views/shared/issuable/form/_merge_params.html.haml
@@ -5,3 +5,13 @@
-# This check is duplicated below, to avoid conflicts with EE.
- return unless issuable.can_remove_source_branch?(current_user)
+
+.form-group
+ .col-sm-10.col-sm-offset-2
+ - if issuable.can_remove_source_branch?(current_user)
+ .checkbox
+ - initial_checkbox_value = issuable.merge_params.key?('force_remove_source_branch') ? issuable.force_remove_source_branch? : true
+ = label_tag 'merge_request[force_remove_source_branch]' do
+ = hidden_field_tag 'merge_request[force_remove_source_branch]', '0', id: nil
+ = check_box_tag 'merge_request[force_remove_source_branch]', '1', initial_checkbox_value
+ Remove source branch when merge request is accepted.