-
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
[Dashboard] Remove URL Generator #121832
[Dashboard] Remove URL Generator #121832
Conversation
Closing for now, blocked on #122300 |
Pinging @elastic/kibana-presentation (Team:Presentation) |
@elasticmachine merge upstream |
x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/utils.js
Outdated
Show resolved
Hide resolved
Testing the ML changes and I think there must have been a regression or format change with the new Dashboard locator, where the query is not being reflected the generated url. Potentially out of the scope of this PR, but good to address in 8.1. For the same payload: {
"dashboardId": "edf84fe0-e1a0-11e7-b6d5-4dc382ef7f5b",
"timeRange": {
"from": "$earliest$",
"to": "$latest$",
"mode": "absolute"
},
"filters": [],
"query": {
"language": "kuery",
"query": "clientip:\"$clientip$\""
},
"useHash": false
} With the url generator (using main branch):
With the new locator (notice there's no 'query' here):
|
Yes you are correct, there has been a format change! The Locator is capable of sending state via the router state rather than sending everything through the URL. This is causing this issue, which is being fixed. When you click through the link, the query comes through correctly, right? It may not work so far when you open in new tab, but we will work on that when we fix the issue above. |
@elasticmachine merge upstream |
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.
SIEM changes LGTM!
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.
Looks good to me. One small little nit but nothing major
const createDashboardUrl = useKibana().services.dashboard?.dashboardUrlGenerator?.createUrl; | ||
const savedObjectsClient = useKibana().services.savedObjects.client; | ||
const { | ||
dashboard, |
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 you further destructure locator out of here, since I think that's the only part of dashboard that it uses. Then the hook can only have a dependency on the locator?
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.
Unfortunately we can't destructure locator out of dashboard, because the dashboard service is optional.
Indeed that seems to be the case but this behavior is a blocker for us since it doesn't make sense specifically in our UI (for this use case) to open the link in the same tab. More importantly, we rely on this service in order to generate custom url formats for Anomaly detection alerts, so ideally the url generated should be correct. I'll give this PR a test #124770 but our preference is that the fix should be merged before this PR goes in. |
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
Unreferenced deprecated APIs
History
To update your PR or re-run it, just comment with: |
* Remove deprecated and unused dashboard URL generator code Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co> (cherry picked from commit 4394293)
Friendly reminder: Looks like this PR hasn’t been backported yet. |
@ThomThomson how do I test this PR please? Thanks! |
Hey @bhavyarm, there aren't really any user-facing tests you can run against this. It's mostly a behind-the-scenes change. If you wanted to verify that everything still works, you could could test the sharing functionality of the dashboard, snapshot and saved object share, as well as dashboard to dashboard drilldowns. |
Summary
Part of #121823
Part of #103846
Removes the deprecated URL Generator from the dashboard API