superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michel...@apache.org
Subject [incubator-superset] branch master updated: Avoid clearing metric when saving from datasource editor (#6277)
Date Tue, 06 Nov 2018 21:24:03 GMT
This is an automated email from the ASF dual-hosted git repository.

michellet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new cd05d44  Avoid clearing metric when saving from datasource editor (#6277)
cd05d44 is described below

commit cd05d44340106a6ade8692e2cf72d253afbd0e5d
Author: michellethomas <michelle.q.thomas@gmail.com>
AuthorDate: Tue Nov 6 13:23:55 2018 -0800

    Avoid clearing metric when saving from datasource editor (#6277)
---
 superset/assets/src/explore/components/controls/MetricsControl.jsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/superset/assets/src/explore/components/controls/MetricsControl.jsx b/superset/assets/src/explore/components/controls/MetricsControl.jsx
index 7bbb4d1..f820dc8 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([]);


Mime
View raw message