-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
visualize embeddable to visualizations plugin #54840
Conversation
Pinging @elastic/kibana-app-arch (Team:AppArch) |
10c99e4
to
51dcb06
Compare
import { start as visualizations } from '../../../visualizations/public/np_ready/public/legacy'; | ||
import { showNewVisModal } from '../visualize'; | ||
import { SavedVisualizations } from '../visualize/np_ready/types'; | ||
import { showNewVisModal } from '../../../kibana/public/visualize/np_ready/wizard/show_new_vis'; |
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 should also be exposed from the top level of the visualize
folder, to avoid coupling visualizations
to the folder structure of visualize
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.
are you ok with leaving ti as is for now ? i tried top level import but that breaks some tests and i would like to keep this PR as small as possible.
in the follow up i will most likely move this to the visualizations plugin, as else we might end up with circular dependency (visualize_embeddable requires showNewVisModal, but kibana/visualize reqires a lot of things from visualization plugin)
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.
Ah right, I have a PR open that should fix this problem: #54124
Then it's fine for now, moving it over makes sense to me as this isn't exclusively "visualize" UI
@@ -27,5 +27,9 @@ import { plugin } from '.'; | |||
|
|||
const pluginInstance = plugin({} as PluginInitializerContext); | |||
|
|||
export const setup = pluginInstance.setup(npSetup.core); | |||
export const start = pluginInstance.start(npStart.core); | |||
export const setup = pluginInstance.setup(npSetup.core, { |
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.
nit: Could also be
export const setup = pluginInstance.setup(npSetup.core, npSetup.plugins);
export const start = pluginInstance.start(npStart.core, npStart.plugins);
share, | ||
visualizations, | ||
}; | ||
|
||
const embeddableFactory = new VisualizeEmbeddableFactory(visualizations.types); | ||
embeddables.registerEmbeddableFactory(VISUALIZE_EMBEDDABLE_TYPE, embeddableFactory); | ||
const savedVisualizations = createSavedVisLoader({ |
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.
@kertal Changes how this works in this PR and it looks like it will make this logic unnecessary: #54155
@ppisljar Can you wait with your PR till that one is merged? This PR introduces managementRegistry
and uiModules
in this file which I would like to avoid because Matthias' PR will get rid of it anyway.
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.
seems that PR is reviewed and just waiting for 7.6
branch ?
i am fine with it merging first, this will probably anyway take another day to review
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.
if it happens the other way around (and this is ready first) i also don't think it should be a problem, either @kertal removes the uiModules and managementRegistry from this file, or i can do it in followup
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.
Sounds good to me, please leave a TODO
comment to document it somewhere.
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.
Better than a comment would be to pass in uiModules
and managementRegistry
as a __LEGACY
plugin dependency, just to follow the convention of shimmed plugins.
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.
I've moved #54155 to 7.7, it's no problem to wait until this is merged in
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.
Checked out and tested locally.
Added some minor comments and overall LGTM.
@@ -29,8 +28,8 @@ export async function getIndexPattern( | |||
return savedVis.vis.indexPattern; | |||
} | |||
|
|||
const savedObjectsClient = npStart.core.savedObjects.client; | |||
const defaultIndex = npStart.core.uiSettings.get('defaultIndex'); | |||
const savedObjectsClient = getSavedObjectsClient().client; |
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.
Either getSavedObjectsClient
should return the client, or its name should be getSavedObjects
src/legacy/core_plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx
Show resolved
Hide resolved
src/legacy/core_plugins/visualizations/public/np_ready/public/services.ts
Show resolved
Hide resolved
# Conflicts: # src/legacy/core_plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx
@elastic/kibana-design sass files were moved (no changes) |
@@ -6,7 +6,7 @@ | |||
|
|||
// @ts-ignore | |||
import { MAP_SAVED_OBJECT_TYPE } from '../../../maps/common/constants'; | |||
import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../../../src/legacy/core_plugins/kibana/public/visualize_embeddable/constants'; |
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.
@elastic/kibana-canvas this import changed
@@ -5,7 +5,7 @@ | |||
*/ | |||
|
|||
import { ExpressionFunction } from 'src/plugins/expressions/common/types'; | |||
import { VisualizeInput } from 'src/legacy/core_plugins/kibana/public/visualize_embeddable'; |
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.
@elastic/kibana-canvas this import changed
1ff2905
to
c530696
Compare
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.
Canvas changes LGTM 👍
@@ -18,7 +18,6 @@ | |||
|
|||
// Visualize styles | |||
@import './visualize/index'; | |||
@import './visualize_embeddable/index'; |
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.
You seem to now be missing the import of this index file from inside the legacy folder. So the styles won't be compiled.
@@ -18,7 +18,7 @@ | |||
|
|||
// Visualize styles | |||
@import './visualize/index'; | |||
@import './visualize_embeddable/index'; | |||
@import '../../visualizations/public/embeddable/index'; |
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.
Sorry I didn't mean you should change the import path in this file. You shouldn't be importing SASS files from other plugins. Each plugin needs their own manifest file index.scss
. You can follow the pattern setup in this folder https://github.com/elastic/kibana/tree/c5306961d3ac4826ac044dc8d4b9031d8b0f4a8b/src/legacy/core_plugins/newsfeed/public
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.
Sass imports look good now
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Summary
moves visualize embeddable into visualizations plugin
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] This was checked for cross-browser compatibility, including a check against IE11[ ] Documentation was added for features that require explanation or tutorials[ ] Unit or functional tests were updated or added to match the most common scenarios[ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers
[ ] This includes a feature addition or change that requires a release note and was labeled appropriately