You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by aa...@apache.org on 2022/09/01 18:05:22 UTC
[superset] 02/02: fix connect issue
This is an automated email from the ASF dual-hosted git repository.
aafghahi pushed a commit to branch arash.afghahi/sc-56572/database-connect-db-page-show-error-if-user
in repository https://gitbox.apache.org/repos/asf/superset.git
commit b3e76cc962ce9bab6d2a9f0d9e6141993706a190
Author: AAfghahi <ar...@gmail.com>
AuthorDate: Thu Sep 1 14:04:57 2022 -0400
fix connect issue
---
.../src/views/CRUD/data/database/DatabaseModal/index.tsx | 11 +++++++----
.../src/views/CRUD/data/database/DatabaseModal/styles.ts | 2 +-
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
index a4451822af..4ce10ad601 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
@@ -847,7 +847,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
const renderModalFooter = () => {
if (db) {
- // if db show back + connenct
+ // if db show back + connect
if (!hasConnectedDb || editNewDb) {
return (
<>
@@ -901,7 +901,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
);
}
- return [];
+ return null;
};
const renderEditModalFooter = (db: Partial<DatabaseObject> | null) => (
@@ -1302,7 +1302,9 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
</Modal>
);
}
-
+ const modalFooter = isEditMode
+ ? renderEditModalFooter(db)
+ : renderModalFooter();
return useTabLayout ? (
<Modal
css={(theme: SupersetTheme) => [
@@ -1323,7 +1325,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
title={
<h4>{isEditMode ? t('Edit database') : t('Connect a database')}</h4>
}
- footer={isEditMode ? renderEditModalFooter(db) : renderModalFooter()}
+ footer={modalFooter}
>
<StyledStickyHeader>
<TabHeader>
@@ -1509,6 +1511,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
show={show}
title={<h4>{t('Connect a database')}</h4>}
footer={renderModalFooter()}
+ hideFooter={renderModalFooter() ? false : true}
>
{!isLoading && hasConnectedDb ? (
<>
diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/styles.ts b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/styles.ts
index 9e085169af..af977a1bfe 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/styles.ts
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/styles.ts
@@ -156,7 +156,7 @@ export const antDModalStyles = (theme: SupersetTheme) => css`
}
.ant-modal-body {
- height: ${theme.gridUnit * 180.5}px;
+ height: ${theme.gridUnit * 188}px;
}
.ant-modal-footer {