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

[Vis: Default editor] Create vis_options_react_wrapper #41746

Merged
merged 3 commits into from
Jul 24, 2019

Conversation

sulemanof
Copy link
Contributor

@sulemanof sulemanof commented Jul 23, 2019

Summary

A part of #38273.

This includes next changes:

  • created the vis-options-react-wrapper directive which handles React.Component editors (using ngReact);
  • created the VisOptionsReactWrapper as a HOC for rendering the component prop;
  • updated input_control_vis editors due to updated props;
  • updated input_control_vis editors test cases;

Checklist

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

For maintainers

Dev Docs

API change of React visualization editor

The properties that get passed into a React visualization editor have slightly been changed:

  • editorState.paramsstateParams
  • stageEditorParams(newParams)setValue(paramName: string, paramValue: unknown) (meaning that you can now set individual parameters in the editor without needing to copy over the previous params.
  • scope has been removed, which gave direct access to an Angular scope.
  • vis has been added to the properties to access the underlying Vis object directly.

You can check the custom visualization sample plugin for an always up to date example of building custom visualizations.

@sulemanof sulemanof added release_note:skip Skip the PR/issue when compiling release notes Feature:Vis Editor Visualization editor issues Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.4.0 v8.0.0 labels Jul 23, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@sulemanof sulemanof requested a review from maryia-lapata July 23, 2019 09:06
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@sulemanof sulemanof requested a review from timroes July 23, 2019 13:22
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

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.

Checked out and tested, LGTM

Copy link
Contributor

@maryia-lapata maryia-lapata left a comment

Choose a reason for hiding this comment

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

LGTM, tested locally (Chrome, Mac)

sinon.assert.calledOnce(stageEditorParams);
sinon.assert.calledWith(stageEditorParams, sinon.match(expectedParams));
});
expect(component).toMatchSnapshot(); // eslint-disable-line
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this line disabled for eslint?

Copy link
Contributor Author

@sulemanof sulemanof Jul 24, 2019

Choose a reason for hiding this comment

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

Seems something legacy and could be removed.
Will be removed in the next pr

@sulemanof sulemanof merged commit ef5af4c into elastic:master Jul 24, 2019
@sulemanof sulemanof deleted the EUIfication/vis_options branch July 24, 2019 13:20
sulemanof added a commit to sulemanof/kibana that referenced this pull request Jul 24, 2019
* Add vis_options_react_wrapper

* Update jest tests

* Fix plugin functional test
sulemanof added a commit that referenced this pull request Jul 24, 2019
* Add vis_options_react_wrapper

* Update jest tests

* Fix plugin functional test
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@timroes timroes added the release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. label Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Feature:Vis Editor Visualization editor issues release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.4.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants