aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-10-30 15:49:32 +0100
committerStas Vilchik <vilchiks@gmail.com>2014-10-30 15:49:54 +0100
commit1141006f24b6d0d533ecb03dba1f594c2d808d20 (patch)
tree5632a2a3a50404d6887884cd1cdb9fdf78fa01fd
parente7fc710e6467ca4e1dfc7a5cbd6ae2231270ca01 (diff)
downloadsonarqube-1141006f24b6d0d533ecb03dba1f594c2d808d20.tar.gz
sonarqube-1141006f24b6d0d533ecb03dba1f594c2d808d20.zip
SONAR-5718 Enable facets from query
-rw-r--r--server/sonar-web/src/main/coffee/issues/controller.coffee15
-rw-r--r--server/sonar-web/src/main/coffee/issues/models/state.coffee2
2 files changed, 12 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/coffee/issues/controller.coffee b/server/sonar-web/src/main/coffee/issues/controller.coffee
index a88af906420..a5424edb81b 100644
--- a/server/sonar-web/src/main/coffee/issues/controller.coffee
+++ b/server/sonar-web/src/main/coffee/issues/controller.coffee
@@ -13,6 +13,8 @@ define [
$ = jQuery
EXTRA_FIELDS = 'actions,transitions,assigneeName,reporterName,actionPlanName'
PAGE_SIZE = 50
+ ALL_FACETS = ['severities', 'statuses', 'resolutions', 'componentRootUuids', 'assignees', 'reporters', 'rules',
+ 'languages', 'actionPlans', 'componentUuids', 'creationDate']
FACET_DATA_FIELDS = ['components', 'projects', 'users', 'rules', 'actionPlans']
FACETS_FROM_SERVER = ['severities', 'statuses', 'resolutions', 'actionPlans', 'componentRootUuids', 'rules',
'assignees', 'reporters', 'componentUuids', 'languages']
@@ -34,11 +36,18 @@ define [
_allFacets: ->
- @options.app.state.get('allFacets').map (facet) -> { property: facet }
+ ALL_FACETS.map (facet) -> { property: facet }
- _facetsFromServer: ->
+ _enabledFacets: ->
facets = @options.app.state.get 'facets'
+ criteria = Object.keys @options.app.state.get 'query'
+ facets = facets.concat criteria
+ facets.filter (facet) -> ALL_FACETS.indexOf(facet) != -1
+
+
+ _facetsFromServer: ->
+ facets = @_enabledFacets()
facets.filter (facet) -> FACETS_FROM_SERVER.indexOf(facet) != -1
@@ -60,7 +69,7 @@ define [
FACET_DATA_FIELDS.forEach (field) => @options.app.facets[field] = r[field]
@options.app.facets.reset @_allFacets()
@options.app.facets.add r.facets, merge: true
- @enableFacets @options.app.state.get 'facets'
+ @enableFacets @_enabledFacets()
@options.app.state.set
page: r.p
diff --git a/server/sonar-web/src/main/coffee/issues/models/state.coffee b/server/sonar-web/src/main/coffee/issues/models/state.coffee
index 887b988f8aa..264e81ad2e1 100644
--- a/server/sonar-web/src/main/coffee/issues/models/state.coffee
+++ b/server/sonar-web/src/main/coffee/issues/models/state.coffee
@@ -13,8 +13,6 @@ define [
query: {}
facets: ['severities', 'statuses', 'resolutions']
- allFacets: ['severities', 'statuses', 'resolutions', 'componentRootUuids', 'assignees', 'reporters', 'rules',
- 'languages', 'actionPlans', 'componentUuids', 'creationDate']
nextPage: ->