eschutho commented on a change in pull request #12845:
URL: https://github.com/apache/superset/pull/12845#discussion_r572465196
##########
File path: superset-frontend/src/views/CRUD/data/database/DatabaseModal.tsx
##########
@@ -235,6 +249,36 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps>
= ({
}
};
+ const expandForm = (trueOrFalse: boolean) => {
+ // Count starts a 0 (closed)
+ // Any checkbox in this for that gets checked
+ // will increase the count and keep the form open
+ if (trueOrFalse) {
+ setCount(count + 1);
+ } else {
+ setCount(count - 1);
+ }
+ };
+
+ useEffect(() => {
+ // Opens the form if at least one option is checked
+ // Closes the form only if both options are unchecked
+ if (count > 0) {
+ setCreateAsOpen(true);
+ } else {
+ setCreateAsOpen(false);
+ }
Review comment:
also more succinct:
`setCreateAsOpen(count>0)`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]