]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5718 Fix enabling filter after page reload
authorStas Vilchik <vilchiks@gmail.com>
Wed, 5 Nov 2014 11:06:41 +0000 (12:06 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 5 Nov 2014 12:37:24 +0000 (13:37 +0100)
server/sonar-web/src/main/coffee/issues/controller.coffee
server/sonar-web/src/main/coffee/issues/facets/creation-date-facet.coffee
server/sonar-web/src/main/hbs/issues/facets/issues-creation-date-facet.hbs

index 44f4a4d133b8cc490b609183e71a20131d6fcf8e..449acfa3ed202c68f06bc6aa6e87a8337b8a20c1 100644 (file)
@@ -18,6 +18,13 @@ define [
   FACET_DATA_FIELDS = ['components', 'projects', 'users', 'rules', 'actionPlans', 'languages']
   FACETS_FROM_SERVER = ['severities', 'statuses', 'resolutions', 'actionPlans', 'projectUuids', 'rules',
                         'assignees', 'reporters', 'componentUuids', 'languages']
+  TRANSFORM = {
+    'resolved': 'resolutions'
+    'assigned': 'assignees'
+    'createdAt': 'creationDate'
+    'createdBefore': 'creationDate'
+    'createdAfter': 'creationDate'
+  }
 
 
   class extends Marionette.Controller
@@ -43,6 +50,8 @@ define [
       facets = @options.app.state.get 'facets'
       criteria = Object.keys @options.app.state.get 'query'
       facets = facets.concat criteria
+      facets = facets.map (facet) ->
+        if TRANSFORM[facet]? then TRANSFORM[facet] else facet
       facets.filter (facet) -> ALL_FACETS.indexOf(facet) != -1
 
 
index 41f7e9185f2a53c99dd36d1b20ce429d1cae959a..2fd4c8f53a6a7832fe8e29f43f2c5e804904fa09 100644 (file)
@@ -44,3 +44,8 @@ define [
 
     disable: ->
       @options.app.state.updateFilter createdAfter: null, createdBefore: null, createdAt: null
+
+
+    serializeData: ->
+      _.extend super,
+        createdAt: @options.app.state.get('query').createdAt
index 1d90cb2d1399d09aac4c29dbbebe38f812765918..a35bc81ebc4c8954789779ce57080b523700bdeb 100644 (file)
@@ -1,9 +1,15 @@
 {{> '_issues-facet-header'}}
 
+<input type="hidden" name="createdAt">
+
+{{#if createdAt}}
+  <div class="issues-facet-container">
+    {{dt createdAt}}
+  </div>
+{{/if}}
+
 <div class="issues-facet-container justify">
   <input type="text" class="issues-facet-input" name="createdAfter" placeholder="From">
   to
   <input type="text" class="issues-facet-input" name="createdBefore" placeholder="To">
 </div>
-
-<input type="hidden" name="createdAt">