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

[Lens] Reference line renaming + other small fixes #113811

Merged
merged 87 commits into from
Oct 15, 2021

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Oct 4, 2021

Summary

Fixes #113406

This PR is a combination of all the previous PRs (also the pending ones) made in preparation for the renaming Thresholds => Reference Line.

The mapping is almost 1:1, with few exceptions where Reference lines X was too long, so I've changed it to Reference X. One instance of it is the Add layer button:

Screenshot 2021-10-04 at 19 27 57

During the change, I've found out few minor bugs which have been addressed here (but they can be ported elsewhere as well if it improves the review process):

  • Formula to Static value transition was broken again, so it has been fixed ✅
  • Fill: below was not respecting the "next reference line" boundary, leading to mixed color region. ✅
  • Fill options did not change for Horizontal Charts, or Vertical lines. Now Above and Below change to Before and After
  • The invalidMessage for a number histogram axis change or removed has been improved for the specific case ✅
  • Better vertical text alignment ✅ - will be ported also to [Lens] Thresholds: Add text to markers body #113629

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

dej611 and others added 30 commits September 23, 2021 12:09
@dej611 dej611 added auto-backport Deprecated - use backport:version if exact versions are needed Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.16.0 v8.0.0 labels Oct 14, 2021
@dej611 dej611 marked this pull request as ready for review October 14, 2021 15:55
@dej611 dej611 requested review from a team as code owners October 14, 2021 15:55
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors (Team:VisEditors)

@dej611
Copy link
Contributor Author

dej611 commented Oct 14, 2021

@elasticmachine merge upstream

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

I am not sure if it is supposed to work like that but I notice that when I create a reference line with a Quick function and then go to Formula this works fine. When I go to the static value, the value is overwritten by 100. I would expect to carry the value that is computed by the Quck function.
image

When I navigate to static value
image

label={i18n.translate('xpack.lens.xyChart.layerThresholdLabel', {
defaultMessage: 'Thresholds',
icon={LensIconChartBarReferenceLine}
label={i18n.translate('xpack.lens.xyChart.layerReference lineLabel', {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure about it but is this ok that it has a space on the key?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! It's a typo.

const beforeLabel = i18n.translate('xpack.lens.xyChart.referenceLineFill.before', {
defaultMessage: 'Before',
});
const afterLabel = i18n.translate('xpack.lens.xyChart.referenceLineFill.right', {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this could be xpack.lens.xyChart.referenceLineFill.after in order to be aligned with the rest

@dej611
Copy link
Contributor Author

dej611 commented Oct 15, 2021

The transition bug from Quick functions should have been fixed now.
Addressed also the other two issues.

Copy link
Contributor

@mdefazio mdefazio left a comment

Choose a reason for hiding this comment

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

Reviewed scss file and LGTM.

Copy link
Contributor

@stratoula stratoula 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, the bug with the transition from the Quick functions to static has been solved. We could also update the Display name here:
image

but I am approving it!

@dej611
Copy link
Contributor Author

dej611 commented Oct 15, 2021

Fixed also latest issue with label

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 1.0MB 1.0MB +1.3KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
lens 39.2KB 39.2KB +8.0B

History

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

@dej611 dej611 merged commit 9d12a97 into elastic:master Oct 15, 2021
@dej611 dej611 deleted the fix/113406 branch October 15, 2021 16:06
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Oct 15, 2021
* 🐛 Add padding to the tick label to fit threshold markers

* 🐛 Better icon detection

* 🐛 Fix edge cases with no title or labels

* 📸 Update snapshots

* ✨ Make threshold fit into view automatically

* 🐛 do not compute axis threshold extends if no threshold is present

* ✅ One more fix for 0-based extends and tests

* ✨ Add icon placement flag

* ✨ Sync padding computation with marker positioning

* ✨ compute the default threshold based on data bounds

* 🐛 fix duplicate suggestion issue + missing over time

* 👌 Make disabled when no icon is selected

* ✨ First text on marker implementation

* 🐛 Fix some edge cases with auto positioning

* Update x-pack/plugins/lens/public/xy_visualization/xy_config_panel/threshold_panel.tsx

Co-authored-by: Michael Marcialis <[email protected]>

* 🐛 Fix minor details

* 💄 Small tweak

* ✨ Reduce the padding if no icon is shown on the axis

* 🐛 Fix color fallback for different type of layers

* ✅ Fix broken unit tests

* 🐛 Fix multi layer types issue

* ✅ Fix test

* ✅ Fix other test

* 💄 Fix vertical text centering

* ✨ Rename to reference lines + few fixes

* 🚨 Fix linting issue

* 🐛 Fix issue

* 🐛 Fix computation bug for the initial static value

* ✅ Add new suite of test for static value computation

* 💄 Reorder panel inputs

* 💄 Move styling to sass

* 📝 Keeping up with the renaming

* ✅ Fix functional tests after renaming

* 🐛 Fix duplicate arg from conflict resolution

* 👌 Integrate some follow up feedback

* 📝 Fix typo

* 👌 Integrate feedback

* 🐛 Fix the quick functions transition bug

* 🐛 Fix label issue when updating value

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Michael Marcialis <[email protected]>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Oct 15, 2021
* 🐛 Add padding to the tick label to fit threshold markers

* 🐛 Better icon detection

* 🐛 Fix edge cases with no title or labels

* 📸 Update snapshots

* ✨ Make threshold fit into view automatically

* 🐛 do not compute axis threshold extends if no threshold is present

* ✅ One more fix for 0-based extends and tests

* ✨ Add icon placement flag

* ✨ Sync padding computation with marker positioning

* ✨ compute the default threshold based on data bounds

* 🐛 fix duplicate suggestion issue + missing over time

* 👌 Make disabled when no icon is selected

* ✨ First text on marker implementation

* 🐛 Fix some edge cases with auto positioning

* Update x-pack/plugins/lens/public/xy_visualization/xy_config_panel/threshold_panel.tsx

Co-authored-by: Michael Marcialis <[email protected]>

* 🐛 Fix minor details

* 💄 Small tweak

* ✨ Reduce the padding if no icon is shown on the axis

* 🐛 Fix color fallback for different type of layers

* ✅ Fix broken unit tests

* 🐛 Fix multi layer types issue

* ✅ Fix test

* ✅ Fix other test

* 💄 Fix vertical text centering

* ✨ Rename to reference lines + few fixes

* 🚨 Fix linting issue

* 🐛 Fix issue

* 🐛 Fix computation bug for the initial static value

* ✅ Add new suite of test for static value computation

* 💄 Reorder panel inputs

* 💄 Move styling to sass

* 📝 Keeping up with the renaming

* ✅ Fix functional tests after renaming

* 🐛 Fix duplicate arg from conflict resolution

* 👌 Integrate some follow up feedback

* 📝 Fix typo

* 👌 Integrate feedback

* 🐛 Fix the quick functions transition bug

* 🐛 Fix label issue when updating value

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Michael Marcialis <[email protected]>

Co-authored-by: Marco Liberati <[email protected]>
Co-authored-by: Michael Marcialis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Thresholds: rename to Reference lines
6 participants