-
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
[Enterprise Search] Update apps to use a service for docs links #89425
[Enterprise Search] Update apps to use a service for docs links #89425
Conversation
FYI @chriscressman -- this is a thing. |
@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.
This is great, thanks, Scotty!
Thanks @constancecchen. That was my first thought as well and I tried that. Unfortunately, the |
My diff/commit is currently working as-is locally for me without issue. Want to hop on a screen share? |
Actually, that's super strange. It's working on http://localhost:5601/xlc/app/enterprise_search/overview/setup_guide (and all other setup guides), but it looks like you're correct that it's not working for that specific Workplace Search documentation link. Odd, looking into this now EDIT: It's also working for http://localhost:5601/xlc/app/enterprise_search/app_search/settings/account (app search docs link). I suspect something is wrong with that specific Workplace Search doc link |
After some debugging w/ Scotty I've figured out that this is a very weird race condition, and sometimes does and doesn't work. e.g. App Search links were working for me initially but after some hard refreshes stopped working. So we can't rely on moving initialization to |
x-pack/plugins/enterprise_search/public/applications/shared/doc_links/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts
Outdated
Show resolved
Hide resolved
...rch/public/applications/app_search/components/engine_overview/engine_overview_empty.test.tsx
Outdated
Show resolved
Hide resolved
...rch/public/applications/app_search/components/engine_overview/engine_overview_empty.test.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/cloud/instructions.tsx
Outdated
Show resolved
Hide resolved
...rch/public/applications/app_search/components/engine_overview/engine_overview_empty.test.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Constance <[email protected]>
Co-authored-by: Constance <[email protected]>
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.
🙇♀️ Thanks so much for doing this work Scotty!!
this.enterpriseSearchBase = docLinks.links.enterpriseSearch.base; | ||
this.appSearchBase = docLinks.links.enterpriseSearch.appSearchBase; | ||
this.workplaceSearchBase = docLinks.links.enterpriseSearch.workplaceSearchBase; | ||
this.cloudBase = `${docLinks.ELASTIC_WEBSITE_URL}guide/en/cloud/current`; |
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.
[not a blocker, just leaving this comment here before I forget it] It would be awesome to directly add cloudBase
into the Kibana core helper someday! I'm sure other plugins might need it at some point
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
This is great. Thanks for moving us over to the docs links service so quickly Scotty! |
…tic#89425) * Create DocLinksService * Set docLinks on app start * Update routes modules to use service * Update component and test to use service * Remove legacy files * Add comment Co-authored-by: Constance <[email protected]> * Add new line Co-authored-by: Constance <[email protected]> * Refactor test * Rename class and remove extra route segments * Update test names Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Constance <[email protected]>
…) (#89785) * Create DocLinksService * Set docLinks on app start * Update routes modules to use service * Update component and test to use service * Remove legacy files * Add comment Co-authored-by: Constance <[email protected]> * Add new line Co-authored-by: Constance <[email protected]> * Refactor test * Rename class and remove extra route segments * Update test names Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Constance <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Constance <[email protected]>
Summary
Adds a local DocLinks service in Enterprise Search to facilitate using the Kibana DocLinksService.
I tried to hook into KibanaLogic with the data but both the routes files are instantiated before the logic mounts and this was the only way I could get the values into our apps at the start of the app lifecycle. Open to suggestions if there is a better way.
Best to follow along by commit.
Checklist