From a36c8336ec74fede2cca835dbe91027da6d30b97 Mon Sep 17 00:00:00 2001
From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com>
Date: Mon, 1 Mar 2021 17:04:16 -0300
Subject: [PATCH] chore: Migrates RefreshChartOverlay into Chart (#13274)
* Migrates RefreshChartOverlay into Chart
* Removes unused Chart width prop
---
superset-frontend/src/chart/Chart.jsx | 30 ++++++----
.../src/components/RefreshChartOverlay.tsx | 56 -------------------
2 files changed, 20 insertions(+), 66 deletions(-)
delete mode 100644 superset-frontend/src/components/RefreshChartOverlay.tsx
diff --git a/superset-frontend/src/chart/Chart.jsx b/superset-frontend/src/chart/Chart.jsx
index d13a6e59a1..3032b33a30 100644
--- a/superset-frontend/src/chart/Chart.jsx
+++ b/superset-frontend/src/chart/Chart.jsx
@@ -19,15 +19,15 @@
import PropTypes from 'prop-types';
import React from 'react';
import Alert from 'src/components/Alert';
-import { styled, logging } from '@superset-ui/core';
+import { styled, logging, t } from '@superset-ui/core';
import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags';
-import { Logger, LOG_ACTIONS_RENDER_CHART } from '../logger/LogUtils';
+import Button from 'src/components/Button';
import Loading from '../components/Loading';
-import RefreshChartOverlay from '../components/RefreshChartOverlay';
import ErrorBoundary from '../components/ErrorBoundary';
import ChartRenderer from './ChartRenderer';
import { ChartErrorMessage } from './ChartErrorMessage';
+import { Logger, LOG_ACTIONS_RENDER_CHART } from '../logger/LogUtils';
const propTypes = {
annotationData: PropTypes.object,
@@ -43,8 +43,8 @@ const propTypes = {
// formData contains chart's own filter parameter
// and merged with extra filter that current dashboard applying
formData: PropTypes.object.isRequired,
- height: PropTypes.number,
width: PropTypes.number,
+ height: PropTypes.number,
setControlValue: PropTypes.func,
timeout: PropTypes.number,
vizType: PropTypes.string.isRequired,
@@ -87,6 +87,17 @@ const Styles = styled.div`
}
`;
+const RefreshOverlayWrapper = styled.div`
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+`;
+
class Chart extends React.PureComponent {
constructor(props) {
super(props);
@@ -168,7 +179,6 @@ class Chart extends React.PureComponent {
render() {
const {
- width,
height,
chartAlert,
chartStatus,
@@ -212,11 +222,11 @@ class Chart extends React.PureComponent {
{!isLoading && !chartAlert && isFaded && (
-
+
+
+
)}
{isLoading && }
diff --git a/superset-frontend/src/components/RefreshChartOverlay.tsx b/superset-frontend/src/components/RefreshChartOverlay.tsx
deleted file mode 100644
index 7e727bd28b..0000000000
--- a/superset-frontend/src/components/RefreshChartOverlay.tsx
+++ /dev/null
@@ -1,56 +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 { t, styled } from '@superset-ui/core';
-import Button from 'src/components/Button';
-
-type Callback = (...args: any[]) => void;
-
-interface Props {
- height: number;
- width: number;
- onQuery: Callback;
-}
-
-const RefreshOverlayWrapper = styled.div`
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
-`;
-
-class RefreshChartOverlay extends React.PureComponent {
- render() {
- return (
-
-
-
-
-
- );
- }
-}
-
-export default RefreshChartOverlay;