Skip to content

fix(ui): browser back button on "all"-pages#2005

Merged
msavy merged 2 commits into
masterfrom
fix-back-button-on-consumer-pages
May 6, 2022
Merged

fix(ui): browser back button on "all"-pages#2005
msavy merged 2 commits into
masterfrom
fix-back-button-on-consumer-pages

Conversation

@volkflo

@volkflo volkflo commented May 5, 2022

Copy link
Copy Markdown
Member

By directly linking to the URL with query parameters we automatically load the first page. This avoids reloading the first page via loadFirstPage() 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

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
@volkflo
volkflo requested a review from msavy May 5, 2022 09:27
@volkflo volkflo self-assigned this May 5, 2022
msavy
msavy previously approved these changes May 5, 2022
</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">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you explain the cp and ps?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Current page and page size I guess

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

image

@msavy msavy May 5, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you guys add that?/ I don't remember that being the behaviour Apiman had historically (limiting page size to 12)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Okay, let's just leave it for now. Perhaps needs to be a bit more flexible and signpost that you can search more easily.

@volkflo

volkflo commented May 5, 2022

Copy link
Copy Markdown
Member Author

Sorry forgot one file will push a fixup in a minute

@msavy
msavy self-requested a review May 5, 2022 09:36
@cypress

cypress Bot commented May 5, 2022

Copy link
Copy Markdown



Test summary

17 0 0 0


Run details

Project Apiman
Status Passed
Commit e2cbefa ℹ️
Started May 5, 2022 9:46 AM
Ended May 5, 2022 9:48 AM
Duration 02:27 💡
OS Linux Ubuntu - 20.04
Browser Electron 94

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

@msavy
msavy merged commit 3959c0b into master May 6, 2022
@msavy
msavy deleted the fix-back-button-on-consumer-pages branch May 6, 2022 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Browser back button does not work on "All APIs" page

2 participants