mirror of
https://github.com/apache/superset.git
synced 2026-04-26 19:44:58 +00:00
refactor: Replace react-bootstrap dialogs with Antd dialogs (#11527)
* Refactor Dialogs in dashboard properties modal * Refactor Dialogs in explore properties modal * Refactor dialogs in DatasourceModal * Refactor dialogs in ExploreResultsButton * Remove react-bootstrap-dialog from ExploreCtasResultsButton * Remove react-bootstrap-dialog dependency * Remove unnecessary functions from Modal * Bump antd version to fix a bug * Fix unit tests * Fix e2e test * Change antd version to 4.5.4 to fix tests * Reenable all tests in control * Another version bump to fix tests
This commit is contained in:
committed by
GitHub
parent
1ebeffa104
commit
937f9ca277
@@ -20,7 +20,6 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { connect } from 'react-redux';
|
||||
import Dialog from 'react-bootstrap-dialog';
|
||||
import { t } from '@superset-ui/core';
|
||||
import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
|
||||
|
||||
@@ -99,11 +98,6 @@ class ExploreCtasResultsButton extends React.PureComponent {
|
||||
/>{' '}
|
||||
{t('Explore')}
|
||||
</Button>
|
||||
<Dialog
|
||||
ref={el => {
|
||||
this.dialog = el;
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -22,11 +22,11 @@ import PropTypes from 'prop-types';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { connect } from 'react-redux';
|
||||
import { Alert } from 'react-bootstrap';
|
||||
import Dialog from 'react-bootstrap-dialog';
|
||||
import { t } from '@superset-ui/core';
|
||||
import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
|
||||
import shortid from 'shortid';
|
||||
|
||||
import Modal from 'src/common/components/Modal';
|
||||
import Button from 'src/components/Button';
|
||||
import { exploreChart } from '../../explore/exploreUtils';
|
||||
import * as actions from '../actions/sqlLab';
|
||||
@@ -57,30 +57,16 @@ class ExploreResultsButton extends React.PureComponent {
|
||||
const { timeout } = this.props;
|
||||
const msg = this.renderInvalidColumnMessage();
|
||||
if (Math.round(this.getQueryDuration()) > timeout) {
|
||||
this.dialog.show({
|
||||
Modal.confirm({
|
||||
title: t('Explore'),
|
||||
body: this.renderTimeoutWarning(),
|
||||
actions: [
|
||||
Dialog.CancelAction(),
|
||||
Dialog.OKAction(() => {
|
||||
this.visualize();
|
||||
}),
|
||||
],
|
||||
bsSize: 'large',
|
||||
onHide: dialog => {
|
||||
dialog.hide();
|
||||
},
|
||||
content: this.renderTimeoutWarning(),
|
||||
onOk: this.visualize,
|
||||
icon: null,
|
||||
});
|
||||
} else if (msg) {
|
||||
this.dialog.show({
|
||||
Modal.warning({
|
||||
title: t('Explore'),
|
||||
body: msg,
|
||||
actions: [Dialog.DefaultAction('Ok', () => {})],
|
||||
bsSize: 'large',
|
||||
bsStyle: 'warning',
|
||||
onHide: dialog => {
|
||||
dialog.hide();
|
||||
},
|
||||
content: msg,
|
||||
});
|
||||
} else {
|
||||
this.visualize();
|
||||
@@ -228,11 +214,6 @@ class ExploreResultsButton extends React.PureComponent {
|
||||
/>{' '}
|
||||
{t('Explore')}
|
||||
</Button>
|
||||
<Dialog
|
||||
ref={el => {
|
||||
this.dialog = el;
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user