mirror of
https://github.com/apache/superset.git
synced 2026-06-05 15:49:27 +00:00
refactor(Switch): Upgrade Switch to Ant Design 5 (#30731)
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
import { SupersetTheme, t } from '@superset-ui/core';
|
||||
import { AntdSwitch } from 'src/components';
|
||||
import { Switch } from 'src/components/Switch';
|
||||
import InfoTooltip from 'src/components/InfoTooltip';
|
||||
import ValidatedInput from 'src/components/Form/LabeledErrorBoundInput';
|
||||
import { FieldPropTypes } from '../../types';
|
||||
@@ -296,7 +296,7 @@ export const forceSSLField = ({
|
||||
sslForced,
|
||||
}: FieldPropTypes) => (
|
||||
<div css={(theme: SupersetTheme) => infoTooltip(theme)}>
|
||||
<AntdSwitch
|
||||
<Switch
|
||||
disabled={sslForced && !isEditMode}
|
||||
checked={db?.parameters?.encryption || sslForced}
|
||||
onChange={changed => {
|
||||
|
||||
@@ -26,8 +26,8 @@ jest.mock('@superset-ui/core', () => ({
|
||||
isFeatureEnabled: jest.fn().mockReturnValue(true),
|
||||
}));
|
||||
|
||||
jest.mock('src/components', () => ({
|
||||
AntdSwitch: ({
|
||||
jest.mock('src/components/Switch', () => ({
|
||||
Switch: ({
|
||||
checked,
|
||||
onChange,
|
||||
}: {
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
isFeatureEnabled,
|
||||
FeatureFlag,
|
||||
} from '@superset-ui/core';
|
||||
import { AntdSwitch } from 'src/components';
|
||||
import { Switch } from 'src/components/Switch';
|
||||
import InfoTooltip from 'src/components/InfoTooltip';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { infoTooltip, toggleStyle } from './styles';
|
||||
@@ -80,7 +80,7 @@ const SSHTunnelSwitch = ({
|
||||
|
||||
return isSSHTunnelEnabled ? (
|
||||
<div css={(theme: SupersetTheme) => infoTooltip(theme)}>
|
||||
<AntdSwitch
|
||||
<Switch
|
||||
checked={isChecked}
|
||||
onChange={handleOnChange}
|
||||
data-test="ssh-tunnel-switch"
|
||||
|
||||
Reference in New Issue
Block a user