allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [38/38] git commit: [#4019] misc small fixes to filtering
Date Wed, 30 Apr 2014 18:16:10 GMT
[#4019] misc small fixes to filtering

* fix `matches` value when solr unavailable, to avoid further error
* if filtering down to no results, show "0 of 0 results" rather than
  "no open tickets"
* HTML validation


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/19b4b8a7
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/19b4b8a7
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/19b4b8a7

Branch: refs/heads/master
Commit: 19b4b8a78476ffd76352ad68cbb725594de720e6
Parents: 1c889ca
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Wed Apr 30 18:14:02 2014 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Apr 30 18:14:02 2014 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/model/ticket.py                          | 2 +-
 ForgeTracker/forgetracker/templates/tracker/index.html             | 2 +-
 .../templates/tracker_widgets/ticket_search_results.html           | 2 +-
 ForgeTracker/forgetracker/tests/functional/test_root.py            | 2 +-
 ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js      | 1 +
 5 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/19b4b8a7/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index 847b814..1d35cc6 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -1167,7 +1167,7 @@ class Ticket(VersionedArtifact, ActivityObject, VotableArtifact):
             solr_error = None
         except SearchError as e:
             solr_error = e
-            matches = []
+            matches = None
         if matches:
             count = matches.hits
             # ticket_numbers is in sorted order

http://git-wip-us.apache.org/repos/asf/allura/blob/19b4b8a7/ForgeTracker/forgetracker/templates/tracker/index.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/index.html b/ForgeTracker/forgetracker/templates/tracker/index.html
index 1f4cf52..3d7c5d1 100644
--- a/ForgeTracker/forgetracker/templates/tracker/index.html
+++ b/ForgeTracker/forgetracker/templates/tracker/index.html
@@ -56,7 +56,7 @@
   {% if help_msg %}
     <div id="search-ticket-help-msg" class="grid-19 info">{{g.markdown.convert(help_msg)}}</div>
   {% endif %}
-  {% if count %}
+  {% if count or filter %}
     {{c.ticket_search_results.display(solr_error=solr_error,
       count=count,
       limit=limit,

http://git-wip-us.apache.org/repos/asf/allura/blob/19b4b8a7/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
b/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
index e3d6f7e..f9ee976 100644
--- a/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
+++ b/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
@@ -39,7 +39,7 @@
                 <li>
                   <select name="filter-{{col['name']}}" data-label="{{col['label']}}"
multiple="multiple">
                     {% for o in widget.filters[col['name']] %}
-                      <option value="{{o['value']}}"{% if o['selected'] %} selected="selected"{%
endif %}>{{o['label']}}</label>
+                      <option value="{{o['value']}}"{% if o['selected'] %} selected="selected"{%
endif %}>{{o['label']}}</option>
                     {% endfor %}
                   </select>
                 </li>

http://git-wip-us.apache.org/repos/asf/allura/blob/19b4b8a7/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index f3b4667..8063873 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -2328,7 +2328,7 @@ class TestFunctionalController(TrackerTestController):
         self.new_ticket(summary='test2')
         query_filter_choices.return_value = {'status': [('open', 2)], }
         r = self.app.get('/bugs/')
-        assert '<option value="open">open (2)</label>' in r
+        assert '<option value="open">open (2)</option>' in r
         assert query_filter_choices.call_count == 1
         assert query_filter_choices.call_args[0][0] == '!status_s:wont-fix && !status_s:closed'
 

http://git-wip-us.apache.org/repos/asf/allura/blob/19b4b8a7/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js b/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js
index 2eecbb3..138270c 100644
--- a/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js
+++ b/ForgeTracker/forgetracker/widgets/resources/js/ticket-list.js
@@ -150,6 +150,7 @@
     });
 
     function select_active_filter() {
+      /* this 'filter' var is set in HTML */
       for (var name in filter) {
         var fname = 'filter-' + name;
         var $select = $('select[name="' + fname + '"]');


Mime
View raw message