2019-02-15 15:39:39 +05:30
|
|
|
- issuable_type = issuable_sidebar[:type]
|
|
|
|
- signed_in = !!issuable_sidebar.dig(:current_user, :id)
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
#js-vue-sidebar-assignees{ data: { field: issuable_type, signed_in: signed_in } }
|
2017-08-17 22:00:37 +05:30
|
|
|
.title.hide-collapsed
|
2018-03-17 18:26:18 +05:30
|
|
|
= _('Assignee')
|
2020-04-08 14:13:33 +05:30
|
|
|
.spinner.spinner-sm.align-bottom
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
.selectbox.hide-collapsed
|
2019-02-15 15:39:39 +05:30
|
|
|
- if assignees.none?
|
|
|
|
= hidden_field_tag "#{issuable_type}[assignee_ids][]", 0, id: nil
|
|
|
|
- else
|
|
|
|
- assignees.each do |assignee|
|
2019-12-04 20:38:33 +05:30
|
|
|
= hidden_field_tag "#{issuable_type}[assignee_ids][]", assignee.id, id: nil, data: assignee_sidebar_data(assignee, merge_request: @merge_request)
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
- options = { toggle_class: 'js-user-search js-author-search',
|
|
|
|
title: _('Assign to'),
|
|
|
|
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,
|
2019-12-04 20:38:33 +05:30
|
|
|
iid: issuable_sidebar[:iid],
|
|
|
|
issuable_type: issuable_type,
|
2019-02-15 15:39:39 +05:30
|
|
|
project_id: issuable_sidebar[:project_id],
|
|
|
|
author_id: issuable_sidebar[:author_id],
|
|
|
|
field_name: "#{issuable_type}[assignee_ids][]",
|
|
|
|
issue_update: issuable_sidebar[:issuable_json_path],
|
|
|
|
ability_name: issuable_type,
|
|
|
|
null_user: true,
|
|
|
|
display: 'static' } }
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2019-07-31 22:56:46 +05:30
|
|
|
- dropdown_options = assignees_dropdown_options(issuable_type)
|
|
|
|
- title = dropdown_options[:title]
|
|
|
|
- options[:toggle_class] += ' js-multiselect js-save-user-data'
|
|
|
|
- data = { field_name: "#{issuable_type}[assignee_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)
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
- 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-assignee-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_assignee' }
|
|
|
|
- else
|
|
|
|
= dropdown_tag(title, options: options)
|