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 2022/04/13 15:26:23 UTC

[GitHub] [superset] diegomedina248 commented on a diff in pull request #19673: fix(import): make to add the error alert

diegomedina248 commented on code in PR #19673:
URL: https://github.com/apache/superset/pull/19673#discussion_r849616464


##########
superset-frontend/src/components/ImportModal/index.tsx:
##########
@@ -130,6 +141,7 @@ const ImportModelsModal: FunctionComponent<ImportModelsModalProps> = ({
   const [confirmedOverwrite, setConfirmedOverwrite] = useState<boolean>(false);
   const [fileList, setFileList] = useState<UploadFile[]>([]);
   const [importingModel, setImportingModel] = useState<boolean>(false);
+  const [errMsg, setErrMsg] = useState<string>();

Review Comment:
   looking at the rest of the variable naming here, I would call it `errorMessage` instead



##########
superset-frontend/src/components/ImportModal/index.tsx:
##########
@@ -142,7 +154,7 @@ const ImportModelsModal: FunctionComponent<ImportModelsModalProps> = ({
 
   const handleErrorMsg = (msg: string) => {
     clearModal();
-    addDangerToast(msg);
+    setErrMsg(msg);

Review Comment:
   we should clear it when attempting a new upload right?



##########
superset-frontend/src/components/ImportModal/index.tsx:
##########
@@ -261,6 +273,34 @@ const ImportModelsModal: FunctionComponent<ImportModelsModalProps> = ({
     );
   };
 
+  const renderErrMsg = () => (

Review Comment:
   We can extract this to a component, will help keep the components with less clutter



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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