[Shared UX] Complete package migration; delete plugin#138962
Conversation
|
Pinging @elastic/apm-ui (Team:apm) |
|
Pinging @elastic/uptime (Team:uptime) |
|
Sorry for the widespread pings, I rebased and ended up integrating the commits, rather than rebasing upon them. Apologies, should be all set now! |
|
Pinging @elastic/unified-observability (Team:Observability) |
6a6bc23 to
1b96f68
Compare
1b96f68 to
7261e65
Compare
spalger
left a comment
There was a problem hiding this comment.
Operations changes LGTM! So glad we've made it here
majagrubic
left a comment
There was a problem hiding this comment.
Code review only, let me know if there is a certain part here that needs to be actually tested.
| "server": "src/legacy/server", | ||
| "share": "src/plugins/share", | ||
| "sharedUX": "src/plugins/shared_ux", | ||
| "sharedUXComponents": "packages/kbn-shared-ux-components/src", |
| getRedirectAppLinksKibanaDependenciesMock() | ||
| getRedirectAppLinksKibanaDependenciesMock(), | ||
| { | ||
| isMergeableObject: isPlainObject, |
There was a problem hiding this comment.
deepmerge merges objects, so jest.fn() objects were also getting merged, which meant they were no longer mocked functions. isMergeableObject allows one to create a function to test if the object should be merged or not. In this case, I'm saying deepmerge should only merge the object if it passes lodash.isPlainObject.
| const { hasESData, hasUserDataView } = services; | ||
|
|
||
| return ( | ||
| <KibanaNoDataPageContext.Provider value={{ hasESData, hasUserDataView }}> |
There was a problem hiding this comment.
why do we need to explicitly destructure services here?
There was a problem hiding this comment.
services could include a lot of other things, as TS types do not prevent passing objects with more than is necessary. By destructuring first, we exclude anything extra that was passed, and keep the context value from being unintentionally bloated.
| <span>Second Item</span>, | ||
| ]; | ||
|
|
||
| export class StorybookMock extends AbstractStorybookMock< |
There was a problem hiding this comment.
This feels a bit overly complicated. Do we need this AbstractStorybookMock?
There was a problem hiding this comment.
I needed a way to make sure that all Storybook mocks followed the same API. This allows us to compose mocked values for services without having to know what services consumed components need.
I grant you: it's complicated. But it's working at the moment. We'll probably refactor it at some point, but I had to start somewhere.
maryam-saeidi
left a comment
There was a problem hiding this comment.
Code review only, Actionable Observability import changes LGTM.
nreese
left a comment
There was a problem hiding this comment.
kibana-gis changes LGTM
code review
8a53424 to
a99027e
Compare
alisonelizabeth
left a comment
There was a problem hiding this comment.
Import path change to the getting_started page in the home plugin LGTM
💚 Build Succeeded
Metrics [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
ESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
formgeist
left a comment
There was a problem hiding this comment.
I trust others have reviewed the code - just a designers approval here 😊
YulNaumenko
left a comment
There was a problem hiding this comment.
Security Solution changes LGTM!
|
Thank you all! |
* [Shared UX] Complete package migration; delete plugin * [CI] Auto-commit changed files from 'node scripts/generate packages_build_manifest' * Fix types, fix tests * Create Storybook config package; organize Storybook * [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs' * Revise Storybook config package; make mock packages compatible with web Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
* [Shared UX] Complete package migration; delete plugin * [CI] Auto-commit changed files from 'node scripts/generate packages_build_manifest' * Fix types, fix tests * Create Storybook config package; organize Storybook * [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs' * Revise Storybook config package; make mock packages compatible with web Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
This PR is large, but completes the migration of Shared UX components to the new package architecture in Kibana.
What does this PR do?
NoDataPage,NoDataConfigPageandKibanaPageTemplateinto separate packages.impl,mocksandtypespackages.@kbn/shared-ux-componentsand@kbn/shared-ux-servicespackages.@kbn/shared-ux-storybookpackage in favor of a local configuration:/packages/shared-ux/.storybook.sharedUXplugin and deletes it.What remains
You may see some
READMEfiles with boilerplate content. In my next PR, I'm reviewing and adding documentation to all of our component packages. I'm also adding more tests using the new mocks. Check out the Shared UX Project Roadmap for more details, or reach out to me directly.