mirror of
https://github.com/apache/superset.git
synced 2026-05-10 18:35:40 +00:00
refactor(Dropdown): Migrate Dropdown to Ant Design 5 (#31972)
This commit is contained in:
committed by
GitHub
parent
38c46fcafd
commit
bcc61bd933
@@ -107,6 +107,12 @@ describe('DatasourceControl', () => {
|
||||
expect(screen.queryAllByRole('menuitem')).toHaveLength(3);
|
||||
});
|
||||
|
||||
// Close the menu
|
||||
userEvent.click(document.body);
|
||||
await waitFor(() => {
|
||||
expect(screen.queryAllByRole('menuitem')).toHaveLength(0);
|
||||
});
|
||||
|
||||
rerender(<DatasourceControl {...{ ...props, isEditable: false }} />, {
|
||||
useRedux: true,
|
||||
useRouter: true,
|
||||
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
} from '@superset-ui/core';
|
||||
import { getTemporalColumns } from '@superset-ui/chart-controls';
|
||||
import { getUrlParam } from 'src/utils/urlUtils';
|
||||
import { AntdDropdown } from 'src/components';
|
||||
import { Dropdown } from 'src/components/Dropdown';
|
||||
import { Menu } from 'src/components/Menu';
|
||||
import { Tooltip } from 'src/components/Tooltip';
|
||||
import Icons from 'src/components/Icons';
|
||||
@@ -82,12 +82,8 @@ const Styles = styled.div`
|
||||
.error-alert {
|
||||
margin: ${({ theme }) => 2 * theme.gridUnit}px;
|
||||
}
|
||||
.ant-dropdown-trigger {
|
||||
.antd5-dropdown-trigger {
|
||||
margin-left: ${({ theme }) => 2 * theme.gridUnit}px;
|
||||
box-shadow: none;
|
||||
&:active {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
.btn-group .open .dropdown-toggle {
|
||||
box-shadow: none;
|
||||
@@ -410,8 +406,8 @@ class DatasourceControl extends PureComponent {
|
||||
{extra?.warning_markdown && (
|
||||
<WarningIconWithTooltip warningMarkdown={extra.warning_markdown} />
|
||||
)}
|
||||
<AntdDropdown
|
||||
overlay={
|
||||
<Dropdown
|
||||
dropdownRender={() =>
|
||||
datasource.type === DatasourceType.Query
|
||||
? queryDatasourceMenu
|
||||
: defaultDatasourceMenu
|
||||
@@ -423,7 +419,7 @@ class DatasourceControl extends PureComponent {
|
||||
className="datasource-modal-trigger"
|
||||
data-test="datasource-menu-trigger"
|
||||
/>
|
||||
</AntdDropdown>
|
||||
</Dropdown>
|
||||
</div>
|
||||
{/* missing dataset */}
|
||||
{isMissingDatasource && isMissingParams && (
|
||||
|
||||
Reference in New Issue
Block a user