Move new_vis_modal to visualizations plugin#56654
Conversation
|
Pinging @elastic/kibana-app-arch (Team:AppArch) |
flash1293
left a comment
There was a problem hiding this comment.
Code LGTM, didn't pull down to test
| const baseUrl = `#${VisualizeConstants.CREATE_PATH}?`; | ||
| // TODO: redirect logic is specific to visualise & dashboard | ||
| // but it is likely should be decoupled. e.g. handled by the container instead | ||
| const baseUrl = `#/visualize/create?`; |
There was a problem hiding this comment.
+1, can you create an issue for that?
| import { IUiSettingsClient, SavedObjectsStart } from 'kibana/public'; | ||
| import { NewVisModal } from './new_vis_modal'; | ||
| import { TypesStart } from '../../../../../visualizations/public/np_ready/public/types'; | ||
| import { TypesStart } from '../types'; |
There was a problem hiding this comment.
currenty NewVisModal component and showNewVisModal function are statically exported and receive all dependencies as props/parameters.
i think it makes sense to rather export them on the contract so most of the parameters can be provided and plugin setup. calling showNewVisModal should be as simple as:
npStart.plugins.visualizations.showNewVisModal();
There was a problem hiding this comment.
I ended up with:
-
expose showNewVisModal() on vis plugin - as you suggested. But in vis embeddable factory I am still using it as function - https://github.com/elastic/kibana/pull/56654/files#diff-a45935fc131c617ca6ad658838e474ebR40. As it is part of the same plugin. Not sure if this is correct?
-
I started using it in visualise_listing and removed custom angular directive wrapper around NewVisModal react component
1. expose showNewVisModal() on vis plugin 2. use it in visualise instead of custom directive
|
@elastic/kibana-design, could you take a look please? Just moving .scss |
| @import 'src/legacy/ui/public/styles/styling_constants'; | ||
|
|
||
| @import './embeddable/_index'; | ||
| @import './np_ready/public/wizard/_index'; |
There was a problem hiding this comment.
Really the np_ready folder should have it's own _index.scss file as well, but this is ok since I know there's still a lot of file shuffling happening.
Side note, with SCSS files, you don't need to include the underscore _ in the import file names. Ex:
| @import './np_ready/public/wizard/_index'; | |
| @import './np_ready/public/wizard/index'; |
|
|
||
| @import './embeddable/_index'; | ||
| @import './embeddable'; | ||
| @import './np_ready/public'; |
There was a problem hiding this comment.
Sorry, I think there was some confusion, but you still need to explicitly write out the index portion of the import. SASS doesn't automatically look for an index file.
| @import './np_ready/public'; | |
| @import './np_ready/public/index'; |
There was a problem hiding this comment.
Thank you. was confused by still seeing everything working locally. Looks like cache.
|
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Move new_vis_modal to visualizations plugin. These removes one import from visualisations plugin to kibana/ showNewVisModal() is part of the plugin contract and plugin dependencies are provided implicitly. # Conflicts: # x-pack/plugins/translations/translations/ja-JP.json # x-pack/plugins/translations/translations/zh-CN.json
Move new_vis_modal to visualizations plugin. These removes one import from visualisations plugin to kibana/ showNewVisModal() is part of the plugin contract and plugin dependencies are provided implicitly. # Conflicts: # x-pack/plugins/translations/translations/ja-JP.json # x-pack/plugins/translations/translations/zh-CN.json
Summary
Parent issue: #46809
Move new_vis_modal to visualizations plugin.
These removes one import from
visualisationsplugin tokibana/Dev Docs
Before
NewVisModal component and showNewVisModal function were statically exported and received all the dependencies as props/parameters.
After
showNewVisModal()is part of the plugin contract and plugin dependencies are provided implicitly.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers