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



##########
File path: superset-frontend/src/explore/components/controls/MetricsControl.jsx
##########
@@ -194,6 +196,9 @@ export default class MetricsControl extends 
React.PureComponent {
   }
 
   onMetricEdit(changedMetric) {
+    changedMetric.label = changedMetric.hasCustomLabel
+      ? changedMetric.customLabel
+      : changedMetric.label;

Review comment:
       Can we change this so that we don't need to mutate `changedMetric`. 
Something like 
   ```typescript
   const newMetric = { ...changedMetric }
   newMetric.label = newMetric.hasCustomLabel ? newMetric.customLabel : 
newMetric.label
   ```
   or similar? Optionally we could do this check in `onSave()` in 
`AdhocMetricEditPopover.jsx`, and reassign the label there to avoid having to 
rename the prop in `title`.




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