williaster commented on a change in pull request #4736: [Explore] Adding custom 
expressions to adhoc metrics
URL: 
https://github.com/apache/incubator-superset/pull/4736#discussion_r180898341
 
 

 ##########
 File path: 
superset/assets/javascripts/explore/components/AdhocMetricEditPopover.jsx
 ##########
 @@ -101,38 +176,68 @@ export default class AdhocMetricEditPopover extends 
React.Component {
 
     const popoverTitle = (
       <AdhocMetricEditPopoverTitle
-        adhocMetric={this.state.adhocMetric}
+        adhocMetric={adhocMetric}
         onChange={this.onLabelChange}
       />
     );
 
-    const stateIsValid = this.state.adhocMetric.column && 
this.state.adhocMetric.aggregate;
-    const hasUnsavedChanges = 
this.state.adhocMetric.equals(this.props.adhocMetric);
+    const stateIsValid = adhocMetric.isValid();
+    const hasUnsavedChanges = adhocMetric.equals(propsAdhocMetric);
 
 Review comment:
   is this backwards? or I'm reading it wrong? I guess I'd expect equals to 
return true if they're the same which would mean no unsaved changes?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to