Git Merge Request #128: Added nav feature to goto next and prev tickets (open)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Rohan Verma wants to merge 4 commits from /u/rhnvrm/allura/ to master, 2016-06-14

Sample:

Please review and suggest further modifications.

Commit Date  
[4d6e6f] (feature-nav-tickets) by Rohan Verma Rohan Verma

Partially working method with setting cookie via js

2016-06-12 18:03:21 Tree
[ae6e5c] by Rohan Verma Rohan Verma

Added cookie when visiting from tracker

2016-06-09 08:52:33 Tree
[ca9664] by Rohan Verma Rohan Verma

Changed carets to font-awesome so that they are consistent in other browsers

2016-06-08 09:45:53 Tree
[f3424d] by Rohan Verma Rohan Verma

Added nav feature to goto next and prev tickets

2016-05-20 22:19:08 Tree

Discussion

  • Rohan Verma - 2016-05-20
     
    • Dave Brondsema

      Dave Brondsema - 2016-05-24

      This works ok for going through every ticket, but the feature request is to go through the current search results. I think that would be much more useful too. But it would require somehow keeping track of what the "current" result list is.

      Also, relatively minor, but in Chrome the arrow characters have different heights, not sure why.

       
      • Rohan Verma - 2016-05-24

        I think I misinterpreted the requirement.

        Bugzilla implents this using a cookie called BUGLIST set to store the results of the search. Should I use this approach?

        http://turbogears.org/1.0/docs/Cookies.html#

         

        Last edit: Rohan Verma 2016-05-24
        • Dave Brondsema

          Dave Brondsema - 2016-05-24

          Yep that would work. maximizeView is a setting that uses a cookie, as an example. Another option is to use the existing session cookie instead of a new cookie. diformat is a setting that is an example like that. Downside there is that it can only be used server-side, not from JS.

           
  • Rohan Verma - 2016-06-14

    Update on progress on this merge request.

    I have been able to set the cookies and the navigation seems to work properly but only for a few cases.

    1. All search results are not setting the cookie, only for the main tracker. I believe this is because I have placed the js to set the cookie inside ticket_search_results.html
    2. If a result has more tickets than the number displayed, this method of setting using js array fails.
    3. Also, a button to return to the previous search will be required. Currently, to my knowledge I can only search in this fashion ?q=ticket_num:12 but I am not sure about how to display say ?q=ticket_num:12,32,41,45 like bugzilla does. Or I could save the url instead. I am not sure on how to go about this.
    4. Also, proper tests need to be written for this.
     

    Last edit: Rohan Verma 2016-06-14
  • Dave Brondsema

    Dave Brondsema - 2016-06-14

    1. what do you mean by the main tracker?

    3. ticket_num:(12 32 41 45) should work. You can also put OR between them, but that is the simplest form. Using the URL sounds like a good option too, so that users can get to their original search criteria.

    Do we have any risks of hitting a max cookie size? E.g. if a search has thousands of results.

     
    • Rohan Verma - 2016-06-15
      1. https://forge-allura.apache.org/p/allura/tickets/ is setting the cookie but https://forge-allura.apache.org/p/allura/tickets/search/?q=abc is not.

      2. Okay, will try using the URL.

      Cookies have a maximum size of ~4kB I think. There might be a chance of hitting this cap. I'm thinking of trying some helper function so that we don't need to use cookies.

       
      • Dave Brondsema

        Dave Brondsema - 2016-06-17

        ticket_search_results.html is the right place to put it, that should run on all listings of tickets, not sure why it wouldn't be working

        localStorage could be an alternative to cookies, but really you have thousands of results you probably aren't going to go through all of them one at a time, so we could just have a hard limit of the number of tickets we put in the cookie

         

Log in to post a comment.