Fix #1316: Open API Docs in new tab and fix back navigation loading loop - #1391
Open
Iam-jayant wants to merge 12 commits into
Open
Fix #1316: Open API Docs in new tab and fix back navigation loading loop#1391Iam-jayant wants to merge 12 commits into
Iam-jayant wants to merge 12 commits into
Conversation
…ion loading loop Open API Docs sidebar link in a new tab by setting isOpenNewTab to true in sidebarCoreItems. Use window.location.replace instead of window.location.href in ApiReferencePage to prevent browser history loops and infinite loading state when navigating back. Add unit tests for sidebarCoreItems and ApiReferencePage.
Author
|
@kowser-orkes @ajlai-orkes @KunalKumar-1 Guys, review this one. |
Author
|
@ajlai-orkes review the changes |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (1)
ui-next/src/pages/apiDocs/tests/ApiReferencePage.test.tsx:19
- This test overwrites
window.locationbut never restores it, which can leak state into other tests and cause order-dependent failures. Prefer restoring the originalwindow.locationin anafterEach(or use a spy/stub onwindow.location.replacewithout replacing the whole object).
it("replaces location with swagger url on mount", () => {
const replaceMock = vi.fn();
Object.defineProperty(window, "location", {
configurable: true,
value: {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1316
Summary of Changes
isOpenNewTab: trueonswaggerIteminsidebarCoreItems.tsxso the "API Docs" sidebar link opens in a new browser tab.window.location.replaceinstead ofwindow.location.hrefinApiReferencePage.tsxto replace the history entry during redirection, preventing browser back-navigation loading loops.sidebarCoreItemsandApiReferencePage.