Open P1llus opened 1 year ago
Hey! The hardcoded markdown does not give us many options, but a solution to create links that work on both pages (Dashboards App and the Security Dashboards page) would be to use hash #
relative links like:
[Agent Info](#/view/elastic_agent-0600ffa0-6b5e-11ed-98de-67bdecd21824)
This URL would still work in Dashboards App.
To make it work inside Security - Dashboards page we would have to redirect to the new ID if the hash is present
Basically, redirecting from:
/app/security/dashboard/[CURRENT_ID]#/view/[NEW_ID]
into this:
/app/security/dashboard/[NEW_ID]
I am not sure if it is possible to create a new Route to match this hash path and redirect, or if it is better to check the location.hash
in a useEffect(), but I think this should not be a big deal from our side.
It would provide us with a generic way to navigate inside dashboards.
Just have one question @P1llus. Is this considered a bug for the Integrations team?
Pinging @elastic/security-threat-hunting (Team:Threat Hunting)
Probably we could also intercept all navigations from inside the dashboards rendered in Security to /app/dashboards#view/:id
using this:
https://developer.mozilla.org/en-US/docs/Web/API/Navigation/navigate_event#handling_a_navigation_using_intercept
And redirect them to ourselves.
You won't need to update all dashboards. But that's a very hacky solution 😄🏴☠️
@semd we're also going to build a new system soon for Dashboard navigation which uses the Dashboard locator to navigate to links. Likely we can provide some sort of custom locator implementation that can be set at the Dashboard Container level to have full control over the URL when the Dashboard navigates.
@ThomThomson That sounds like a much better solution. @P1llus Do you think we can close this issue then? We can open a new one to implement the location customization when it is ready.
We released a links panel that should be used in these cases a year ago https://www.elastic.co/guide/en/kibana/current/dashboard-links.html, can we close this issue?
Most new security integrations (including older ones that has received dashboard rewrites/updates) usually include some sort of navigation panel, example:
These use hash based links like so:
[Agent Info](/app/dashboards#/view/elastic_agent-0600ffa0-6b5e-11ed-98de-67bdecd21824)
Since the amount of integrations that uses this is only growing, and they will soon be embedded into the Security Solutions dashboard section, it would be good if these links can keep on working, while still being inside the embedded solution.