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: [email protected]

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