hughhhh commented on a change in pull request #15374:
URL: https://github.com/apache/superset/pull/15374#discussion_r658328950



##########
File path: 
superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
##########
@@ -74,6 +74,29 @@ import {
 } from './styles';
 import ModalHeader, { DOCUMENTATION_LINK } from './ModalHeader';
 
+const errorAlertMapping = {
+  CONNECTION_MISSING_PARAMETERS_ERROR: {
+    message: 'Missing Required Fields',
+    description: 'Please complete all required fields.',
+  },
+  CONNECTION_INVALID_HOSTNAME_ERROR: {
+    message: 'Could not verify the host',
+    description:
+      'The host is invalid. Please verify that this field is entered 
correctly.',
+  },
+  CONNECTION_PORT_CLOSED_ERROR: {
+    message: 'Port is closed',
+    description: 'Please verify that port is open to connect.',
+  },
+  CONNECTION_INVALID_PORT_ERROR: {
+    message: 'The port must be a whole number less than or equal to 65535.',
+  },
+  database_name: {

Review comment:
       i dont think we should have the same mapping for validation and dbError. 
Just because the key is `database_name` doesn't mean we can guess the 
uniqueness is the problem.
   
   I would have 2 seperate alerts 1 for db errors and 1 for validation, and 
proiritize the validation alert to show first. Then we can have the schema fit 
properly so if you get validation errors you have a certain format and dberrors 
you another format.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to