diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
commit | be834a25982746ffd85252ff502df42bb88cb9d5 (patch) | |
tree | b4d6a8ba0931e12fac08f05abea33a3b8ec2c8a2 /app/views/shared/issuable/_sidebar_reviewers.html.haml | |
parent | ee925a3597f27e92f83a50937a64068109675b3d (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc32
Diffstat (limited to 'app/views/shared/issuable/_sidebar_reviewers.html.haml')
-rw-r--r-- | app/views/shared/issuable/_sidebar_reviewers.html.haml | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/app/views/shared/issuable/_sidebar_reviewers.html.haml b/app/views/shared/issuable/_sidebar_reviewers.html.haml new file mode 100644 index 00000000000..8b546d5e344 --- /dev/null +++ b/app/views/shared/issuable/_sidebar_reviewers.html.haml @@ -0,0 +1,56 @@ +- issuable_type = issuable_sidebar[:type] +- signed_in = !!issuable_sidebar.dig(:current_user, :id) + +#js-vue-sidebar-reviewers{ data: { field: issuable_type, signed_in: signed_in } } + .title.hide-collapsed + = _('Reviewer') + = loading_icon(css_class: 'gl-vertical-align-text-bottom') + +.selectbox.hide-collapsed + - if reviewers.none? + = hidden_field_tag "#{issuable_type}[reviewer_ids][]", 0, id: nil + - else + - reviewers.each do |reviewer| + = hidden_field_tag "#{issuable_type}[reviewer_ids][]", reviewer.id, id: nil, data: reviewer_sidebar_data(reviewer, merge_request: @merge_request) + + - options = { toggle_class: 'js-reviewer-search js-author-search', + title: _('Request review from'), + filter: true, + dropdown_class: 'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author', + placeholder: _('Search users'), + data: { first_user: issuable_sidebar.dig(:current_user, :username), + current_user: true, + iid: issuable_sidebar[:iid], + issuable_type: issuable_type, + project_id: issuable_sidebar[:project_id], + author_id: issuable_sidebar[:author_id], + field_name: "#{issuable_type}[reviewer_ids][]", + issue_update: issuable_sidebar[:issuable_json_path], + ability_name: issuable_type, + null_user: true, + display: 'static' } } + + - dropdown_options = reviewers_dropdown_options(issuable_type) + - title = dropdown_options[:title] + - options[:toggle_class] += ' js-multiselect js-save-user-data' + - data = { field_name: "#{issuable_type}[reviewer_ids][]" } + - data[:multi_select] = true + - data['dropdown-title'] = title + - data['dropdown-header'] = dropdown_options[:data][:'dropdown-header'] + - data['max-select'] = dropdown_options[:data][:'max-select'] if dropdown_options[:data][:'max-select'] + - options[:data].merge!(data) + + - if experiment_enabled?(:invite_members_version_a) && can_import_members? + - options[:dropdown_class] += ' dropdown-extended-height' + - options[:footer_content] = true + - options[:wrapper_class] = 'js-sidebar-reviewer-dropdown' + + = dropdown_tag(title, options: options) do + %ul.dropdown-footer-list + %li + = link_to _('Invite Members'), + project_project_members_path(@project), + title: _('Invite Members'), + data: { 'is-link': true, 'track-event': 'click_invite_members', 'track-label': 'edit_reviewer' } + - else + = dropdown_tag(title, options: options) |