You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/06/18 21:13:04 UTC

[GitHub] [superset] eschutho commented on a change in pull request #15242: feat: Added error alert for DB connection Modal

eschutho commented on a change in pull request #15242:
URL: https://github.com/apache/superset/pull/15242#discussion_r654045438



##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
##########
@@ -596,10 +598,32 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
     }
   }, [availableDbs]);
 
+  useEffect(() => {
+    if (validationErrors) {
+      setHasErrors(true);
+    } else {
+      setHasErrors(false);
+    }
+  }, [validationErrors]);
+  // Used as componentDidMount
+
   const tabChange = (key: string) => {
     setTabKey(key);
   };
 
+  const errorAlert = () => {
+    const errors = validationErrors;
+    return (
+      <Alert
+        type="error"
+        css={(theme: SupersetTheme) => antDErrorAlertStyles(theme)}
+        message="Missing Required Fields"

Review comment:
       Not sure if you plan to put this into the v2, but I think that we're going to have to create a map between the server side error and the language that we want to show in these alerts. These are more descriptive and instructional and I don't think they will be or should be the same as what we are returning from the API. 




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org