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/4] 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/4] 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 d6fce1ff1d255ec74db37400d20a0ebf74b236e2 Mon Sep 17 00:00:00 2001 From: Arash Date: Fri, 25 Jun 2021 11:51:40 -0400 Subject: [PATCH 3/4] password error --- .../src/views/CRUD/data/database/DatabaseModal/index.tsx | 3 +++ 1 file changed, 3 insertions(+) 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..c23a82fd7ffe7 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx @@ -92,6 +92,9 @@ const errorAlertMapping = { CONNECTION_INVALID_PORT_ERROR: { message: 'The port must be a whole number less than or equal to 65535.', }, + CONNECTION_ACCESS_DENIED_ERROR: { + message: 'Either the username or password is incorrect.', + }, }; interface DatabaseModalProps { addDangerToast: (msg: string) => void; From 989bd2e92d6e046dd7401915dc90ba36a1b240e5 Mon Sep 17 00:00:00 2001 From: Arash Date: Fri, 25 Jun 2021 12:24:52 -0400 Subject: [PATCH 4/4] new errors --- .../src/views/CRUD/data/database/DatabaseModal/index.tsx | 7 ++++++- 1 file changed, 6 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 c23a82fd7ffe7..53d4e25a2521e 100644 --- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx +++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx @@ -93,7 +93,12 @@ const errorAlertMapping = { message: 'The port must be a whole number less than or equal to 65535.', }, CONNECTION_ACCESS_DENIED_ERROR: { - message: 'Either the username or password is incorrect.', + message: 'Invalid account information', + description: 'Either the username or password is incorrect.', + }, + CONNECTION_INVALID_PASSWORD_ERROR: { + message: 'Invalid account information', + description: 'Either the username or password is incorrect.', }, }; interface DatabaseModalProps {