Make sure issue assignee is properly reset.
This commit is contained in:
parent
2953e0d19b
commit
515e9d51df
5 changed files with 12 additions and 20 deletions
|
@ -25,7 +25,7 @@ class @ProjectUsersSelect
|
|||
|
||||
initSelection: (element, callback) ->
|
||||
id = $(element).val()
|
||||
if id isnt ""
|
||||
if id != "" && id != "-1"
|
||||
Api.user(id, callback)
|
||||
|
||||
|
||||
|
@ -44,9 +44,6 @@ class @ProjectUsersSelect
|
|||
else
|
||||
avatar = gon.default_avatar_url
|
||||
|
||||
if user.id == ''
|
||||
avatarMarkup = ''
|
||||
else
|
||||
avatarMarkup = "<div class='user-image'><img class='avatar s24' src='#{avatar}'></div>"
|
||||
|
||||
"<div class='user-result'>
|
||||
|
|
|
@ -58,22 +58,11 @@ module IssuesHelper
|
|||
end
|
||||
|
||||
def bulk_update_milestone_options
|
||||
options_for_select(['None (backlog)']) +
|
||||
options_for_select([['None (backlog)', -1]]) +
|
||||
options_from_collection_for_select(project_active_milestones, 'id',
|
||||
'title', params[:milestone_id])
|
||||
end
|
||||
|
||||
def bulk_update_assignee_options(project = @project)
|
||||
options_for_select(['None (unassigned)']) +
|
||||
options_from_collection_for_select(project.team.members, 'id',
|
||||
'name', params[:assignee_id])
|
||||
end
|
||||
|
||||
def assignee_options(object, project = @project)
|
||||
options_from_collection_for_select(project.team.members.sort_by(&:name),
|
||||
'id', 'name', object.assignee_id)
|
||||
end
|
||||
|
||||
def milestone_options(object)
|
||||
options_from_collection_for_select(object.project.milestones.active,
|
||||
'id', 'title', object.milestone_id)
|
||||
|
|
|
@ -14,6 +14,9 @@ module Issues
|
|||
issue.update_nth_task(params[:task_num].to_i, false)
|
||||
end
|
||||
|
||||
params[:assignee_id] = "" if params[:assignee_id] == "-1"
|
||||
params[:milestone_id] = "" if params[:milestone_id] == "-1"
|
||||
|
||||
old_labels = issue.labels.to_a
|
||||
|
||||
if params.present? && issue.update_attributes(params.except(:state_event,
|
||||
|
|
|
@ -23,6 +23,9 @@ module MergeRequests
|
|||
merge_request.update_nth_task(params[:task_num].to_i, false)
|
||||
end
|
||||
|
||||
params[:assignee_id] = "" if params[:assignee_id] == "-1"
|
||||
params[:milestone_id] = "" if params[:milestone_id] == "-1"
|
||||
|
||||
old_labels = merge_request.labels.to_a
|
||||
|
||||
if params.present? && merge_request.update_attributes(
|
||||
|
|
Loading…
Reference in a new issue