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

fix(line_annotation): keep the spec in state after chart rerender #605

Merged

Conversation

markov00
Copy link
Member

Summary

The LineAnnotation component doesn't use the specComponentFactory because it render the marker
if available. We have to always keep the spec updating the state on every lifecycle thus removing
the deepEqual check on the shouldComponentUpdate did the trick.

fix #604

Checklist

Delete any items that are not applicable to this PR.

  • Unit tests were updated or added to match the most common scenarios

The `LineAnnotation` component doesn't use the `specComponentFactory` because it render the marker
if available. We have to always keep the spec updating the state on every lifecycle thus removing
the deepEqual check on the shouldComponentUpdate did the trick.

fix elastic#604
@markov00 markov00 added the bug Something isn't working label Mar 25, 2020
@codecov-io
Copy link

codecov-io commented Mar 25, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@433d2cd). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #605   +/-   ##
=========================================
  Coverage          ?   70.79%           
=========================================
  Files             ?      220           
  Lines             ?     6409           
  Branches          ?     1224           
=========================================
  Hits              ?     4537           
  Misses            ?     1853           
  Partials          ?       19
Impacted Files Coverage Δ
src/chart_types/xy_chart/specs/line_annotation.tsx 79.48% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 433d2cd...b25e4c4. Read the comment docs.

Copy link
Contributor

@monfera monfera left a comment

Choose a reason for hiding this comment

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

LGTM with the couple of changes—deletion of the commented out sCU and threashold->threshold

@markov00 markov00 merged commit 43c13f1 into elastic:master Mar 26, 2020
@markov00 markov00 deleted the 2020_03_25-fix_line_annotation_rerender branch March 26, 2020 13:35
markov00 pushed a commit that referenced this pull request Mar 26, 2020
# [18.2.0](v18.1.0...v18.2.0) (2020-03-26)

### Bug Fixes

* **line_annotation:** keep the spec in state after chart rerender ([#605](#605)) ([43c13f1](43c13f1)), closes [#604](#604)

### Features

* **partition:** stroke configuration and linked label value font format ([#602](#602)) ([7dce0a3](7dce0a3))
@markov00
Copy link
Member Author

🎉 This PR is included in version 18.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Mar 26, 2020
markov00 pushed a commit that referenced this pull request Mar 26, 2020
## [18.1.1](v18.1.0...v18.1.1) (2020-03-26)

### Bug Fixes

* **line_annotation:** keep the spec in state after chart rerender ([#605](#605)) ([43c13f1](43c13f1)), closes [#604](#604)
@markov00
Copy link
Member Author

🎉 This PR is included in version 18.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
# [18.2.0](elastic/elastic-charts@v18.1.0...v18.2.0) (2020-03-26)

### Bug Fixes

* **line_annotation:** keep the spec in state after chart rerender ([opensearch-project#605](elastic/elastic-charts#605)) ([22296c6](elastic/elastic-charts@22296c6)), closes [opensearch-project#604](elastic/elastic-charts#604)

### Features

* **partition:** stroke configuration and linked label value font format ([opensearch-project#602](elastic/elastic-charts#602)) ([24d0e71](elastic/elastic-charts@24d0e71))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released on @18.1.x released Issue released publicly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LineAnnotation disappears on rerender
3 participants