From 9deb7aa3c15ce59bd2ecd67970386bddce7c832e Mon Sep 17 00:00:00 2001
From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com>
Date: Mon, 17 May 2021 14:24:56 -0300
Subject: [PATCH] chore: Replaces Icon with Icons component - iteration 1
(#14469)
---
.../explore/components/EmbedCodeButton.jsx | 6 ++--
.../components/ExploreActionButtons.tsx | 30 ++++++----------
.../components/ExploreViewContainer.jsx | 25 ++++++++------
.../DndSelectLabel.test.tsx | 12 +++----
.../DndColumnSelectControl/DndSelectLabel.tsx | 4 +--
.../AdhocFilterControl/index.jsx | 15 +++-----
.../AdhocFilterOption.test.tsx | 24 +++++++------
.../controls/MetricControl/MetricsControl.jsx | 15 +++-----
.../OptionControls/OptionControls.test.tsx | 34 ++++++++++++-------
9 files changed, 79 insertions(+), 86 deletions(-)
diff --git a/superset-frontend/src/explore/components/EmbedCodeButton.jsx b/superset-frontend/src/explore/components/EmbedCodeButton.jsx
index c379a1aa5..24b62ecd1 100644
--- a/superset-frontend/src/explore/components/EmbedCodeButton.jsx
+++ b/superset-frontend/src/explore/components/EmbedCodeButton.jsx
@@ -22,7 +22,7 @@ import { t } from '@superset-ui/core';
import Popover from 'src/components/Popover';
import { FormLabel } from 'src/components/Form';
-import Icon from 'src/components/Icon';
+import Icons from 'src/components/Icons';
import { Tooltip } from 'src/components/Tooltip';
import CopyToClipboard from 'src/components/CopyToClipboard';
import { getShortUrl } from 'src/utils/urlUtils';
@@ -161,9 +161,9 @@ export default class EmbedCodeButton extends React.Component {
{
{latestQueryFormData && (
<>
- }
+ icon={
}
tooltip={copyTooltip}
onClick={doCopyLink}
data-test="short-link-button"
@@ -161,26 +158,19 @@ const ExploreActionButtons = (props: ExploreActionButtonsProps) => {
}
/>
- }
+ icon={
}
tooltip={t('Share chart by email')}
onClick={doShareEmail}
/>
}
+ icon={
}
text=".JSON"
tooltip={t('Export to .JSON format')}
onClick={doExportJson}
/>
}
+ icon={
}
text=".CSV"
tooltip={t('Export to .CSV format')}
onClick={doExportCSV}
diff --git a/superset-frontend/src/explore/components/ExploreViewContainer.jsx b/superset-frontend/src/explore/components/ExploreViewContainer.jsx
index 7444f7672..7be486e1d 100644
--- a/superset-frontend/src/explore/components/ExploreViewContainer.jsx
+++ b/superset-frontend/src/explore/components/ExploreViewContainer.jsx
@@ -21,7 +21,7 @@ import React, { useEffect, useMemo, useState } from 'react';
import PropTypes from 'prop-types';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
-import { styled, t, supersetTheme, css } from '@superset-ui/core';
+import { styled, t, css, useTheme } from '@superset-ui/core';
import { debounce } from 'lodash';
import { Resizable } from 're-resizable';
@@ -29,7 +29,7 @@ import { useDynamicPluginContext } from 'src/components/DynamicPlugins';
import { Global } from '@emotion/react';
import { Tooltip } from 'src/components/Tooltip';
import { usePrevious } from 'src/common/hooks/usePrevious';
-import Icon from 'src/components/Icon';
+import Icons from 'src/components/Icons';
import {
getFromLocalStorage,
setInLocalStorage,
@@ -170,6 +170,7 @@ function ExploreViewContainer(props) {
const [showingModal, setShowingModal] = useState(false);
const [isCollapsed, setIsCollapsed] = useState(false);
+ const theme = useTheme();
const width = `${windowSize.width}px`;
const navHeight = props.standalone ? 0 : 90;
const height = props.forcedHeight
@@ -472,11 +473,10 @@ function ExploreViewContainer(props) {
className="action-button"
onClick={toggleCollapse}
>
-
@@ -496,15 +496,18 @@ function ExploreViewContainer(props) {
>