Skip to content

fix(api-explorer): resolve extension routes to absolute Looker host URLs#1735

Draft
Itzaprado wants to merge 1 commit into
mainfrom
routing-fix
Draft

fix(api-explorer): resolve extension routes to absolute Looker host URLs#1735
Itzaprado wants to merge 1 commit into
mainfrom
routing-fix

Conversation

@Itzaprado

Copy link
Copy Markdown

Description

Fixes b/532671853.
In Looker Extension mode, right-clicking a link and selecting "Open link in new tab" resolves the relative URL against the sandboxed iframe origin instead of the parent Looker host origin.

This PR:

  1. Adds a resolveRouteToAbsoluteUrl method to environment adaptors (BrowserAdaptor and ExtensionAdaptor).
  2. Updates ExtensionAdaptor to construct absolute parent window URLs using lookerHostData.
  3. Updates the custom Link component to render absolute URLs in href when running in Extension mode, while intercepting normal left-clicks to perform internal memory-routing.
  4. Changes documentation references to use the smart Link wrapper instead of react-router-dom's default Link.

Fixes b/532671853 where right-clicking and opening links in new tabs
inside Looker API Explorer extension opened sandboxed iframe URLs.

Introduces `resolveRouteToAbsoluteUrl` method to environment adaptors.
Updates the global `Link` component to render absolute URLs in `href`
while intercepting left-clicks for internal routing in extension mode.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@github-actions

Copy link
Copy Markdown
Contributor

APIX Tests

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit c9449b1. ± Comparison against base commit c2bf549.

@github-actions

Copy link
Copy Markdown
Contributor

Typescript Tests

  2 files  ±0   56 suites  ±0   1m 2s ⏱️ -1s
209 tests ±0  207 ✅ ±0  2 💤 ±0  0 ❌ ±0 
446 runs  ±0  442 ✅ ±0  4 💤 ±0  0 ❌ ±0 

Results for commit c9449b1. ± Comparison against base commit c2bf549.

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.

1 participant