-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(discover): Fixed Add to Dashboards modal bug unable to delete last non equation overlay #29528
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): Fixed Add to Dashboards modal bug unable to delete last non equation overlay #29528
Conversation
size-limit report
|
|
Updated |
| if equations is not None: | ||
| try: | ||
| resolved_equations, _, _ = resolve_equation_list(equations, fields) | ||
| resolved_equations, _, _ = resolve_equation_list(equations, fields, auto_add=True) |
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.
We should only do auto_add here if its a chart widget, otherwise we'll break the validation for table widgets
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.
Hey @wmak, not sure if there is a better way to do this, but I added displayType to the context so I could access it within the Query serializer to conditionally auto_add. Is there a better way for a nested serializer to access properties from parents or siblings?
| auto_add=self.context.get("displayType") | ||
| != DashboardWidgetDisplayTypes.as_text_choices()[ | ||
| DashboardWidgetDisplayTypes.TABLE | ||
| ][0], |
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's move this to a helper function, but otherwise this looks good to me 👍
oh, we should set aggregates_only=True as well if its a chart
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.
👍 updated!
…r-add-to-dashboard-delete-overlay
Fixed a bug in the Add to Dashboards modal that prevented the user from deleting the last non equation overlay even if there is an existing equation on the Y-Axis
