mirror of https://github.com/apache/superset.git
fix: do not close database modal on mask click (#28750)
(cherry picked from commit cbd3fa2190
)
This commit is contained in:
parent
9d3d6d1de7
commit
0e5593f8d7
|
@ -1715,35 +1715,36 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
|||
) {
|
||||
return (
|
||||
<Modal
|
||||
centered
|
||||
css={(theme: SupersetTheme) => [
|
||||
antDModalNoPaddingStyles,
|
||||
antDModalStyles(theme),
|
||||
formHelperStyles(theme),
|
||||
formStyles(theme),
|
||||
]}
|
||||
footer={renderModalFooter()}
|
||||
maskClosable={false}
|
||||
name="database"
|
||||
onHandledPrimaryAction={onSave}
|
||||
onHide={onClose}
|
||||
onHandledPrimaryAction={onSave}
|
||||
primaryButtonName={t('Connect')}
|
||||
width="500px"
|
||||
centered
|
||||
show={show}
|
||||
title={<h4>{t('Connect a database')}</h4>}
|
||||
footer={renderModalFooter()}
|
||||
width="500px"
|
||||
>
|
||||
<ModalHeader
|
||||
isLoading={isLoading}
|
||||
isEditMode={isEditMode}
|
||||
useSqlAlchemyForm={useSqlAlchemyForm}
|
||||
hasConnectedDb={hasConnectedDb}
|
||||
db={db}
|
||||
dbName={dbName}
|
||||
dbModel={dbModel}
|
||||
fileList={fileList}
|
||||
hasConnectedDb={hasConnectedDb}
|
||||
isEditMode={isEditMode}
|
||||
isLoading={isLoading}
|
||||
useSqlAlchemyForm={useSqlAlchemyForm}
|
||||
/>
|
||||
{passwordNeededField()}
|
||||
{confirmOverwriteField()}
|
||||
{importingErrorAlert()}
|
||||
{passwordNeededField()}
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
@ -1771,6 +1772,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
|||
<h4>{isEditMode ? t('Edit database') : t('Connect a database')}</h4>
|
||||
}
|
||||
footer={modalFooter}
|
||||
maskClosable={false}
|
||||
>
|
||||
<StyledStickyHeader>
|
||||
<TabHeader>
|
||||
|
@ -1930,6 +1932,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
|
|||
show={show}
|
||||
title={<h4>{t('Connect a database')}</h4>}
|
||||
footer={renderModalFooter()}
|
||||
maskClosable={false}
|
||||
>
|
||||
{!isLoading && hasConnectedDb ? (
|
||||
<>
|
||||
|
|
|
@ -24,7 +24,6 @@ from pyhive.sqlalchemy_presto import PrestoDialect
|
|||
from sqlalchemy import sql, text, types
|
||||
from sqlalchemy.engine.url import make_url
|
||||
|
||||
from superset.sql_parse import Table
|
||||
from superset.utils.core import GenericDataType
|
||||
from tests.unit_tests.db_engine_specs.utils import (
|
||||
assert_column_spec,
|
||||
|
@ -135,7 +134,7 @@ def test_where_latest_partition(
|
|||
str(
|
||||
PrestoEngineSpec.where_latest_partition( # type: ignore
|
||||
database=mock.MagicMock(),
|
||||
table=Table("table"),
|
||||
table_name="table",
|
||||
query=sql.select(text("* FROM table")),
|
||||
columns=[
|
||||
{
|
||||
|
|
|
@ -38,14 +38,12 @@ from superset.db_engine_specs.exceptions import (
|
|||
SupersetDBAPIOperationalError,
|
||||
SupersetDBAPIProgrammingError,
|
||||
)
|
||||
from superset.sql_parse import Table
|
||||
from superset.superset_typing import ResultSetColumnType, SQLAColumnType, SQLType
|
||||
from superset.utils.core import GenericDataType
|
||||
from tests.unit_tests.db_engine_specs.utils import (
|
||||
assert_column_spec,
|
||||
assert_convert_dttm,
|
||||
)
|
||||
from tests.unit_tests.fixtures.common import dttm
|
||||
|
||||
|
||||
def _assert_columns_equal(actual_cols, expected_cols) -> None:
|
||||
|
@ -576,7 +574,7 @@ def test_where_latest_partition(
|
|||
str(
|
||||
TrinoEngineSpec.where_latest_partition( # type: ignore
|
||||
database=MagicMock(),
|
||||
table=Table("table"),
|
||||
table_name="table",
|
||||
query=sql.select(text("* FROM table")),
|
||||
columns=[
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue