Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paginated lit.Reference API #426

Merged
merged 11 commits into from
Jun 1, 2021
Merged

Paginated lit.Reference API #426

merged 11 commits into from
Jun 1, 2021

Conversation

rabstejnek
Copy link
Collaborator

@rabstejnek rabstejnek commented Apr 23, 2021

Create new REST API for paginated API for lit.Reference mirror the current TagsJSON API. The following
routes are possible:

  • /lit/api/assessment/:assessment_id:/references/?tag_id=:tag_id:
  • /lit/api/assessment/:assessment_id:/references/?tag_id=:tag_id:&search_id=:search_id:
  • /lit/api/assessment/:assessment_id:/references/?tag_id=untagged

The following frontend changes were made:

  • paginate references on lit tagtree modal reference browsing
  • create Paginator React component

To test, view any literature Tagtree and click a node w/ > 50 references. It should return much quicker than before and the list will have pagination at the bottom:
Screen Shot 2021-05-27 at 3 19 11 PM

Additional unrelated changes:

  • found fixed a few cases where instance.assessment.id was used instead of instance.assessment_id to prevent extra queries
  • wrap html on long lit.Search import strings
  • filter openapi warnings on unit tests
  • remove @action(methods=("get",)) since that is the default

In the future, additional changes will be made to migrate to these APIs.

@shapiromatron shapiromatron changed the title Paginated reference API Paginated lit.Reference API May 26, 2021
Copy link
Owner

@shapiromatron shapiromatron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rabstejnek looked good, but i went ahead and implemented using it on the frontend so it doesn't become stale; please take a look at my changes and let me know what you think...

@rabstejnek
Copy link
Collaborator Author

@shapiromatron I checked it out on the front end, it looks good!

@shapiromatron shapiromatron merged commit 04ab7bc into main Jun 1, 2021
@shapiromatron shapiromatron deleted the lit-pagination branch June 1, 2021 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants