2020-09-29 05:09:49 -04:00
|
|
|
- issuable_type = issuable_sidebar[:type]
|
|
|
|
|
|
|
|
#js-vue-sidebar-reviewers{ data: { field: issuable_type, signed_in: signed_in } }
|
|
|
|
.title.hide-collapsed
|
|
|
|
= _('Reviewer')
|
2022-03-04 07:13:07 -05:00
|
|
|
= gl_loading_icon(inline: true)
|
2020-09-29 05:09:49 -04:00
|
|
|
|
|
|
|
.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)
|
|
|
|
|
2021-05-27 08:10:56 -04:00
|
|
|
= render 'shared/issuable/sidebar_user_dropdown',
|
|
|
|
options: options,
|
|
|
|
wrapper_class: 'js-sidebar-reviewer-dropdown',
|
2021-06-10 11:10:14 -04:00
|
|
|
track_label: 'edit_reviewer',
|
|
|
|
trigger_source: "#{issuable_type}-reviewer-dropdown"
|