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/07 20:25:22 UTC

[GitHub] [superset] lyndsiWilliams opened a new pull request, #19314: feat: Move Database Import option into DB Connection modal

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

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   This PR moves the import database from file option inside of the database connection modal.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   #### BEFORE:
   <img width="217" alt="importBefore" src="https://user-images.githubusercontent.com/55605634/160602837-e6196ecc-1ae5-44d2-a71b-5160a59a382b.png">
   <img width="749" alt="passwordBefore" src="https://user-images.githubusercontent.com/55605634/160602859-4f75a771-8b13-4bc6-8436-7a22a946b0b1.png">
   <img width="749" alt="overwriteBefore" src="https://user-images.githubusercontent.com/55605634/160602885-746751fb-a4de-40c5-9623-4f9fc59c2f10.png">
   
   #### AFTER:
   <img width="500" alt="importAfter" src="https://user-images.githubusercontent.com/55605634/160604167-3a1ad3b6-4c1b-4410-b441-63f1ecaa1902.png">
   <img width="501" alt="passwordAfter" src="https://user-images.githubusercontent.com/55605634/160603040-afebf327-aa68-4704-a0d1-4842304203df.png">
   <img width="501" alt="overwriteAfter" src="https://user-images.githubusercontent.com/55605634/160603057-dfea78e7-96fd-4b89-a877-da4abb4ce6e1.png">
   <img width="500" alt="pwowAfter" src="https://user-images.githubusercontent.com/55605634/160717065-7c466d90-b8cc-4985-b1a8-3ac82db4a924.png">
   
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   - Open the database connection modal and click "Import database from file" at the bottom
   - Import a database from file that requires a password to see the new password confirmation
   - Import a database from file that already exists to see the new overwrite confirmation
   - If you import a database that doesn't already exist and doesn't require a password, the modal should close and add the database with no further confirmation.
   
   ### 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:
   - [x] 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] lyndsiWilliams commented on pull request #19314: feat: Move Database Import option into DB Connection modal

Posted by GitBox <gi...@apache.org>.
lyndsiWilliams commented on PR #19314:
URL: https://github.com/apache/superset/pull/19314#issuecomment-1092124957

   /testenv up


-- 
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] github-actions[bot] commented on pull request #19314: feat: Move Database Import option into DB Connection modal

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

   @lyndsiWilliams Ephemeral environment spinning up at http://34.218.59.123:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.


-- 
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] lyndsiWilliams commented on a diff in pull request #19314: feat: Move Database Import option into DB Connection modal

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


##########
superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx:
##########
@@ -1252,6 +1442,23 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
                 />
                 {renderPreferredSelector()}
                 {renderAvailableSelector()}
+                <Upload
+                  name="databaseFile"
+                  id="databaseFile"
+                  data-test="database-file-input"
+                  accept=".yaml,.json,.yml,.zip"
+                  customRequest={() => {}}
+                  onChange={onDbImport}
+                  onRemove={removeFile}
+                >
+                  <Button
+                    data-test="import-database-btn"
+                    buttonStyle="link"
+                    css={buttonLinkStyles}

Review Comment:
   Can do! Adjusted in [`this commit`](https://github.com/apache/superset/pull/19314/commits/a50e3dd5c8203438eadb1ebc83929fb070b54228).



-- 
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] hughhhh commented on a diff in pull request #19314: feat: Move Database Import option into DB Connection modal

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


##########
superset-frontend/src/views/CRUD/hooks.ts:
##########
@@ -381,6 +381,7 @@ interface ImportResourceState {
   loading: boolean;
   passwordsNeeded: string[];
   alreadyExists: string[];
+  errored: boolean;

Review Comment:
   nit: name this `failed` 



-- 
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] github-actions[bot] commented on pull request #19314: feat: Move Database Import option into DB Connection modal

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

   Ephemeral environment shutdown and build artifacts deleted.


-- 
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] eschutho merged pull request #19314: feat: Move Database Import option into DB Connection modal

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


