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

visualizations plugin np_ready #57983

Merged
merged 27 commits into from
Feb 25, 2020
Merged

Conversation

Dosant
Copy link
Contributor

@Dosant Dosant commented Feb 19, 2020

Summary

Partially addresses #50897

updates visualizations plugin

  • makes visualizations/saved_visualizations np_ready
  • makes visualizations/embeddable np_ready
  • remove DefaultVisEditor dependency from visualizations
  • import AggConfigs directly instead of ui/public
  • Clean up imports from root. use relative imports
  • Remove bind directive import

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@Dosant Dosant changed the title [wip] vis np ready [wip] vis embeddable np ready Feb 19, 2020
@Dosant Dosant force-pushed the dev/vis-to-np/vis-emeddable branch from 76d1053 to bebab07 Compare February 19, 2020 14:54
…/vis-emeddable

# Conflicts:
#	src/legacy/core_plugins/visualizations/public/np_ready/public/embeddable/visualize_embeddable.ts
#	src/legacy/core_plugins/visualizations/public/np_ready/public/legacy/build_pipeline.ts
…/vis-emeddable

# Conflicts:
#	src/legacy/core_plugins/visualizations/public/np_ready/public/embeddable/visualize_embeddable.ts
#	src/legacy/core_plugins/visualizations/public/saved_visualizations/saved_visualizations.ts
@Dosant Dosant changed the title [wip] vis embeddable np ready visualizations plugin np_ready Feb 21, 2020
@Dosant Dosant requested a review from ppisljar February 21, 2020 13:12
@Dosant Dosant added v7.7.0 v8.0.0 Feature:NP Migration Feature:Visualizations Generic visualization features (in case no more specific feature label is available) labels Feb 24, 2020
@elasticmachine
Copy link
Contributor

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

@Dosant Dosant added release_note:skip Skip the PR/issue when compiling release notes review labels Feb 24, 2020
@Dosant Dosant marked this pull request as ready for review February 24, 2020 12:45
@Dosant Dosant requested a review from a team February 24, 2020 12:45
@Dosant Dosant requested review from a team as code owners February 24, 2020 12:45
…/vis-emeddable

# Conflicts:
#	src/legacy/core_plugins/visualizations/public/np_ready/public/embeddable/get_index_pattern.ts
#	src/legacy/core_plugins/visualizations/public/np_ready/public/embeddable/visualize_embeddable.ts
Copy link
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.

Kibana app changes LGTM, didn't test

@Dosant
Copy link
Contributor Author

Dosant commented Feb 24, 2020

@elasticmachine merge upstream

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 moves lgtm

Copy link
Member

@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.

LGTM

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

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.

Overall looks great.
Added couple questions for my own understanding. Lets address F2F.

"data",
"search"
]
"requiredPlugins": ["data", "search", "expressions", "uiActions"]
Copy link
Contributor

@lizozom lizozom Feb 25, 2020

Choose a reason for hiding this comment

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

Is there a search plugin at all?

Copy link
Contributor Author

@Dosant Dosant Feb 25, 2020

Choose a reason for hiding this comment

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

Not sure :D
This will be fixed during cutover anyway. Bunch of plugins are missing here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we remove this one?

// TODO: can't import from '../../../../legacy/core_plugins/visualizations/public/' directly,
// because yarn build:types fails after trying to emit type declarations for whole visualizations plugin
// Bunch of errors like this: 'Return type of exported function has or is using private name 'SavedVis''
import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../legacy/core_plugins/visualizations/public/np_ready/public/embeddable/constants';
Copy link
Contributor

Choose a reason for hiding this comment

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

// brain pick
What exactly happened here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I understood, there is yarn build:types which emits d.ts files for core code.
In compilation included only:

"include": [
    "src/core/server/index.ts",
    "src/core/public/index.ts",
    "typings"
  ]

This file here - src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx ends up as a deep dependency of "src/core/public/index.ts".

If to import whole visualisation plugin, the type declaration emitting breaks, because of incompatible for declarations code as a dependency of visualisation plugin.
The code which causing this error:
'Return type of exported function has or is using private name 'SavedVis''
is code like this:

export function createSavedVisLoader(services: SavedObjectKibanaServicesWithVisualizations) {
  const { savedObjectsClient, visualizationTypes } = services;

  class SavedObjectLoaderVisualize extends SavedObjectLoader {
....
 }
return SavedObjectLoaderVisualize

See that SavedObjectLoaderVisualize is private, so it can't be emitted in declaration.

This root cause issue should be addressed by: #58243

P.S. spend like half of a day figuring out what is going wrong :D

Copy link
Contributor

Choose a reason for hiding this comment

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

🎩
😄 👌

Copy link
Contributor

Choose a reason for hiding this comment

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

Wow, thanks for digging into it @Dosant ! This import should definitely not be there, this was an oversight during migration. Saved object save modal shouldn't know anything about the visualize embeddable, this logic should be moved into the specific calls (e.g. by passing in a prop like hideDescription).

I created an issue for this here: #58479

@joshdover I was under the impression the linter would prevent us from referencing legacy from within the new platform. A quick code search reveals a number of offenders, did something break here?

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 look good here 👍

@Dosant Dosant merged commit 93556a9 into elastic:master Feb 25, 2020
Dosant added a commit to Dosant/kibana that referenced this pull request Feb 25, 2020
Partially addresses elastic#50897

updates visualizations plugin

makes visualizations/saved_visualizations np_ready
makes visualizations/embeddable np_ready
remove DefaultVisEditor dependency from visualizations
import AggConfigs directly instead of ui/public
Clean up imports from root. use relative imports
Remove bind directive import
Dosant added a commit that referenced this pull request Feb 26, 2020
Partially addresses #50897

updates visualizations plugin

makes visualizations/saved_visualizations np_ready
makes visualizations/embeddable np_ready
remove DefaultVisEditor dependency from visualizations
import AggConfigs directly instead of ui/public
Clean up imports from root. use relative imports
Remove bind directive import

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:NP Migration Feature:Visualizations Generic visualization features (in case no more specific feature label is available) 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