portagenetwork / roadmap

Developed by the the Alliance in collaboration with University of Alberta, DMP Assistant a data management planning tool, forking the DMP Roadmap codebase
MIT License
6 stars 1 forks source link

Pagination issues on "Research Outputs" tab #935

Closed laceysanderson closed 1 week ago

laceysanderson commented 1 month ago

Please complete the following fields as applicable:

I tested this on the following browsers and observed the same behaviour in all of them.

What version of the DMPRoadmap code are you running? (e.g. v2.2.0)

As a user I am not sure of this. However, I am specifically using the https://dmp-pgd.ca installation of this software. Furthermore, I was told to use the 'Climate Smart Data Collaboration Centre' template created by the 'University of Guelph'.

Expected behaviour:

On the "Research Outputs" tab, you have the option to add multiple research outputs. When you have added more then 10 research outputs pagination controls show up. We currently have 11 outputs entered, which has caused the controls to appear.

When I click on the "View all" link, I expect to see some indication that the page contents have changed and also, I expect to see all my outputs. When I click on the "Next" or "2" links, I expect the page to change showing me my single extra output entry (i.e. I expect to see a table with my last entry in it).

Additionally, when I enter a search string in the search box and click search, I expect to see the entries matching my search.

Actual behaviour:

When I click on the "View all" link, I expect to see some indication that the page contents have changed and also, I expect to see all my outputs. When I click on the "Next" or "2" links, I expect the page to change showing me my single extra output entry (i.e. I expect to see a table with my last entry in it).

When I click "View all" there is absolutely no change in the page, no javascript feedback and I still only see 10 results. Furthermore, when I open the link in a new page to try to rule out ajax issues, the page https://dmp-pgd.ca/paginable/plans/<plan_id>/research_outputs/index/ALL is not found. The same lack of change is observed for the "Next" and "2" links. Again, opening the "Next" or "2" in a new page (i.e. https://dmp-pgd.ca/paginable/plans/<plan_id>/research_outputs/index/2?sort_direction=asc&sort_field=research_outputs.title) results in a page not found.

ResearchOutputs

Additionally, when I enter a search string in the search box and click search, I expect to see the entries matching my search.

I enter the string "Act2.3" which is part of the title of 4 results in my outputs including 1 not shown on the first page. Then I click search and receive no feedback. Again the page does not change and continues to show the 10 results.

ResearchOutputsSearch

When I enter one more research output (total 12) I now see the ajax spinner but still observe the same lack of change in the result table and opening the links in a new page still do not show the missing results.

ResearchOutputsPagingSpinner

Steps to reproduce:

  1. Select the ‘My Dashboard’ option located at the top of the webpage (this will show all the DMPs that you have created or have rights to)
  2. Select ‘Create Plan’.
  3. To locate the CS-DCC template – choose ‘University of Guelph’ as the Primary Research Organization as follows:
  4. Under the ‘Template’ selection, please scroll down to find the ‘Climate Smart Data Collaboration Centre’ template.
  5. Click the 'Research Outputs' tab. Then enter 10+ research outputs by clicking the 'Add a research output' button and filling out the required fields. Ensure a few outputs contain a common substring in the title for testing the search later.
  6. Once you have 11 research outputs, notice the pagination links are activated. Click on "View all" and observe that you do not see 100 results in the table. Click on the "Next" and "2" and observe they also do not change the current entries in the table.
  7. Now enter the common substring in the search box at the top of the table in the hopes you can get around the bug this way. Click the 'Search' button and again notice no feedback and no change in the number or composition of the results in the table.
  8. Right click on the "View all" link to try to open the results in a new page and notice that the new page shows 'page not found'.
  9. Add one more research output (you now have 12 total) and repeat steps 6-8. At this point, I now see the ajax spinner when I click on links but still no change in the table results and opening the links in a new page still shows 'page not found'.

NOTE: When I download my plan, I can confirm that all the research outputs are present and that the issue is with the display and not the saving of the outputs.

NOTE: When I open my browser developer tools in Firefox, I only see errors in the console related to pages not being found. See following for an example:

Screenshot 2024-10-25 at 12 39 27 PM
aaronskiba commented 1 month ago

Hi laceysanderson, thank you very much for submitting this issue and bringing it to our attention! 🙏

aaronskiba commented 1 month ago

I am able to replicate the behaviour in development and encountered the following error there:

Started GET "/paginable/plans/14276/research_outputs/index/ALL" for 127.0.0.1 at 2024-10-29 09:11:55 -0600
   (4.8ms)  SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC

ActionController::RoutingError - uninitialized constant Paginable::ResearchOutputsController
            constant.const_get(name, false)
                    ^^^^^^^^^^
Did you mean?  ResearchProjectsController
            raise MissingController.new(error.message, error.name)
            ^^^^^:

Paginable::ResearchOutputsController is not being found because it does not currently exist (https://github.com/portagenetwork/roadmap/tree/deployment-portage/app/controllers/paginable).

I will create the Paginable::ResearchOutputsController along with the needed index action there.

laceysanderson commented 1 month ago

Awesome! I'm glad it was reproducible and not something harder to trigger 😃 I hope it's easy to fix!

laceysanderson commented 1 month ago

Note: I also didn't see the search results reflected either in case that got lost in the issue description above. In hindsight I perhaps should have created a separate issue for that but I was uncertain what you would prefer as I don't see many issues posted from outside your development team.

PS. I use docker extensively in my work and have experience in web development. Let me know if you would like me to test a PR when the time comes :relaxed:

aaronskiba commented 1 month ago

I am able to replicate the behaviour in development and encountered the following error there:

Started GET "/paginable/plans/14276/research_outputs/index/ALL" for 127.0.0.1 at 2024-10-29 09:11:55 -0600
   (4.8ms)  SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC

ActionController::RoutingError - uninitialized constant Paginable::ResearchOutputsController
            constant.const_get(name, false)
                    ^^^^^^^^^^
Did you mean?  ResearchProjectsController
            raise MissingController.new(error.message, error.name)
            ^^^^^:

Paginable::ResearchOutputsController is not being found because it does not currently exist (https://github.com/portagenetwork/roadmap/tree/deployment-portage/app/controllers/paginable).

I will create the Paginable::ResearchOutputsController along with the needed index action there.

app/controllers/paginable/api_clients_controller.rb is also absent from app/controllers/paginable/. I've created the following upstream issue in regard to this: https://github.com/DMPRoadmap/roadmap/issues/3464

aaronskiba commented 1 month ago

Note: I also didn't see the search results reflected either in case that got lost in the issue description above. In hindsight I perhaps should have created a separate issue for that but I was uncertain what you would prefer as I don't see many issues posted from outside your development team.

PS. I use docker extensively in my work and have experience in web development. Let me know if you would like me to test a PR when the time comes ☺️

No problem, this issue was excellently crafted. Thank you again for discovering such a consequential bug and bringing it to our attention. :)

I also appreciate the willingness to test out the PR. I have something up (PR https://github.com/portagenetwork/roadmap/pull/938), but there's also an outstanding issue with our Docker setup (https://github.com/portagenetwork/roadmap/issues/556). :( (Web developers like yourself definitely inspire me to get cracking on that one! 🙏

laceysanderson commented 4 weeks ago

I'm so glad it was helpful!

It's too bad the docker is not up to date so I can test it. My background is Drupal/PHP/JS/React otherwise I'd jump in to help you with your docker upgrade as I'm pretty passionate on that front :-) Having up to date docker support for your project not only helps people contribute with less barriers but also makes it very clear which versions of dependencies you support or are testing on and it makes it so easy to set up matrixed automated testing using Github actions to test on multiple versions. Sorry, as I said -passionate 🙈 Let me know if there is any way I can help further and I'll be happy to update you once these changes are live on https://dmp-pgd.ca/

laceysanderson commented 1 week ago

Nice!!! 😍 Any idea when these updates might be available on https://dmp-pgd.ca/?

aaronskiba commented 1 week ago

Nice!!! 😍 Any idea when these updates might be available on https://dmp-pgd.ca/?

I'm hoping for early next week.🤞I'll send another message when it's finally up. :)

EDIT: I've deployed a UAT instance and created an example plan. I added you as an editor using the usask email you have on your GitHub profile. If you'd like, please feel free to test the research outputs section. :)