]> source.dussan.org Git - sonarqube.git/commitdiff
add current assignee to the dropdown of issue box assignees
authorStas Vilchik <vilchiks@gmail.com>
Thu, 22 Jan 2015 16:47:13 +0000 (17:47 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 23 Jan 2015 08:06:05 +0000 (09:06 +0100)
server/sonar-web/src/main/coffee/issue/views/assign-form-view.coffee

index bca4eb2d6417301b1814286d10bee6bdf39a0c17..ed4b0379058b58e2a4cf653e660be4c8cd773a57 100644 (file)
@@ -40,6 +40,13 @@ define [
       setTimeout (=> @$('input').focus()), 100
 
 
+    selectInitialOption: ->
+      assignee = @getAssignee()
+      if assignee
+        @makeActive @getOptions().filter("[data-value=\"#{@getAssignee()}\"]")
+      else super
+
+
     renderTags: ->
       @$('.issue-action-option').remove()
       @getAssignees().forEach @renderAssignee, @
@@ -126,9 +133,9 @@ define [
       assignees = [{ id: '', text: t('unassigned') }]
       currentUser = window.SS.user
       currentUserName = window.SS.userName
-      currentAssignee = @getAssignee()
-      if !currentAssignee || currentUser != currentAssignee
-        assignees.push id: currentUser, text: currentUserName
+      assignees.push id: currentUser, text: currentUserName
+      if @getAssignee()
+        assignees.push id: @getAssignee(), text: @getAssigneeName()
       @makeUnique assignees