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/06/03 16:29:50 UTC
[GitHub] [superset] diegomedina248 commented on a diff in pull request #19967: fix: A newly connected database doesn't appear in the databases list if user connected database using the 'plus' button
diegomedina248 commented on code in PR #19967:
URL: https://github.com/apache/superset/pull/19967#discussion_r889132238
##########
superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx:
##########
@@ -503,7 +503,6 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
setImportingModal(false);
setPasswords({});
setConfirmedOverwrite(false);
- if (onDatabaseAdd) onDatabaseAdd();
Review Comment:
Yeah, sure.
Calling `onDatabaseAdd` in the `onClose` causes the callback to be fired when it shouldn't.
The `onClose` is called, for instance, if you hit in the overlay.
That causes (in master) the following:
https://user-images.githubusercontent.com/17252075/171906617-319a39e7-647c-418d-bae6-8027a6e805fe.mov
The only places that should be called is when a change was actually made (which was done already in almost all places, causing a double fetch/rerender).
The only place that uses this function is `DatabaseList`, which only does a refresh.
--
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