-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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(chart & alert): make to show metrics properly #19939
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Anyway we could add a test in cypress? (we have a bunch of tests around charts, maybe we can add this one too).
Codecov Report
@@ Coverage Diff @@
## master #19939 +/- ##
==========================================
- Coverage 66.53% 66.52% -0.01%
==========================================
Files 1714 1714
Lines 65044 65063 +19
Branches 6723 6721 -2
==========================================
+ Hits 43278 43286 +8
- Misses 20055 20069 +14
+ Partials 1711 1708 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
/testenv up |
@rusackas Ephemeral environment spinning up at http://54.201.182.210:8080. Credentials are |
@prosdev0107 I see metrics twice in the control panel now: |
I don't think this is the right way to fix this issue. You'd probably want to update the "Chart changes" renderer instead of the customized metrics controls. |
@@ -263,6 +263,7 @@ const config: ControlPanelConfig = { | |||
}, | |||
], | |||
['adhoc_filters'], | |||
['metrics'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check instead what is the other metrics
panel doing, it must be transforming the props or something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me check
if (typeof value === 'boolean') { | ||
return value ? 'true' : 'false'; | ||
} | ||
if (value.constructor === Array) { | ||
return value.length ? value.join(', ') : '[]'; | ||
const formattedValue = value.map(v => (v.label ? v.label : v)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could potentially be called for other control types aside from metrics.
Why did you move it from above? Was the code not entering? We're essentially switching from Array.isArray
to value.constructor
, which should have similar effect.
If that's the only reason, we could replace Array.isArray
with value.constructor
in the other block you removed, but keeping it locked to the metrics control.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diegomedina248
It does make sense. Resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rusackas LGTM, please live test again.
/testenv up |
@yousoph Ephemeral environment spinning up at http://52.11.190.164:8080. Credentials are |
a quick test on the ephemeral was looking good to me |
Ephemeral environment shutdown and build artifacts deleted. |
* fix(chart & alert): make to show metrics properly * fix(chart & alert): make to remove duplicate metrics * fix(chart & alert): make to restore metrics control alert slice * fix(chart & alert): make to fix lint issue
SUMMARY
Altered Modal Doesn't Show Metrics Properly In Table Chart
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
BEFORE:
AFTER:
TESTING INSTRUCTIONS
How to reproduce bug
ADDITIONAL INFORMATION