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 21:23:58 UTC

[GitHub] michellethomas closed pull request #6277: Avoid clearing metric when saving from datasource editor

michellethomas closed pull request #6277: Avoid clearing metric when saving from datasource editor
URL: https://github.com/apache/incubator-superset/pull/6277
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/assets/src/explore/components/controls/MetricsControl.jsx b/superset/assets/src/explore/components/controls/MetricsControl.jsx
index 7bbb4d111b..f820dc8c7d 100644
--- a/superset/assets/src/explore/components/controls/MetricsControl.jsx
+++ b/superset/assets/src/explore/components/controls/MetricsControl.jsx
@@ -2,6 +2,7 @@ import React from 'react';
 import PropTypes from 'prop-types';
 import VirtualizedSelect from 'react-virtualized-select';
 import { t } from '@superset-ui/translation';
+import { isEqual } from 'lodash';
 
 import ControlHeader from '../ControlHeader';
 import VirtualizedRendererWrap from '../../../components/VirtualizedRendererWrap';
@@ -117,8 +118,8 @@ export default class MetricsControl extends React.PureComponent {
 
   componentWillReceiveProps(nextProps) {
     if (
-      this.props.columns !== nextProps.columns ||
-      this.props.savedMetrics !== nextProps.savedMetrics
+      isEqual(this.props.columns) !== isEqual(nextProps.columns) ||
+      isEqual(this.props.savedMetrics) !== isEqual(nextProps.savedMetrics)
     ) {
       this.setState({ options: this.optionsForSelect(nextProps) });
       this.props.onChange([]);


 

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