You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/12/09 08:24:36 UTC

[GitHub] [incubator-superset] villebro commented on a change in pull request #11946: fix: [chart]heatmap selecting metrics does not update the query results

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org