-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(discover): Check yAxis list contains equation functions when adding widget from discover #29153
fix(discover): Check yAxis list contains equation functions when adding widget from discover #29153
Conversation
…-widget-check-y-axis-equation
…-widget-check-y-axis-equation
…-widget-check-y-axis-equation
@@ -430,11 +442,67 @@ describe('EventsV2 > SaveQueryButtonGroup', function () { | |||
wrapper.find('DiscoverQueryMenu').find('Button').first().simulate('click'); | |||
wrapper.find('MenuItem').first().simulate('click'); | |||
await tick(); | |||
await wrapper.update(); | |||
await tick(); |
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.
Why is tick
called twice here?
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.
Found that subsequent tests will have leaky data without the second tick(). This looks like something to do with enzyme component handling. Removed wrapper.update() since it wasn't actually doing anything here.
return ( | ||
!parsed.error && | ||
parsed.tc.functions.every( | ||
({term}) => typeof term === 'string' && yAxis.includes(term) |
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.
Does this need to check if the equation is on aggregates? Because we can add equations on non aggregatesike transaction.duration
.
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.
Aggregates are filtered out ahead of time, so shouldn't be necessary to check again. 👍
With #29087 users will be able to add equations to all widget visualization types.
When adding a widget from discover, we need to make sure that any equations passed into the Y-Axis must have their comprising functions included as Y-Axis values as well (otherwise the equation will not work). This change will enforce this check when pulling Y-Axis values from discover to the Add to Dashboard widget modal.