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/12 20:23:44 UTC

[GitHub] [superset] prosdev0107 opened a new pull request, #19673: fix(import): make to add the error alert

prosdev0107 opened a new pull request, #19673:
URL: https://github.com/apache/superset/pull/19673

   ### SUMMARY
   Add error message when user tries to import without having db driver installed
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   BEFORE:
   Not Error Alert Message
   
   AFTER:
   ![image](https://user-images.githubusercontent.com/47900232/163047092-f1cfe767-a4a4-4042-972f-224ff8a10b4f.png)
   
   
   ### TESTING INSTRUCTIONS
   **How to reproduce issues**
   Repro steps:
   
   1. Import a file (dashboard, chart, dataset, database) that contains a database where the user doesn't have the database driver installed
   
   Current behavior:  Import hangs
   Expected behavior: User sees an error message when they don't have the db driver installed
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or 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.

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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
prosdev0107 commented on code in PR #19673:
URL: https://github.com/apache/superset/pull/19673#discussion_r849630972


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

Review Comment:
   Good idea.



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


[GitHub] [superset] rusackas merged pull request #19673: fix(import): Add the error alert on failed database import

Posted by GitBox <gi...@apache.org>.
rusackas merged PR #19673:
URL: https://github.com/apache/superset/pull/19673


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


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

Posted by GitBox <gi...@apache.org>.
prosdev0107 commented on code in PR #19673:
URL: https://github.com/apache/superset/pull/19673#discussion_r849632607


##########
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:
   Got it.



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


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

Posted by GitBox <gi...@apache.org>.
prosdev0107 commented on code in PR #19673:
URL: https://github.com/apache/superset/pull/19673#discussion_r849624909


##########
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:
   @diegomedina248
   
   For double confirming, you mean that we should clear error message when attempting a new file upload?



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


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

Posted by GitBox <gi...@apache.org>.
prosdev0107 commented on code in PR #19673:
URL: https://github.com/apache/superset/pull/19673#discussion_r849624909


##########
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:
   For double confirming, you mean that we should clear error message when attempting a new file upload?



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


[GitHub] [superset] codecov[bot] commented on pull request #19673: fix(import): make to add the error alert

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #19673:
URL: https://github.com/apache/superset/pull/19673#issuecomment-1097214270

   # [Codecov](https://codecov.io/gh/apache/superset/pull/19673?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#19673](https://codecov.io/gh/apache/superset/pull/19673?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1d6857d) into [master](https://codecov.io/gh/apache/superset/commit/59dda1fa05488c921cacc8791d761cd9f9b86e9c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (59dda1f) will **decrease** coverage by `0.00%`.
   > The diff coverage is `44.44%`.
   
   > :exclamation: Current head 1d6857d differs from pull request most recent head df0d147. Consider uploading reports for the commit df0d147 to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #19673      +/-   ##
   ==========================================
   - Coverage   66.46%   66.46%   -0.01%     
   ==========================================
     Files        1681     1682       +1     
     Lines       64449    64457       +8     
     Branches     6607     6609       +2     
   ==========================================
   + Hits        42838    42842       +4     
   - Misses      19917    19919       +2     
   - Partials     1694     1696       +2     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `51.12% <44.44%> (-0.01%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/19673?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...rset-frontend/src/components/ImportModal/index.tsx](https://codecov.io/gh/apache/superset/pull/19673/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSW1wb3J0TW9kYWwvaW5kZXgudHN4) | `70.11% <37.50%> (-2.39%)` | :arrow_down: |
   | [...rset-frontend/src/components/ImportModal/styles.ts](https://codecov.io/gh/apache/superset/pull/19673/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSW1wb3J0TW9kYWwvc3R5bGVzLnRz) | `100.00% <100.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19673?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19673?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [59dda1f...df0d147](https://codecov.io/gh/apache/superset/pull/19673?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


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

Posted by GitBox <gi...@apache.org>.
prosdev0107 commented on code in PR #19673:
URL: https://github.com/apache/superset/pull/19673#discussion_r849624909


##########
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:
   @diegomedina248
   
   For double confirming, you mean that we should clear error message when attempting a new file upload?



##########
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:
   Okay agree.



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


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

Posted by GitBox <gi...@apache.org>.
diegomedina248 commented on code in PR #19673:
URL: https://github.com/apache/superset/pull/19673#discussion_r849626330


##########
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:
   yeah, as far as I can see, the modal now is not closed, so if we can make a new upload with the same modal, we should clear previous error there



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