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

[Enterprise Search] Fix cross-application links & breadcrumbs #79530

Merged
merged 2 commits into from
Oct 5, 2020

Conversation

cee-chen
Copy link
Member

@cee-chen cee-chen commented Oct 5, 2020

Summary

I have no idea how I didn't notice this earlier or how this somehow wasn't broken for me locally until recently 🤦‍♀️

Problem

Our cross-Kibana-app links (created without React Router's history.createHref) are broken on local dev and on custom spaces because they're missing Kibana's basePath:

Correctly formed URL example:

Links missing basepath:

Solution

Updating our createHref helper to use http.basePath.prepend() per Kibana's docs/recommendation solves the issue:

QA

  • ALL breadcrumb links (including cross-application ones) are now properly working
  • Enterprise Search Overview product card links are correctly working, including in custom spaces

Checklist

- see https://www.elastic.co/guide/en/kibana/master/kibana-navigation.html
- for this change, we need to pass in the `http` lib as another dependency alongside `history` to createHelper
- Note that a lot of their createHref tests did not functionally change in output because Kibana mocks an empty basePath ('/') in tests
@cee-chen cee-chen added bug Fixes for quality problems that affect the customer experience Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.10.0 labels Oct 5, 2020
@cee-chen cee-chen requested a review from a team October 5, 2020 18:10
Copy link
Contributor

@scottybollinger scottybollinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch @constancecchen. Thanks for getting this in before FF

@cee-chen
Copy link
Member Author

cee-chen commented Oct 5, 2020

Thanks so much for the speedy reviews Scotty - you rock!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

async chunks size

id before after diff
enterpriseSearch 429.3KB 430.1KB +849.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@cee-chen cee-chen merged commit 1cf7f78 into elastic:master Oct 5, 2020
@cee-chen cee-chen deleted the fix-breadcrumbs branch October 5, 2020 19:48
cee-chen pushed a commit to cee-chen/kibana that referenced this pull request Oct 5, 2020
…c#79530)

* Update our cross-app links to correctly include Kibana basePaths

- see https://www.elastic.co/guide/en/kibana/master/kibana-navigation.html
- for this change, we need to pass in the `http` lib as another dependency alongside `history` to createHelper

* Update helpers using createHref to pass new expected dependency

- Note that a lot of their createHref tests did not functionally change in output because Kibana mocks an empty basePath ('/') in tests
cee-chen pushed a commit that referenced this pull request Oct 5, 2020
#79555)

* Update our cross-app links to correctly include Kibana basePaths

- see https://www.elastic.co/guide/en/kibana/master/kibana-navigation.html
- for this change, we need to pass in the `http` lib as another dependency alongside `history` to createHelper

* Update helpers using createHref to pass new expected dependency

- Note that a lot of their createHref tests did not functionally change in output because Kibana mocks an empty basePath ('/') in tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants