mayurnewase commented on a change in pull request #11946:
URL: 
https://github.com/apache/incubator-superset/pull/11946#discussion_r539468435



##########
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:
       Is this the way you want?
   ```
     onSave() {
       const {label} = this.props.title.hasCustomLabel ?
         this.props.title.label : this.state.adhocMetric.label;
       const {hasCustomLabel} = this.props.title.hasCustomLabel;
       this.props.onChange({
         ...this.state.adhocMetric,
         label,
         hasCustomLabel
       });
     }
   ```




----------------------------------------------------------------
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]

Reply via email to