diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js
index 1ba0436c283c7..8decc32ee7dc8 100644
--- a/superset-frontend/.eslintrc.js
+++ b/superset-frontend/.eslintrc.js
@@ -181,7 +181,6 @@ module.exports = {
],
'no-only-tests/no-only-tests': 'error',
'max-classes-per-file': 0,
- 'theme-colors/no-literal-colors': 0,
},
},
{
@@ -198,6 +197,7 @@ module.exports = {
],
rules: {
'theme-colors/no-literal-colors': 0,
+ 'no-restricted-imports': 0,
},
},
],
diff --git a/superset-frontend/src/SqlLab/components/App/index.jsx b/superset-frontend/src/SqlLab/components/App/index.jsx
index 87b387beb36c5..8a0ade9509ac6 100644
--- a/superset-frontend/src/SqlLab/components/App/index.jsx
+++ b/superset-frontend/src/SqlLab/components/App/index.jsx
@@ -20,13 +20,13 @@ import React from 'react';
import PropTypes from 'prop-types';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
-import { supersetTheme, t, ThemeProvider } from '@superset-ui/core';
+import { t } from '@superset-ui/core';
import throttle from 'lodash/throttle';
import ToastContainer from 'src/components/MessageToasts/ToastContainer';
import {
LOCALSTORAGE_MAX_USAGE_KB,
- LOCALSTORAGE_WARNING_MESSAGE_THROTTLE_MS,
LOCALSTORAGE_WARNING_THRESHOLD,
+ LOCALSTORAGE_WARNING_MESSAGE_THROTTLE_MS,
} from 'src/SqlLab/constants';
import * as Actions from 'src/SqlLab/actions/sqlLab';
import TabbedSqlEditors from '../TabbedSqlEditors';
@@ -95,18 +95,14 @@ class App extends React.PureComponent {
render() {
if (this.state.hash && this.state.hash === '#search') {
- return window.location.replace(
- `${process.env.APP_PREFIX}/superset/sqllab/history/`,
- );
+ return window.location.replace('/superset/sqllab/history/');
}
return (
-
-
-
-
-
-
-
+
+
+
+
+
);
}
}
diff --git a/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.jsx b/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.jsx
index 198759c69ecb6..823f10741ac09 100644
--- a/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.jsx
+++ b/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.jsx
@@ -17,8 +17,8 @@
* under the License.
*/
import React from 'react';
-import { shallow } from 'enzyme';
-
+import { mount } from 'enzyme';
+import { supersetTheme, ThemeProvider } from '@superset-ui/core';
import RunQueryActionButton from 'src/SqlLab/components/RunQueryActionButton';
import Button from 'src/components/Button';
@@ -35,7 +35,10 @@ describe('RunQueryActionButton', () => {
};
beforeEach(() => {
- wrapper = shallow();
+ wrapper = mount(, {
+ wrappingComponent: ThemeProvider,
+ wrappingComponentProps: { theme: supersetTheme },
+ });
});
it('is a valid react element', () => {
diff --git a/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx b/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx
index 1d07745b05ebd..2a9e0fbaf8d8b 100644
--- a/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx
+++ b/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx
@@ -17,7 +17,7 @@
* under the License.
*/
import React from 'react';
-import { styled, supersetTheme, t } from '@superset-ui/core';
+import { t, styled, useTheme } from '@superset-ui/core';
import { Menu } from 'src/components/Menu';
import Button, { ButtonProps } from 'src/components/Button';
@@ -93,6 +93,8 @@ const RunQueryActionButton = ({
runQuery,
stopQuery,
}: Props) => {
+ const theme = useTheme();
+
const shouldShowStopBtn =
!!queryState && ['running', 'pending'].indexOf(queryState) > -1;
@@ -123,8 +125,8 @@ const RunQueryActionButton = ({
diff --git a/superset-frontend/src/components/CertifiedBadge/index.tsx b/superset-frontend/src/components/CertifiedBadge/index.tsx
index c5d71ad9554bb..80581e6320d70 100644
--- a/superset-frontend/src/components/CertifiedBadge/index.tsx
+++ b/superset-frontend/src/components/CertifiedBadge/index.tsx
@@ -17,7 +17,7 @@
* under the License.
*/
import React from 'react';
-import { supersetTheme, t } from '@superset-ui/core';
+import { t, useTheme } from '@superset-ui/core';
import Icons, { IconType } from 'src/components/Icons';
import { Tooltip } from 'src/components/Tooltip';
@@ -32,6 +32,8 @@ function CertifiedBadge({
details,
size = 'l',
}: CertifiedBadgeProps) {
+ const theme = useTheme();
+
return (
}
>
-
+
);
}
diff --git a/superset-frontend/src/components/Icons/Icon.tsx b/superset-frontend/src/components/Icons/Icon.tsx
index 2cf3bfff5ab2d..16c210f0f91c8 100644
--- a/superset-frontend/src/components/Icons/Icon.tsx
+++ b/superset-frontend/src/components/Icons/Icon.tsx
@@ -42,7 +42,7 @@ export const StyledIcon = styled(AntdIconComponent)`
: '24px'};
`;
-interface IconProps extends IconType {
+export interface IconProps extends IconType {
fileName: string;
}
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterSets/FilterSetUnit.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterSets/FilterSetUnit.tsx
index 2c21dc6afe01f..53ea1c94c5289 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterSets/FilterSetUnit.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterSets/FilterSetUnit.tsx
@@ -24,7 +24,7 @@ import {
FilterSet,
HandlerFunction,
styled,
- supersetTheme,
+ useTheme,
t,
} from '@superset-ui/core';
import { CheckOutlined, EllipsisOutlined } from '@ant-design/icons';
@@ -76,6 +76,8 @@ const FilterSetUnit: FC = ({
isApplied,
onRebuild,
}) => {
+ const theme = useTheme();
+
const menu = (