-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Dasbhoard][Short URL] Parse embeded in the short URL #54403
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Didn't test yet, but please verify whether this works with both the "new" short url service and the old one that's still in place for a transition period. The old one is used when sessionStorage for state is enabled in the advanced settings. |
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.
✅ Tested it with the "new short url service"
❎ Tested it with the "old short url service", currently it doesn't work (thx for the hint @flash1293 )
I think the following code has to be adapted, also the forwarding from goto
to goto_LP
:
It's more work but we can "do this right' by migrating the remaining piece over to NP. The thing blocking this got merged recently: #52161 I would have started to work on this soon anyway. But I'm also fine with fixing this in both places to have this bug resolved for 7.6 Your call @majagrubic |
Thanks for spotting this 🙌 Let's do this the right way, even if it means it won't get in by 7.6 |
Adding the migration label as this just became a migration-relevant issue :) Thanks @majagrubic ! |
@joshdover The old implementation of short urls with session storage enabled used an injected var to place the actual target url into the meta data so the client can forward to the actual URL after hash the actual data ( A clean way of implementing this is something like this: Add a very small app via the core application service ( What do you think? Is there a better approach? |
@flash1293 The workaround you mentioned should work, though I'd recommend creating a "chromeless" application that has its own custom route that matches the backend route ( Though after taking a quick look at |
Thanks for the hint. I never worked with chromeless applications, so not 100% sure how they function - in most cases the redirected URL will resolve to something in the legacy plugin, so we would have to subsequently load the legacy
It's indeed hard to follow but the |
I'm sure it will work, but I think the question is whether or not that extra hop it is acceptable. Once the apps that this is redirecting to are on the New Platform, this wouldn't require a full-page refresh. Maybe it'd be better to hold off on migrating this part until most or all of the applications are running as NP apps. I don't see us adding support for injectedMetadata in the New Platform because it can slow down the perceived load time of Kibana by delaying the first byte of the response. Ideally we want to be loading everything as soon as we can so the user gets feedback quickly. |
@joshdover It's already doing a full page refresh, the only thing getting worse would be the roundtrip to the server fetching the redirect url whereas currently it's embedded within the initial html document. But as I'm thinking about it - it's also saving a roundtrip because it doesn't have to redirect. Current state:
State after the approach outlined above:
State after apps went to NP:
We could hack in something like injected meta data just for this one case (I know what you are thinking...) by manipulating the string returned by the render function to save roundtrip 2 because the unhashed URL will already be embedded into the initial HTML of the pageload. But it's probably not super important to do so and not worth introducing a hack which is difficult to maintain. |
Agreed, probably not worth it. Please add any thoughts you have to #54925 which I have opened to re-discuss adding an injected metadata-like API. |
Superseded by #58846 |
Summary
Fixes:
#50107
When parsing a short URL, we never took into account
embed
param. Once the param is set, the embedded dashboard is rendered correctly.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] This was checked for cross-browser compatibility, including a check against IE11- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorials- [ ] Unit or functional tests were updated or added to match the most common scenarios- [ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers