milleruntime commented on a change in pull request #424: Reverse default sort 
direction for tables in monitor
URL: https://github.com/apache/accumulo/pull/424#discussion_r181173036
 
 

 ##########
 File path: 
server/monitor/src/main/java/org/apache/accumulo/monitor/util/Table.java
 ##########
 @@ -110,7 +110,7 @@ public synchronized void generate(HttpServletRequest req, 
StringBuilder sb) {
       if (row.size() != columns.size())
         throw new RuntimeException("Each row must have the same number of 
columns");
 
-    boolean sortAscending = !"false".equals(BasicServlet.getCookieValue(req, 
"tableSort."
+    boolean sortDescending = "false".equals(BasicServlet.getCookieValue(req, 
"tableSort."
 
 Review comment:
   I tested your changes on localhost using Uno and the sorting isn't working 
correctly for me.  I believe the solution is actually simpler than the changes 
you proposed.  You should keep the sortAscending variable (since the cookie and 
http request still use "asc") and only change the initial assingment.  I think 
this will work:
   
   `boolean sortAscending = "true".equals(BasicServlet.getCookieValue(req, 
"tableSort."
           + BasicServlet.encode(page) + "." + BasicServlet.encode(tableName) + 
"." + "sortAsc"));`
   
   This should work since the initial value of the cookie is null,the first 
pass will produce sortAscending = false. Then it should store the value 
correctly whatever it is from then on.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to