From dbbf58c10d20ffccd1d2e035db79e9fafe02a9d7 Mon Sep 17 00:00:00 2001 From: AAfghahi <48933336+AAfghahi@users.noreply.github.com> Date: Fri, 11 Jun 2021 11:55:17 -0400 Subject: [PATCH 1/3] fix: add icons (#15122) * added alerts * revisions * added icon --- .../src/views/CRUD/data/database/DatabaseModal/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 40721000a9ed0..e35020065974d 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx @@ -361,6 +361,7 @@ const DatabaseModal: FunctionComponent = ({ ))} antDAlertStyles(theme)} type="info" message={t('Want to add a new database?')} @@ -532,6 +533,7 @@ const DatabaseModal: FunctionComponent = ({ antDAlertStyles(theme)} message="Additional fields may be required" + showIcon description={ <> Select databases require additional fields to be completed in @@ -548,7 +550,6 @@ const DatabaseModal: FunctionComponent = ({ } type="info" - showIcon /> )} @@ -660,6 +661,7 @@ const DatabaseModal: FunctionComponent = ({ antDAlertStyles(theme)} type="info" + showIcon message={t('Whitelisting IPs')} description={connectionAlert.WHITELISTED_IPS} /> From 8a4ff629cced16551f140f9d85bd00c104f62246 Mon Sep 17 00:00:00 2001 From: Arash Date: Thu, 17 Jun 2021 11:24:32 -0400 Subject: [PATCH 2/3] spinner --- .../src/views/CRUD/data/database/DatabaseModal/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 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 a2f3145a78886..83e5fc06c5f14 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx @@ -49,6 +49,7 @@ import { DatabaseForm, CONFIGURATION_METHOD, } from 'src/views/CRUD/data/database/types'; +import Loading from 'src/components/Loading'; import ExtraOptions from './ExtraOptions'; import SqlAlchemyForm from './SqlAlchemyForm'; import DatabaseConnectionForm from './DatabaseConnectionForm'; @@ -376,7 +377,7 @@ const DatabaseModal: FunctionComponent = ({ ), }); } - + setLoading(true); const result = await updateResource( db.id as number, update as DatabaseObject, @@ -411,7 +412,7 @@ const DatabaseModal: FunctionComponent = ({ ), }); } - + setLoading(true); const dbId = await createResource(update as DatabaseObject); if (dbId) { setHasConnectedDb(true); @@ -425,6 +426,7 @@ const DatabaseModal: FunctionComponent = ({ } } } + setLoading(false); }; const onChange = (type: any, payload: any) => { @@ -593,7 +595,7 @@ const DatabaseModal: FunctionComponent = ({ if (isLoading) { setLoading(false); } - }, [availableDbs, isLoading]); + }, [availableDbs]); const tabChange = (key: string) => { setTabKey(key); @@ -910,6 +912,7 @@ const DatabaseModal: FunctionComponent = ({ ))} )} + {isLoading && } ); }; From 7baed4035741f1d7bba542d1b3672f8995169784 Mon Sep 17 00:00:00 2001 From: Arash Date: Fri, 25 Jun 2021 12:36:51 -0400 Subject: [PATCH 3/3] fixing backButton on Create --- .../CRUD/data/database/DatabaseModal/index.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 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 63afc6ac2864d..03c6fc4a6f9b9 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx @@ -588,18 +588,20 @@ const DatabaseModal: FunctionComponent = ({ setEditNewDb(true); }; + const handleBackButtonOnConnect = () => { + if (editNewDb) { + setHasConnectedDb(false); + } + setDB({ type: ActionType.reset }); + }; + const renderModalFooter = () => { if (db) { // if db show back + connenct if (!hasConnectedDb || editNewDb) { return ( <> - { - setDB({ type: ActionType.reset }); - }} - > + Back