Skip to content
Snippets Groups Projects
Commit 11f817b3 authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Add ability to choose id attribute in project select helper

parent 5dea8fb9
Branches
Tags
1 merge request!2831Ability to move issue to another project
Loading
Loading
@@ -4,6 +4,7 @@ class @ProjectSelect
@groupId = $(select).data('group-id')
@includeGroups = $(select).data('include-groups')
@orderBy = $(select).data('order-by') || 'id'
@selectId = $(select).data('select-id') || 'web_url'
 
placeholder = "Search for project"
placeholder += " or group" if @includeGroups
Loading
Loading
@@ -31,8 +32,8 @@ class @ProjectSelect
else
Api.projects query.term, @orderBy, projectsCallback
 
id: (project) ->
project.web_url
id: (project) =>
project[@selectId]
 
text: (project) ->
project.name_with_namespace || project.name
Loading
Loading
Loading
Loading
@@ -73,7 +73,7 @@
= f.label :move_to_project_id, 'Move', class: 'control-label'
.col-sm-10
= project_select_tag("#{issuable.class.model_name.param_key}[move_to_project_id]",
placeholder: 'Select project', class: 'custom-form-control')
placeholder: 'Select project', class: 'custom-form-control', data: { 'select-id' => 'id' })
 
- if issuable.is_a?(MergeRequest)
%hr
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment