Skip to content

Move new_vis_modal to visualizations plugin#56654

Merged
Dosant merged 10 commits intoelastic:masterfrom
Dosant:dev/vis-to-np/show-new-vis-modal
Feb 6, 2020
Merged

Move new_vis_modal to visualizations plugin#56654
Dosant merged 10 commits intoelastic:masterfrom
Dosant:dev/vis-to-np/show-new-vis-modal

Conversation

@Dosant
Copy link
Copy Markdown
Contributor

@Dosant Dosant commented Feb 3, 2020

Summary

Parent issue: #46809
Move new_vis_modal to visualizations plugin.
These removes one import from visualisations plugin to kibana/

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.

npStart.plugins.visualizations.showNewVisModal();

Checklist

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

For maintainers

@elasticmachine
Copy link
Copy Markdown
Contributor

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

@Dosant Dosant added v8.0.0 v7.7.0 review release_note:skip Skip the PR/issue when compiling release notes labels Feb 4, 2020
@Dosant Dosant changed the title [wip] Move new_vis_modal to visualisations plugin Move new_vis_modal to visualizations plugin Feb 4, 2020
@Dosant Dosant marked this pull request as ready for review February 4, 2020 10:50
@Dosant Dosant requested a review from a team February 4, 2020 10:50
@Dosant Dosant requested review from a team as code owners February 4, 2020 10:50
@Dosant Dosant requested a review from ppisljar February 4, 2020 10:58
Copy link
Copy Markdown
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up with:

  1. 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?

  2. 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
@Dosant Dosant added release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. and removed release_note:skip Skip the PR/issue when compiling release notes labels Feb 4, 2020
Copy link
Copy Markdown
Contributor

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM

@Dosant
Copy link
Copy Markdown
Contributor Author

Dosant commented Feb 5, 2020

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
@import './np_ready/public/wizard/_index';
@import './np_ready/public/wizard/index';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, improved


@import './embeddable/_index';
@import './embeddable';
@import './np_ready/public';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
@import './np_ready/public';
@import './np_ready/public/index';

Copy link
Copy Markdown
Contributor Author

@Dosant Dosant Feb 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. was confused by still seeing everything working locally. Looks like cache.

@Dosant Dosant requested a review from cchaos February 5, 2020 17:54
Copy link
Copy Markdown
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.

Better, thanks!

@Dosant
Copy link
Copy Markdown
Contributor Author

Dosant commented Feb 6, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

History

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

@Dosant Dosant merged commit 927be66 into elastic:master Feb 6, 2020
Dosant added a commit to Dosant/kibana that referenced this pull request Feb 6, 2020
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
Dosant added a commit that referenced this pull request Feb 6, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:NP Migration release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. review v7.7.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants