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 2018/11/06 05:14:15 UTC

[GitHub] mistercrunch commented on a change in pull request #6277: Avoid clearing metric when saving from datasource editor

mistercrunch commented on a change in pull request #6277: Avoid clearing metric when saving from datasource editor
URL: https://github.com/apache/incubator-superset/pull/6277#discussion_r231001058
 
 

 ##########
 File path: superset/assets/src/explore/components/controls/MetricsControl.jsx
 ##########
 @@ -117,8 +117,8 @@ export default class MetricsControl extends React.PureComponent {
 
   componentWillReceiveProps(nextProps) {
     if (
-      this.props.columns !== nextProps.columns ||
-      this.props.savedMetrics !== nextProps.savedMetrics
+      JSON.stringify(this.props.columns) !== JSON.stringify(nextProps.columns) ||
 
 Review comment:
   I don't think `JSON.strinigfy` is good to use for deep equality:
   https://stackoverflow.com/questions/15376185/is-it-fine-to-use-json-stringify-for-deep-comparisons-and-cloning
   
   How about lodash's isEqual? https://lodash.com/docs/4.17.10#isEqual

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


With regards,
Apache Git Services

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