]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5718 Fix sorting of facet items
authorStas Vilchik <stasvilchik@Stas-Vilchik-iMac.local>
Wed, 10 Dec 2014 09:31:24 +0000 (10:31 +0100)
committerStas Vilchik <stasvilchik@Stas-Vilchik-iMac.local>
Wed, 10 Dec 2014 09:31:24 +0000 (10:31 +0100)
server/sonar-web/src/main/coffee/issues/facets/assignee-facet.coffee
server/sonar-web/src/main/coffee/issues/facets/resolution-facet.coffee

index c5d4963d29b2907fa928d99cdfc3324131344534..7e3cc59ce327b728d034a5e9ce849f9e5cee0195 100644 (file)
@@ -64,6 +64,14 @@ define [
       @options.app.state.updateFilter obj
 
 
+    sortValues: (values) ->
+      # put "unassigned" first
+      _.sortBy values, (v) ->
+        x = if v.val == '' then -999999 else -v.count
+        console.log v.val, x
+        x
+
+
     serializeData: ->
       _.extend super,
-        values: @getValuesWithLabels()
+        values: @sortValues @getValuesWithLabels()
index d70ed1963860d6d7d725c279c800055a86822360..2caed5ddb513c5f66e9a0680cd98ae4b8f87902e 100644 (file)
@@ -37,6 +37,6 @@ define [
 
 
     sortValues: (values) ->
-      order = ['FIXED', 'FALSE-POSITIVE', 'CLOSED']
+      order = ['', 'FIXED', 'FALSE-POSITIVE', 'REMOVED']
       _.sortBy values, (v) -> order.indexOf v.val