mirror of
https://github.com/apache/superset.git
synced 2026-04-27 03:55:47 +00:00
chore: remove React 16.4's obsolete React imports (#28571)
Signed-off-by: hainenber <dotronghai96@gmail.com>
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render, screen } from 'spec/helpers/testing-library';
|
||||
import { ErrorLevel, supersetTheme } from '@superset-ui/core';
|
||||
import BasicErrorAlert from './BasicErrorAlert';
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { ErrorLevel, styled, useTheme } from '@superset-ui/core';
|
||||
import Icons from 'src/components/Icons';
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from '@superset-ui/core';
|
||||
import { render, screen } from 'spec/helpers/testing-library';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { ReactNode } from 'react';
|
||||
import { t, tn } from '@superset-ui/core';
|
||||
|
||||
import { ErrorMessageComponentProps } from './types';
|
||||
@@ -47,7 +47,7 @@ function DatabaseErrorMessage({
|
||||
{t('This may be triggered by:')}
|
||||
<br />
|
||||
{extra.issue_codes
|
||||
?.map<React.ReactNode>(issueCode => (
|
||||
?.map<ReactNode>(issueCode => (
|
||||
<IssueCode {...issueCode} key={issueCode.code} />
|
||||
))
|
||||
.reduce((prev, curr) => [prev, <br />, curr])}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from '@superset-ui/core';
|
||||
import { render, screen } from 'spec/helpers/testing-library';
|
||||
import DatasetNotFoundErrorMessage from './DatasetNotFoundErrorMessage';
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { t } from '@superset-ui/core';
|
||||
|
||||
import { ErrorMessageComponentProps } from './types';
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { render, screen } from 'spec/helpers/testing-library';
|
||||
import { ErrorLevel, ErrorSource, supersetTheme } from '@superset-ui/core';
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import React, { useState, ReactNode } from 'react';
|
||||
import { useState, ReactNode } from 'react';
|
||||
import {
|
||||
ErrorLevel,
|
||||
ErrorSource,
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from '@superset-ui/core';
|
||||
import { render, screen } from 'spec/helpers/testing-library';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { ReactNode } from 'react';
|
||||
import { ErrorSource, t, SupersetError } from '@superset-ui/core';
|
||||
import getErrorMessageComponentRegistry from './getErrorMessageComponentRegistry';
|
||||
import ErrorAlert from './ErrorAlert';
|
||||
@@ -27,13 +27,13 @@ type Props = {
|
||||
title?: string;
|
||||
error?: SupersetError;
|
||||
link?: string;
|
||||
subtitle?: React.ReactNode;
|
||||
subtitle?: ReactNode;
|
||||
copyText?: string;
|
||||
stackTrace?: string;
|
||||
source?: ErrorSource;
|
||||
description?: string;
|
||||
errorMitigationFunction?: () => void;
|
||||
fallback?: React.ReactNode;
|
||||
fallback?: ReactNode;
|
||||
};
|
||||
|
||||
export default function ErrorMessageWithStackTrace({
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render, screen } from 'spec/helpers/testing-library';
|
||||
import IssueCode from './IssueCode';
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
|
||||
interface IssueCodeProps {
|
||||
code: number;
|
||||
message: string;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render, screen, fireEvent } from '@testing-library/react';
|
||||
import '@testing-library/jest-dom/extend-expect';
|
||||
import {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { JSONTree } from 'react-json-tree';
|
||||
import { css, styled, SupersetTheme, t } from '@superset-ui/core';
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import * as reduxHooks from 'react-redux';
|
||||
import { Provider } from 'react-redux';
|
||||
import { createStore } from 'redux';
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { useEffect, useRef, MouseEvent } from 'react';
|
||||
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { QueryEditor, SqlLabRootState } from 'src/SqlLab/types';
|
||||
import { ExplorePageState } from 'src/explore/types';
|
||||
@@ -67,7 +68,7 @@ function OAuth2RedirectMessage({
|
||||
|
||||
// store a reference to the OAuth2 browser tab, so we can check that the success
|
||||
// message is coming from it
|
||||
const handleOAuthClick = (event: React.MouseEvent<HTMLAnchorElement>) => {
|
||||
const handleOAuthClick = (event: MouseEvent<HTMLAnchorElement>) => {
|
||||
event.preventDefault();
|
||||
oAuthTab.current = window.open(extra.url, '_blank');
|
||||
};
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { ErrorLevel, ErrorSource, ErrorTypeEnum } from '@superset-ui/core';
|
||||
import React from 'react';
|
||||
import { render, screen } from 'spec/helpers/testing-library';
|
||||
import ParameterErrorMessage from './ParameterErrorMessage';
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { ReactNode } from 'react';
|
||||
import { t, tn } from '@superset-ui/core';
|
||||
import levenshtein from 'js-levenshtein';
|
||||
|
||||
@@ -101,7 +101,7 @@ function ParameterErrorMessage({
|
||||
<br />
|
||||
{extra.issue_codes.length > 0 &&
|
||||
extra.issue_codes
|
||||
.map<React.ReactNode>(issueCode => <IssueCode {...issueCode} />)
|
||||
.map<ReactNode>(issueCode => <IssueCode {...issueCode} />)
|
||||
.reduce((prev, curr) => [prev, <br />, curr])}
|
||||
</p>
|
||||
</>
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
*/
|
||||
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
import { ErrorSource, ErrorTypeEnum, ErrorLevel } from '@superset-ui/core';
|
||||
import { render, screen } from 'spec/helpers/testing-library';
|
||||
import TimeoutErrorMessage from './TimeoutErrorMessage';
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { ReactNode } from 'react';
|
||||
import { t, tn } from '@superset-ui/core';
|
||||
|
||||
import { ErrorMessageComponentProps } from './types';
|
||||
@@ -62,7 +62,7 @@ function TimeoutErrorMessage({
|
||||
{t('This may be triggered by:')}
|
||||
<br />
|
||||
{extra.issue_codes
|
||||
.map<React.ReactNode>(issueCode => <IssueCode {...issueCode} />)
|
||||
.map<ReactNode>(issueCode => <IssueCode {...issueCode} />)
|
||||
.reduce((prev, curr) => [prev, <br />, curr])}
|
||||
</p>
|
||||
{isVisualization && extra.owners && (
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import React from 'react';
|
||||
import getErrorMessageComponentRegistry from 'src/components/ErrorMessage/getErrorMessageComponentRegistry';
|
||||
import { ErrorMessageComponentProps } from 'src/components/ErrorMessage/types';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user