fix(ui): browser back button on "all"-pages#2005
Conversation
By directly linking to the URL with query parameters we automatically load the first page. This avoids reloading the first page via `loadFirstPage()` on in `consumer-orgs/apis.ts` which would create two browser history entries. Keeping `loadFirstPage()` is still useful to display the first results after reloading the page or after resetting the search. Closes: #1181
| </li> | ||
| <li class="list-group-item" id="apiman-sidebar-apis-consume" data-target="#apis-all_apis-tertiary"> | ||
| <a href="{{ pluginName }}/browse/apis"> | ||
| <a href="{{ pluginName }}/browse/apis?q=*&cp=1&ps=12"> |
There was a problem hiding this comment.
Current page and page size I guess
There was a problem hiding this comment.
Ah yes, so the browse/consume page uses the search endpoint.
So to avoid displaying an empty page on first page load we fetch the first page of a wildcard search (SearchBean).
q = querry
cp = currentPage
ps = pageSize This is a nice default which does not display to much data and plays nice with our 4x3 card layout.
There was a problem hiding this comment.
Did you guys add that?/ I don't remember that being the behaviour Apiman had historically (limiting page size to 12)
There was a problem hiding this comment.
I think that is the case since a while, apiman 2.x behaves the same.
You can change the page size in the UI if there are more entries to 25, 50 and 100 I think
There was a problem hiding this comment.
Okay, let's just leave it for now. Perhaps needs to be a bit more flexible and signpost that you can search more easily.
|
Sorry forgot one file will push a fixup in a minute |
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |

By directly linking to the URL with query parameters we automatically load the first page. This avoids reloading the first page via
loadFirstPage()inconsumer-orgs/apis.tswhich would create two browser history entries.Keeping
loadFirstPage()is still useful to display the first results after reloading the page or after resetting the search.Closes: #1181