Skip to content
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

Replace option for navigateToApp #68527

Closed
flash1293 opened this issue Jun 8, 2020 · 4 comments · Fixed by #68700
Closed

Replace option for navigateToApp #68527

flash1293 opened this issue Jun 8, 2020 · 4 comments · Fixed by #68700
Assignees
Labels
Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@flash1293
Copy link
Contributor

Currently core.application.navigateToApp is always writing a new history entry for doing a navigation (

this.history ? this.history.push(url, state) : redirectTo(basePath.prepend(url));
).

In some cases when no history entry should be written, a replace option should be available.

One use case for this is redirecting legacy routes - in that case producing a history entry will cause the browser back button to break because it will just lead to the redirected route again.

cc @restrry

@flash1293 flash1293 added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Jun 8, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@pgayvallet
Copy link
Contributor

pgayvallet commented Jun 8, 2020

One use case for this is redirecting legacy routes

By legacy route, you means route to a legacy plugin? Because when navigating from and/or to a legacy app, we are not using the history and just performing a plain window.location.assign instead.

redirectTo = (path: string) => {
window.location.assign(path);
},

So we would need to handle both cases when implementing replace, correct?

@flash1293
Copy link
Contributor Author

flash1293 commented Jun 9, 2020

@pgayvallet

By legacy route, you means route to a legacy plugin?

That was badly worded by me - legacy route doesn't mean legacy plugin necessarily. Just in general when a route has moved and requests to the old one should be redirected to the new one.

For my use case it's not necessary to support legacy routing.

@pgayvallet pgayvallet self-assigned this Jun 9, 2020
@pgayvallet
Copy link
Contributor

Blocker for #68284 that needs to lands in 7.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants