Add pagination to search results
What does this MR do and why?
Adds pagination for Google search results. This allows visitors to browse results beyond the first 10.
This MR also adds a GlLoadingIcon
component to show a spinner while waiting for a response from the Google API.
Closes #1376 (closed)
Screenshots, screen recordings, or links to review app
Review app: https://1376-gps-load-more-results.docs.gitlab-review.app/search/?query=internet
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
- Compile the site with Google search:
SEARCH_BACKEND="google" GOOGLE_SEARCH_KEY="AIzaSyAUCkVNs7JsHYKISjVrVv1PGXg9WQr1MCQ" bundle exec nanoc compile
- Run a search that includes fewer than 10 results ("mongo" should do this) and verify no pager appears.
- Run a search that includes no results ("perjwoejfapsjdfaewojf" works) and verify no pager appears.
- Run a search with over 10 results ("git") and verify you can load results beyond the first set of 10.
Merge request acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this merge request.
Edited by Sarah German