-
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
[Fleet] Replace hash router by router with scoped history #106267
[Fleet] Replace hash router by router with scoped history #106267
Conversation
9a13baf
to
44a8f85
Compare
44a8f85
to
f634deb
Compare
@elasticmachine merge upstream |
@elasticmachine merge upstream |
Pinging @elastic/fleet (Team:Fleet) |
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.
All looks good to me. Awesome work.
On the topic of adding redirects, I'm not totally sure. We've updated routes a few times (e.g. moving /fleet/epm
-> /integrations
) and neglected to add backwards-compatible redirects, but perhaps that's something we should try to remedy in this PR. Would be interested to get further thoughts from the team.
👋 Hey all, I know I'm a little early here, but since I saw the notification come across, I thought I'd leave my 2c.
I'm +1 on adding redirects to avoid breaking bookmarks if it's easy enough to do. I've seen other Kibana applications do something like this to replace their default "catch all" route: <Route render={({ location }) => (
location.pathname === '/' && location.hash.length > 0
? <Redirect to={{ ...location, pathname: location.hash, hash: undefined }} />
: <Redirect to={FLEET_ROUTING_PATHS.agents} />
)}
/> |
@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.
I'm going to check this out next and try it out manually using the Endpoint page links and expected behaviors when redirecting to fleet.
I left some comments, but also: there several places in Security Solution that need updating. I did these searches:
'fleet'
#/fleet
pagePathGetters.
(yes, some of our links pre-date the existence of pagePathGetters
😞 ) and found several instances. Looks like these will still work, given that you have a <Redirect />
in place, so if you rather not make these change at this time, just let me know and I can open a Tech. Debt item in our side to update.
x-pack/plugins/fleet/public/applications/integrations/hooks/use_breadcrumbs.tsx
Show resolved
Hide resolved
x-pack/test/security_solution_endpoint/page_objects/fleet_integrations_page.ts
Show resolved
Hide resolved
Checked it out locally and the redirects are not working. Example: These links:
seem to all be riderecting to their respective lists instead of the details. If you would like to get some data into your dev env. to be able to display the endpoint pages, run:
This will also create "fake" agents in fleet along with agent policies. |
@paul-tavares for the redirect the correct url in fleet with hash was |
Ohhhh. this is a bug then on our side - I have a feeling there is a discrepancy between the |
@paul-tavares My bad routes are not starting by #/fleet I am going to fix the redirect (only the agents routes are prefixed by |
@nchaulet - Yeah, I just checked and the links i posted above are correct in 8.0.0 - meaning that they send the user to the expected location. Even the one to the Agent details seems to work and does not have the |
@paul-tavares just pushed a fix to the redirect and also fixed a bunch of hash urls in |
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.
Checked it out again and ran it, and it all works as expected. Thank you for the changes in the Security Solution code 🙏
🚢 🚢 🚢
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Any counts in public APIs
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: cc @nchaulet |
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…106709) Co-authored-by: Nicolas Chaulet <[email protected]>
Summary
Resolve #96134
Remove the use of hash router in fleet and use scope history instead.
(Url will change for example
/app/fleet#/agents
=>/app/fleet/agents
)We are going to redirect old urls to new one without hash.
Tasks done in this PR
Fleet
Integrations
Cross app