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

visualize embeddable to visualizations plugin #54840

Merged
merged 9 commits into from
Jan 15, 2020

Conversation

ppisljar
Copy link
Member

@ppisljar ppisljar commented Jan 14, 2020

Summary

moves visualize embeddable into visualizations plugin

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@ppisljar ppisljar requested a review from a team January 14, 2020 22:50
@ppisljar ppisljar requested review from a team as code owners January 14, 2020 22:50
@ppisljar ppisljar added release_note:skip Skip the PR/issue when compiling release notes review Team:AppArch v7.7.0 v8.0.0 labels Jan 14, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@ppisljar ppisljar requested a review from lizozom January 14, 2020 22:52
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';
Copy link
Contributor

@flash1293 flash1293 Jan 15, 2020

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

Copy link
Member Author

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)

Copy link
Contributor

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, {
Copy link
Contributor

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({
Copy link
Contributor

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.

Copy link
Member Author

@ppisljar ppisljar Jan 15, 2020

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

Copy link
Member Author

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

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Member

@kertal kertal Jan 15, 2020

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

Copy link
Contributor

@lizozom lizozom left a 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;
Copy link
Contributor

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

# Conflicts:
#	src/legacy/core_plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx
@ppisljar
Copy link
Member Author

@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';
Copy link
Member Author

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';
Copy link
Member Author

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

Copy link
Contributor

@crob611 crob611 left a 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';
Copy link
Contributor

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';
Copy link
Contributor

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

Copy link
Contributor

@cchaos cchaos left a 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

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes review v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants