diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json
index 61b06cd30e..ccd71fa18d 100644
--- a/superset-frontend/package-lock.json
+++ b/superset-frontend/package-lock.json
@@ -6575,9 +6575,14 @@
}
},
"@superset-ui/control-utils": {
- "version": "0.13.3",
- "resolved": "https://registry.npmjs.org/@superset-ui/control-utils/-/control-utils-0.13.3.tgz",
- "integrity": "sha512-I9eMrqZRB5PbSWygGoptxOdu9t8X8LU3+VTo7OjAEcn3EYAQHIRmuMudq1KDnrGt+rKCBOHaWm5JMbMIj2GodA=="
+ "version": "0.13.9",
+ "resolved": "https://registry.npmjs.org/@superset-ui/control-utils/-/control-utils-0.13.9.tgz",
+ "integrity": "sha512-R8BkUqd5WaDfFB7LiGfNBD3kfFsoqwRzIUDNvZxVzBJsmYTgF0pPVV9OB9pKZ/fImEqd/WqPb5PyB7FMtRj5Ug==",
+ "requires": {
+ "@types/react-bootstrap": "0.32.21",
+ "lodash": "^4.17.15",
+ "react-bootstrap": "^0.33.1"
+ }
},
"@superset-ui/core": {
"version": "0.13.5",
@@ -6820,9 +6825,9 @@
}
},
"@superset-ui/legacy-plugin-chart-partition": {
- "version": "0.13.5",
- "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-partition/-/legacy-plugin-chart-partition-0.13.5.tgz",
- "integrity": "sha512-YsgbAqj/sQKEWUmI0XXy6rJvGsWSPwfekmtWpa55CF19A+TJEuCCHmIGDPupgZsIqgJBZArwYT3HNnn7a8TfxA==",
+ "version": "0.13.11",
+ "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-partition/-/legacy-plugin-chart-partition-0.13.11.tgz",
+ "integrity": "sha512-z49rqBLWQ7GRf1MCz3QdYz+8HRmK8UJo1kHRKBnqah4NQB4jemgWnOznNHuPXxOCIct1ZejvUmaf5EAg/24dMQ==",
"requires": {
"d3": "^3.5.17",
"d3-hierarchy": "^1.1.8",
@@ -7511,6 +7516,14 @@
"csstype": "^2.2.0"
}
},
+ "@types/react-bootstrap": {
+ "version": "0.32.21",
+ "resolved": "https://registry.npmjs.org/@types/react-bootstrap/-/react-bootstrap-0.32.21.tgz",
+ "integrity": "sha512-AV/6cMUBbKArEQcjXEzpoHexHi6hJL0cH3Vcw9qI4Ob2g/XFRvyTAFdMlGlp8HZmOHXL35PdF0K75Z31Po87qg==",
+ "requires": {
+ "@types/react": "*"
+ }
+ },
"@types/react-dom": {
"version": "16.9.5",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.5.tgz",
diff --git a/superset-frontend/package.json b/superset-frontend/package.json
index 4b3c2b526f..b089bf8146 100644
--- a/superset-frontend/package.json
+++ b/superset-frontend/package.json
@@ -63,7 +63,7 @@
"@superset-ui/chart-composition": "^0.13.5",
"@superset-ui/color": "^0.13.3",
"@superset-ui/connection": "^0.13.5",
- "@superset-ui/control-utils": "^0.13.3",
+ "@superset-ui/control-utils": "^0.13.9",
"@superset-ui/core": "^0.13.5",
"@superset-ui/dimension": "^0.13.3",
"@superset-ui/legacy-plugin-chart-calendar": "^0.13.6",
@@ -79,7 +79,7 @@
"@superset-ui/legacy-plugin-chart-markup": "^0.13.3",
"@superset-ui/legacy-plugin-chart-paired-t-test": "^0.13.5",
"@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.13.3",
- "@superset-ui/legacy-plugin-chart-partition": "^0.13.5",
+ "@superset-ui/legacy-plugin-chart-partition": "^0.13.11",
"@superset-ui/legacy-plugin-chart-pivot-table": "^0.13.10",
"@superset-ui/legacy-plugin-chart-rose": "^0.13.10",
"@superset-ui/legacy-plugin-chart-sankey": "^0.13.10",
diff --git a/superset-frontend/spec/javascripts/components/ColumnOption_spec.jsx b/superset-frontend/spec/javascripts/components/ColumnOption_spec.jsx
index 6e780b33a1..8375ba6c16 100644
--- a/superset-frontend/spec/javascripts/components/ColumnOption_spec.jsx
+++ b/superset-frontend/spec/javascripts/components/ColumnOption_spec.jsx
@@ -19,9 +19,9 @@
import React from 'react';
import { shallow } from 'enzyme';
+import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
import ColumnOption from 'src/components/ColumnOption';
import ColumnTypeLabel from 'src/components/ColumnTypeLabel';
-import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
describe('ColumnOption', () => {
const defaultProps = {
diff --git a/superset-frontend/spec/javascripts/components/FormRow_spec.jsx b/superset-frontend/spec/javascripts/components/FormRow_spec.jsx
index cd53bd667a..631658ded3 100644
--- a/superset-frontend/spec/javascripts/components/FormRow_spec.jsx
+++ b/superset-frontend/spec/javascripts/components/FormRow_spec.jsx
@@ -19,9 +19,9 @@
import React from 'react';
import { shallow } from 'enzyme';
+import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
import { Col, Row } from 'react-bootstrap';
import TextControl from 'src/explore/components/controls/TextControl';
-import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
import FormRow from 'src/components/FormRow';
const defaultProps = {
diff --git a/superset-frontend/spec/javascripts/components/MetricOption_spec.jsx b/superset-frontend/spec/javascripts/components/MetricOption_spec.jsx
index c78af99d26..1ab8314d17 100644
--- a/superset-frontend/spec/javascripts/components/MetricOption_spec.jsx
+++ b/superset-frontend/spec/javascripts/components/MetricOption_spec.jsx
@@ -18,10 +18,10 @@
*/
import React from 'react';
import { shallow } from 'enzyme';
+import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
import MetricOption from 'src/components/MetricOption';
import ColumnTypeLabel from 'src/components/ColumnTypeLabel';
-import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
describe('MetricOption', () => {
const defaultProps = {
diff --git a/superset-frontend/spec/javascripts/components/OptionDescription_spec.jsx b/superset-frontend/spec/javascripts/components/OptionDescription_spec.jsx
deleted file mode 100644
index 3b847d4fa1..0000000000
--- a/superset-frontend/spec/javascripts/components/OptionDescription_spec.jsx
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import React from 'react';
-import { shallow } from 'enzyme';
-
-import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
-import OptionDescription from 'src/components/OptionDescription';
-
-const defaultProps = {
- option: {
- label: 'Some option',
- description: 'Description for some option',
- },
-};
-
-describe('OptionDescription', () => {
- let wrapper;
- let props;
-
- beforeEach(() => {
- props = { option: { ...defaultProps.option } };
- wrapper = shallow();
- });
-
- it('renders an InfoTooltipWithTrigger', () => {
- expect(wrapper.find(InfoTooltipWithTrigger)).toHaveLength(1);
- });
-
- it('renders a span with the label', () => {
- expect(wrapper.find('.option-label').text()).toBe('Some option');
- });
-});
diff --git a/superset-frontend/spec/javascripts/explore/components/ControlPanelSection_spec.jsx b/superset-frontend/spec/javascripts/explore/components/ControlPanelSection_spec.jsx
index e2839fdb46..4e30807707 100644
--- a/superset-frontend/spec/javascripts/explore/components/ControlPanelSection_spec.jsx
+++ b/superset-frontend/spec/javascripts/explore/components/ControlPanelSection_spec.jsx
@@ -19,9 +19,7 @@
import React from 'react';
import { shallow } from 'enzyme';
import { Panel } from 'react-bootstrap';
-
-import InfoTooltipWithTrigger from 'src/components/InfoTooltipWithTrigger';
-
+import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
import ControlPanelSection from 'src/explore/components/ControlPanelSection';
const defaultProps = {
diff --git a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton.jsx b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton.jsx
index b90d351b31..7f72a85a69 100644
--- a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton.jsx
+++ b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton.jsx
@@ -22,10 +22,10 @@ import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import Dialog from 'react-bootstrap-dialog';
import { t } from '@superset-ui/translation';
+import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
import { exportChart } from '../../explore/exploreUtils';
import * as actions from '../actions/sqlLab';
-import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
import Button from '../../components/Button';
const propTypes = {
@@ -36,6 +36,7 @@ const propTypes = {
errorMessage: PropTypes.string,
templateParams: PropTypes.string,
};
+
const defaultProps = {
vizRequest: {},
};
diff --git a/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx b/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx
index 2e8746448c..bf2fd55d7f 100644
--- a/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx
+++ b/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx
@@ -24,11 +24,11 @@ import { connect } from 'react-redux';
import { Alert } from 'react-bootstrap';
import Dialog from 'react-bootstrap-dialog';
import { t } from '@superset-ui/translation';
+import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
import shortid from 'shortid';
import { exportChart } from '../../explore/exploreUtils';
import * as actions from '../actions/sqlLab';
-import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
import Button from '../../components/Button';
const propTypes = {
diff --git a/superset-frontend/src/SqlLab/components/TemplateParamsEditor.jsx b/superset-frontend/src/SqlLab/components/TemplateParamsEditor.jsx
index c907ce26a1..41413733e0 100644
--- a/superset-frontend/src/SqlLab/components/TemplateParamsEditor.jsx
+++ b/superset-frontend/src/SqlLab/components/TemplateParamsEditor.jsx
@@ -27,9 +27,9 @@ import 'brace/mode/markdown';
import 'brace/theme/textmate';
import { t } from '@superset-ui/translation';
+import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
import ModalTrigger from '../../components/ModalTrigger';
-import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
import Button from '../../components/Button';
const propTypes = {
diff --git a/superset-frontend/src/components/ActionMenuItem.jsx b/superset-frontend/src/components/ActionMenuItem.jsx
index dbb5d519c8..23eff70486 100644
--- a/superset-frontend/src/components/ActionMenuItem.jsx
+++ b/superset-frontend/src/components/ActionMenuItem.jsx
@@ -20,7 +20,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { MenuItem } from 'react-bootstrap';
-import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
+import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
export function MenuItemContent({ faIcon, text, tooltip, children }) {
return (
diff --git a/superset-frontend/src/components/ColumnOption.jsx b/superset-frontend/src/components/ColumnOption.jsx
index 6196006747..0fed0b2710 100644
--- a/superset-frontend/src/components/ColumnOption.jsx
+++ b/superset-frontend/src/components/ColumnOption.jsx
@@ -19,8 +19,8 @@
import React from 'react';
import PropTypes from 'prop-types';
+import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
import ColumnTypeLabel from './ColumnTypeLabel';
-import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
const propTypes = {
column: PropTypes.object.isRequired,
diff --git a/superset-frontend/src/components/FormRow.jsx b/superset-frontend/src/components/FormRow.jsx
index 1581271a0d..9e2f5f4a12 100644
--- a/superset-frontend/src/components/FormRow.jsx
+++ b/superset-frontend/src/components/FormRow.jsx
@@ -20,7 +20,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { Row, Col } from 'react-bootstrap';
-import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
+import { InfoTooltipWithTrigger } from '@superset-ui/control-utils';
const STYLE_ROW = { marginTop: '5px', minHeight: '30px' };
const STYLE_RALIGN = { textAlign: 'right' };
diff --git a/superset-frontend/src/components/InfoTooltipWithTrigger.jsx b/superset-frontend/src/components/InfoTooltipWithTrigger.jsx
deleted file mode 100644
index 518137c879..0000000000
--- a/superset-frontend/src/components/InfoTooltipWithTrigger.jsx
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-import React from 'react';
-import PropTypes from 'prop-types';
-import { kebabCase } from 'lodash';
-import { Tooltip, OverlayTrigger } from 'react-bootstrap';
-
-const propTypes = {
- label: PropTypes.string.isRequired,
- tooltip: PropTypes.string,
- icon: PropTypes.string,
- className: PropTypes.string,
- onClick: PropTypes.func,
- placement: PropTypes.string,
- bsStyle: PropTypes.string,
-};
-const defaultProps = {
- icon: 'info-circle',
- className: 'text-muted',
- placement: 'right',
-};
-const tooltipStyle = { wordWrap: 'break-word' };
-
-export default function InfoTooltipWithTrigger({
- label,
- tooltip,
- icon,
- className,
- onClick,
- placement,
- bsStyle,
-}) {
- const iconClass = `fa fa-${icon} ${className} ${
- bsStyle ? `text-${bsStyle}` : ''
- }`;
- const iconEl = (
-
- );
- if (!tooltip) {
- return iconEl;
- }
- return (
-
- {tooltip}
-
- }
- >
- {iconEl}
-
- );
-}
-
-InfoTooltipWithTrigger.propTypes = propTypes;
-InfoTooltipWithTrigger.defaultProps = defaultProps;
diff --git a/superset-frontend/src/components/ListView/LegacyFilters.tsx b/superset-frontend/src/components/ListView/LegacyFilters.tsx
index 6c493bc636..1b0d40b31c 100644
--- a/superset-frontend/src/components/ListView/LegacyFilters.tsx
+++ b/superset-frontend/src/components/ListView/LegacyFilters.tsx
@@ -67,6 +67,7 @@ export const FilterMenu = ({