-- 
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] yousoph closed pull request #19314: feat: Move Database Import option into DB Connection modal

Posted by GitBox <gi...@apache.org>.
yousoph closed pull request #19314: feat: Move Database Import option into DB Connection modal
URL: https://github.com/apache/superset/pull/19314


-- 
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] lyndsiWilliams commented on pull request #19314: feat: Move Database Import option into DB Connection modal

Posted by GitBox <gi...@apache.org>.
lyndsiWilliams commented on PR #19314:
URL: https://github.com/apache/superset/pull/19314#issuecomment-1092192908

   /testenv up


-- 
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] github-actions[bot] commented on pull request #19314: feat: Move Database Import option into DB Connection modal

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

   @yousoph Container image not yet published for this PR. Please try again when build is complete.


-- 
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] github-actions[bot] commented on pull request #19314: feat: Move Database Import option into DB Connection modal

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

   @lyndsiWilliams Ephemeral environment spinning up at http://35.86.102.143:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.


-- 
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] lyndsiWilliams commented on a diff in pull request #19314: feat: Move Database Import option into DB Connection modal

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


##########
superset-frontend/src/views/CRUD/hooks.ts:
##########
@@ -381,6 +381,7 @@ interface ImportResourceState {
   loading: boolean;
   passwordsNeeded: string[];
   alreadyExists: string[];
+  errored: boolean;

Review Comment:
   Can do! Fixed in [`this commit`](https://github.com/apache/superset/pull/19314/commits/b61afd4abeaebd7a5da13359891d443dea323c94).



-- 
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] github-actions[bot] commented on pull request #19314: feat: Move Database Import option into DB Connection modal

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

   Ephemeral environment shutdown and build artifacts deleted.


-- 
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] github-actions[bot] commented on pull request #19314: feat: Move Database Import option into DB Connection modal

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

   @lyndsiWilliams Ephemeral environment spinning up at http://34.222.96.52:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.


-- 
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] lyndsiWilliams commented on pull request #19314: feat: Move Database Import option into DB Connection modal

Posted by GitBox <gi...@apache.org>.
lyndsiWilliams commented on PR #19314:
URL: https://github.com/apache/superset/pull/19314#issuecomment-1089392180

   /testenv up


-- 
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] eschutho commented on a diff in pull request #19314: feat: Move Database Import option into DB Connection modal

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


##########
superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx:
##########
@@ -595,9 +640,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
         dbToUpdate.configuration_method === CONFIGURATION_METHOD.DYNAMIC_FORM, // onShow toast on SQLA Forms
       );
       if (result) {
-        if (onDatabaseAdd) {
-          onDatabaseAdd();
-        }
+        if (onDatabaseAdd) onDatabaseAdd();

Review Comment:
   nit, but a little cleaner for next time:
   ```suggestion
           onDatabaseAdd && onDatabaseAdd();
   ```



-- 
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] eschutho commented on a diff in pull request #19314: feat: Move Database Import option into DB Connection modal

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


##########
superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx:
##########
@@ -772,10 +828,20 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
   };
 
   const handleBackButtonOnConnect = () => {
-    if (editNewDb) {
-      setHasConnectedDb(false);
-    }
+    if (editNewDb) setHasConnectedDb(false);
+    if (importingModal) setImportingModal(false);

Review Comment:
   another nit that we can prob address in a later cleanup. The name `importingModal` sounds like a current state where the modal is importing. 



-- 
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] github-actions[bot] commented on pull request #19314: feat: Move Database Import option into DB Connection modal

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

   @yousoph Ephemeral environment creation failed. Please check the Actions logs for details.


-- 
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] yousoph commented on pull request #19314: feat: Move Database Import option into DB Connection modal

Posted by GitBox <gi...@apache.org>.
yousoph commented on PR #19314:
URL: https://github.com/apache/superset/pull/19314#issuecomment-1092179778

   /testenv up


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