summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2019-06-20 18:59:02 +0100
committerPhil Hughes <me@iamphill.com>2019-06-24 10:50:08 +0100
commitd9242f206be0f7d9b62d754b42576f89f78990b0 (patch)
treec27cf08d6ecb00a6d8b00136a75832240514a42f /app/views
parent733f384ba8e9ecb2748bcd8c0cd91d8e370f8cc7 (diff)
downloadgitlab-ce-d9242f206be0f7d9b62d754b42576f89f78990b0.tar.gz
Show create merge request button on confidential issues
https://gitlab.com/gitlab-org/gitlab-ce/issues/58583
Diffstat (limited to 'app/views')
-rw-r--r--app/views/projects/issues/_new_branch.html.haml8
-rw-r--r--app/views/projects/issues/show.html.haml2
2 files changed, 7 insertions, 3 deletions
diff --git a/app/views/projects/issues/_new_branch.html.haml b/app/views/projects/issues/_new_branch.html.haml
index 457b2936278..52bb797b5b3 100644
--- a/app/views/projects/issues/_new_branch.html.haml
+++ b/app/views/projects/issues/_new_branch.html.haml
@@ -2,6 +2,7 @@
- can_create_merge_request = can?(current_user, :create_merge_request_in, @project)
- data_action = can_create_merge_request ? 'create-mr' : 'create-branch'
- value = can_create_merge_request ? 'Create merge request' : 'Create branch'
+ - value = can_create_confidential_merge_request? ? _('Create confidential merge request') : value
- can_create_path = can_create_branch_project_issue_path(@project, @issue)
- create_mr_path = create_merge_request_project_issue_path(@project, @issue, branch_name: @issue.to_branch_name, ref: @project.default_branch)
@@ -23,12 +24,15 @@
= icon('caret-down')
.droplab-dropdown
- %ul#create-merge-request-dropdown.create-merge-request-dropdown-menu.dropdown-menu.dropdown-menu-right.gl-show-field-errors{ data: { dropdown: true } }
+ %ul#create-merge-request-dropdown.create-merge-request-dropdown-menu.dropdown-menu.dropdown-menu-right.gl-show-field-errors{ class: ("create-confidential-merge-request-dropdown-menu" if can_create_confidential_merge_request?), data: { dropdown: true } }
- if can_create_merge_request
%li.droplab-item-selected{ role: 'button', data: { value: 'create-mr', text: _('Create merge request') } }
.menu-item
= icon('check', class: 'icon')
- = _('Create merge request and branch')
+ - if can_create_confidential_merge_request?
+ = _('Create confidential merge request and branch')
+ - else
+ = _('Create merge request and branch')
%li{ class: [!can_create_merge_request && 'droplab-item-selected'], role: 'button', data: { value: 'create-branch', text: _('Create branch') } }
.menu-item
diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml
index d55afee4523..8ec07dc3bb4 100644
--- a/app/views/projects/issues/show.html.haml
+++ b/app/views/projects/issues/show.html.haml
@@ -91,7 +91,7 @@
= render 'award_emoji/awards_block', awardable: @issue, inline: true
.col-md-12.col-lg-6.new-branch-col
#js-vue-discussion-filter{ data: { default_filter: current_user&.notes_filter_for(@issue), notes_filters: UserPreference.notes_filters.to_json } }
- = render 'new_branch' unless @issue.confidential?
+ = render 'new_branch' if show_new_branch_button?
= render_if_exists 'projects/issues/discussion'