-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure ScopedHistory consistently regardless of URL used to mount app #75074
Conversation
@joshdover I can confirm that the change fixes the bug. |
1ebce54
to
514a50d
Compare
514a50d
to
0bfb4b4
Compare
<AppContainer | ||
appPath={url} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I did not fix the legacy route below. Changing it caused a lot of test failures + no apps are currently using this and it is slated for removal in #74911
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't find proper documentation for it, what is the actual difference between match.url
and match.path
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the docs:
path - (string) The path pattern used to match. Useful for building nested s
url - (string) The matched portion of the URL. Useful for building nested s
From what I can gather, path
will always be the path that was passed to the Route component that matched, while url
will be the portion of the URL that matched. I think that can include the /
, whereas our path
never has a trailing slash unless the application explicitly includes on in the appRoute
parameter.
it('redirects and renders correctly regardless of trailing slash', async () => { | ||
await navigateTo(`/app/foo`); | ||
await waitForUrlToBe('/app/foo/home'); | ||
await testSubjects.existOrFail('fooAppHome'); | ||
await navigateTo(`/app/foo/`); | ||
await waitForUrlToBe('/app/foo/home'); | ||
await testSubjects.existOrFail('fooAppHome'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to find a way to test this more directly but wasn't able to find a good way of doing so without depending on the implementation details of ScopedHistory. Replicating the buggy behavior in #75051 seemed like the best option available.
Pinging @elastic/kibana-platform (Team:Platform) |
@elasticmachine merge upstream |
…pp (elastic#75074) Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* master: (71 commits) [Lens] Show 'No data for this field' for empty field in accordion (elastic#73772) Skip failing lens test Configure ScopedHistory consistenty regardless of URL used to mount app (elastic#75074) Fix returned payload by "search" usage collector (elastic#75340) [Security Solution] Fix missing key error (elastic#75576) Upgrade EUI to v27.4.1 (elastic#75240) Update datasets UI copy to data streams (elastic#75618) [Lens] Register saved object references (elastic#74523) [DOCS] Update links to Beats documentation (elastic#70380) [Enterprise Search] Convert our `public_url` route to `config_data` and collect initialAppData (elastic#75616) [Usage Collection Schemas] Remove Legacy entries (elastic#75652) [Dashboard First] Lens Originating App Breadcrumb (elastic#75470) Improve login UI error message. (elastic#75642) [Security Solution] modify circular deps checker to output images of circular deps graphs (elastic#75579) [Data Telemetry] Add index pattern to identify "meow" attacks (elastic#75163) Migrate CSP usage collector to `kibana_usage_collection` plugin (elastic#75536) [Console] Get ES Config from core (elastic#75406) [Uptime] Add delay in telemetry test (elastic#75162) [Lens] Use index pattern service instead saved object client (elastic#74654) Embeddable input (elastic#73033) ...
💚 Build SucceededBuild metricspage load bundle size
History
To update your PR or re-run it, just comment with: |
Summary
Fixes #75051
This ensures that the app's base path rather than the current URL is used to configure the ScopedHistory instance passed to an application. This allows for more consistent behavior when mounting an app when the URL is
/app/<appId>/
and/app/<appId>
.Release Note
A bug was fixed that caused some applications to not correctly render when a trailing slash was included at the end of their URLs.
Checklist
Delete any items that are not applicable to this PR.
For maintainers