villebro commented on a change in pull request #11946:
URL:
https://github.com/apache/incubator-superset/pull/11946#discussion_r539358435
##########
File path: superset-frontend/src/explore/components/AdhocMetricEditPopover.jsx
##########
@@ -100,10 +100,13 @@ export default class AdhocMetricEditPopover extends
React.Component {
}
onSave() {
- // unset isNew here in case save button was clicked when no changes were
made
+ if (this.props.title.hasCustomLabel) {
+ this.state.adhocMetric.label = this.props.title.label;
+ this.state.adhocMetric.hasCustomLabel = true;
+ }
Review comment:
To avoid mutating state directly, could we perhaps create a new object
with `label` and `hasCustomLabel` here and then spread that in the `onChange`
object?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]