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 Editor] Refactoring metrics axes #59135

Merged
merged 15 commits into from
Mar 10, 2020

Conversation

sulemanof
Copy link
Contributor

Summary

This refactoring is based on optimization of rendering react components.
I tried to get rid of additional extra re-renders caused by changed props, which was never used in children components. This also includes fixing tests and types.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

…ics_axes

# Conflicts:
#	src/legacy/core_plugins/vis_type_vislib/public/components/options/metrics_axes/category_axis_panel.tsx
#	src/legacy/core_plugins/vis_type_vislib/public/components/options/metrics_axes/index.tsx
#	src/legacy/core_plugins/vis_type_vislib/public/components/options/metrics_axes/value_axis_options.tsx
@sulemanof sulemanof marked this pull request as ready for review March 4, 2020 16:46
@sulemanof sulemanof requested a review from a team March 4, 2020 16:46
@sulemanof sulemanof added release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.7.0 v8.0.0 labels Mar 5, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

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 on Chrome (Mac), it works as expected.

@@ -76,25 +70,20 @@ describe('LabelOptions component', () => {
const comp = shallow(<LabelOptions {...defaultProps} />);
comp.find({ paramName: ROTATE }).prop('setValue')(ROTATE, '5');

const newAxes = [{ ...categoryAxis, labels: { ...categoryAxis.labels, rotate: 5 } }];
expect(setValue).toBeCalledWith(CATEGORY_AXES, newAxes);
expect(setAxisLabel).toBeCalledWith('rotate', 5);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
expect(setAxisLabel).toBeCalledWith('rotate', 5);
expect(setAxisLabel).toBeCalledWith(ROTATE, 5);

@sulemanof
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

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.

Tested and everything still works for me, LGTM Nice improvement!

@sulemanof sulemanof merged commit 0ed7176 into elastic:master Mar 10, 2020
@sulemanof sulemanof deleted the fix/refactor_metrics_axes branch March 10, 2020 15:55
gmmorris added a commit to gmmorris/kibana that referenced this pull request Mar 10, 2020
* master:
  Add a retry to dashboard test for a sometimes slow async operation (elastic#59600)
  [Endpoint] Sample data generator for endpoint app (elastic#58936)
  [Vis Editor] Refactoring metrics axes (elastic#59135)
  [DOCS] Changed Discover app to Discover (elastic#59769)
  [Metrics Alerts] Add support for search query and groupBy on alerts (elastic#59388)
  Enhancement - EUICodeEditor for Visualize JSON  (elastic#58679)
  [ML] Transforms: Data grid fixes. (elastic#59538)
  [SIEM] Fix and consolidate handling of error responses in the client (elastic#59438)
  [Maps] convert tooltip classes to typescript (elastic#59589)
  [ML] Functional tests - re-activate date_nanos test (elastic#59649)
  Move canvas to use NP Expressions service (elastic#58387)
  Update misc dependencies (elastic#59542)
  [Unit Testing] Configure react-testing-library queries to use Kibana's data-test-subj instead of default data-testid (elastic#59445)
  [Console] Remove unused code (elastic#59554)
  [Logs / Metrics UI] Link handling / stop page reloads (elastic#58478)
  Add SavedObject management section registration in core  (elastic#59291)
sulemanof added a commit to sulemanof/kibana that referenced this pull request Mar 11, 2020
* Fix TS for vislib

* Fix TS

* Revert table changes

* Update unit test

* Refactor code in metrics_axes

Co-authored-by: maryia-lapata <mary.lopato@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
sulemanof added a commit that referenced this pull request Mar 11, 2020
* Fix TS for vislib

* Fix TS

* Revert table changes

* Update unit test

* Refactor code in metrics_axes

Co-authored-by: maryia-lapata <mary.lopato@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: maryia-lapata <mary.lopato@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
jkelastic pushed a commit to jkelastic/kibana that referenced this pull request Mar 12, 2020
* Fix TS for vislib

* Fix TS

* Revert table changes

* Update unit test

* Refactor code in metrics_axes

Co-authored-by: maryia-lapata <mary.lopato@gmail.com>
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
backported release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants