Thanks a lot. Will give a try and let you know On Thu, Jun 21, 2018 at 11:36 PM Dave Brondsema <d...@brondsema.net> wrote:
> Sounds good, pagination is definitely important if people have a lot of > tickets. > In the ForgeTracker tool forgetracker/model/ticket.py there are methods > paged_search() and paged_query() which might be good reference points. It > looks > like they probably can't be re-used directly, since they expect an > app_config, > and the dashboard will search across all ticket tracker apps. It also > supports > filtering and search terms that aren't needed. But it might be useful. > > There's other things in the ForgeTracker that might be useful too. Like > listing > the results with the TicketSearchResults class and > ticket_search_results.html > template. Again, those have things like filtering, configurable columns, > etc > that aren't necessary on the dashboard. But it could be a good reference > for > how paging is used, etc. > > I would recommend using a solr search rather than a mongo query to find the > tickets. That is because the Ticket class does not have a mongo index for > the > submitter, and so querying by submitter could be very slow when there are > thousands and thousands of tickets. Searching with solr also would also > let us > support people filtering & searching their own tickets list, in the future > if we > wanted to do that (not necessary this summer). > > On 6/21/18 12:11 PM, Deshani Geethika wrote: > > Hi Dave, > > > > Currently I'm working on creating "Tickets Section" of Dashboard. I have > > implemented to load all of the tickets at once, but I thought to paginate > > this and I'm working on it. > > > > Will give you an update soon. If you have any suggestions please let me > > know. > > > > Regards! > > > > On Thu, Jun 14, 2018 at 12:22 AM Deshani Geethika < > deshanigeeth...@gmail.com> > > wrote: > > > >> Hi Dave, > >> > >> Thanks for reviewing and merging the above requests. > >> > >> I've created a helper method to avoid code duplication in > >> DashboardController.index and UserProfileApp.profile_sections, and > added a merge > >> request < > https://forge-allura.apache.org/p/allura/git/merge-requests/259/> > >> . > >> > >> Please review it and let me know if any improvements required. > >> > >> Regards! > >> > >> On Tue, Jun 12, 2018 at 1:20 AM Deshani Geethika < > >> deshanigeeth...@gmail.com> wrote: > >> > >>> Hi Dave, > >>> > >>> I've updated the above merge request > >>> <https://forge-allura.apache.org/p/allura/git/merge-requests/255/>, as > >>> I've fixed an issue in a template. > >>> > >>> Meanwhile, I started a new branch for dashboard tests and added a > simple > >>> test to check '/dashboard' route. I've created a new merge request > >>> <https://forge-allura.apache.org/p/allura/git/merge-requests/258/> for > >>> this. Please review it and let me know if any improvements required. > >>> > >>> Regards! > >>> > >>> On Sat, Jun 9, 2018 at 12:07 PM Deshani Geethika < > >>> deshanigeeth...@gmail.com> wrote: > >>> > >>>> Hi Dave, > >>>> > >>>> Thanks for the clarifications :) > >>>> > >>>> I've fixed the issues with test cases and updated the merge request > >>>> <https://forge-allura.apache.org/p/allura/git/merge-requests/255/>. > >>>> Please review it and let me know if any improvements required > >>>> > >>>> Regards! > >>>> > >>>> On Wed, Jun 6, 2018 at 8:56 PM Dave Brondsema <d...@brondsema.net> > >>>> wrote: > >>>> > >>>>> On 6/6/18 5:37 AM, Deshani Geethika wrote: > >>>>>> Hi Dave, > >>>>>> > >>>>>> I need some help in understanding an error related to test cases. > >>>>>> > >>>>>> I was trying to write a test case to check the '/neighborhood' route > >>>>> in > >>>>>> Allura/allura/tests/functional/test_root.py as below. > >>>>>> > >>>>>> def test_neighborhood(self): > >>>>>>> response = self.app.get('/neighborhood/') > >>>>>> > >>>>>> > >>>>>> But I get the following error, when I run the above test case. > >>>>>> > >>>>>> Traceback (most recent call last): > >>>>>>> File > >>>>>>> > >>>>> > "/home/deshani/env-allura/local/lib/python2.7/site-packages/nose/case.py", > >>>>>>> line 197, in runTest > >>>>>>> self.test(*self.arg) > >>>>>>> File > >>>>>>> > >>>>> > "/home/deshani/src/allura/Allura/allura/tests/functional/test_root.py", > >>>>>>> line 58, in test_neighborhood > >>>>>>> response = self.app.get('/neighborhood/') > >>>>>>> File > >>>>> "/home/deshani/src/allura/AlluraTest/alluratest/validation.py", > >>>>>>> line 322, in get > >>>>>>> resp = super(ValidatingTestApp, self).get(*args, **kw) > >>>>>>> File > >>>>> "/home/deshani/src/allura/AlluraTest/alluratest/validation.py", > >>>>>>> line 269, in get > >>>>>>> return super(PostParamCheckingTestApp, self).get(*args, > **kwargs) > >>>>>>> File > >>>>>>> > >>>>> > "/home/deshani/env-allura/local/lib/python2.7/site-packages/webtest/app.py", > >>>>>>> line 756, in get > >>>>>>> expect_errors=expect_errors) > >>>>>>> File > >>>>>>> > >>>>> > "/home/deshani/env-allura/local/lib/python2.7/site-packages/webtest/app.py", > >>>>>>> line 1118, in do_request > >>>>>>> self._check_status(status, res) > >>>>>>> File > >>>>>>> > >>>>> > "/home/deshani/env-allura/local/lib/python2.7/site-packages/webtest/app.py", > >>>>>>> line 1154, in _check_status > >>>>>>> res) > >>>>>>> AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect > for > >>>>>>> http://localhost/neighborhood/) > >>>>>> > >>>>>> > >>>>>> Can you help me to understand why this error comes up? > >>>>>> > >>>>>> Regards! > >>>>> > >>>>> > >>>>> Wow, this was a tricky one! I was stumped about this for a while > too. > >>>>> Its > >>>>> happening because of some helper code for tests, that is not very > >>>>> obvious. In > >>>>> Allura/allura/controllers/basetest_project_root.py a modified root > >>>>> controller is > >>>>> used for tests, which makes some project & tool testing easier. This > >>>>> controller > >>>>> is used because test.ini specifies > "override_root=basetest_project_root" > >>>>> > >>>>> And then in this controller on line 71 there is a list of root > >>>>> controller > >>>>> attributes that is hardcoded. So you will have to add 'neighborhood' > >>>>> and > >>>>> 'dashboard' to that list. > >>>>> > >>>>> I would also recommend adding a comment on the real RootController > >>>>> mentioning > >>>>> the BasetestProjectRootController so that anyone else in the future > who > >>>>> adds a > >>>>> root url knows that they have to update the other place too. > >>>>> > >>>>> > >>>>> > >>>>> -- > >>>>> Dave Brondsema : d...@brondsema.net > >>>>> http://www.brondsema.net : personal > >>>>> http://www.splike.com : programming > >>>>> <>< > >>>>> > >>>> > >>>> > >>>> -- > >>>> *Deshani Geethika* > >>>> Undergraduate at Department of Computer Science and Engineering > >>>> Faculty of Engineering - University of Moratuwa Sri Lanka > >>>> LinkedIn <https://www.linkedin.com/in/deshanigeethika/> | GitHub > >>>> <https://github.com/deshanigtk> | Mobile - +94776383034 > >>>> > >>>> > >>> > >>> -- > >>> *Deshani Geethika* > >>> Undergraduate at Department of Computer Science and Engineering > >>> Faculty of Engineering - University of Moratuwa Sri Lanka > >>> LinkedIn <https://www.linkedin.com/in/deshanigeethika/> | GitHub > >>> <https://github.com/deshanigtk> | Mobile - +94776383034 > >>> > >>> > >> > >> -- > >> *Deshani Geethika* > >> Undergraduate at Department of Computer Science and Engineering > >> Faculty of Engineering - University of Moratuwa Sri Lanka > >> LinkedIn <https://www.linkedin.com/in/deshanigeethika/> | GitHub > >> <https://github.com/deshanigtk> | Mobile - +94776383034 > >> > >> > > > > > > -- > Dave Brondsema : d...@brondsema.net > http://www.brondsema.net : personal > http://www.splike.com : programming > <>< > -- *Deshani Geethika* Undergraduate at Department of Computer Science and Engineering Faculty of Engineering - University of Moratuwa Sri Lanka LinkedIn <https://www.linkedin.com/in/deshanigeethika/> | GitHub <https://github.com/deshanigtk> | Mobile - +94776383034