You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2021/06/17 23:23:54 UTC
[superset] branch hugh/fix-validation-presist created (now c7a0339)
This is an automated email from the ASF dual-hosted git repository.
hugh pushed a change to branch hugh/fix-validation-presist
in repository https://gitbox.apache.org/repos/asf/superset.git.
at c7a0339 reset validation errors onClose
This branch includes the following new commits:
new c7a0339 reset validation errors onClose
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[superset] 01/01: reset validation errors onClose
Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hugh pushed a commit to branch hugh/fix-validation-presist
in repository https://gitbox.apache.org/repos/asf/superset.git
commit c7a0339df9e16df92135fa8cdff26524e506d342
Author: hughhhh <hu...@gmail.com>
AuthorDate: Thu Jun 17 19:22:48 2021 -0400
reset validation errors onClose
---
.../CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx | 1 -
.../src/views/CRUD/data/database/DatabaseModal/index.tsx | 7 ++++++-
superset-frontend/src/views/CRUD/hooks.ts | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
index db2d4ae..e37fcd7 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/DatabaseConnectionForm.tsx
@@ -264,7 +264,6 @@ const passwordField = ({
/>
);
const displayField = ({
- required,
changeMethods,
getValidation,
validationErrors,
diff --git a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
index 2c9c49d..44a0cf8 100644
--- a/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
+++ b/superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
@@ -284,7 +284,11 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
>(dbReducer, null);
const [tabKey, setTabKey] = useState<string>(DEFAULT_TAB_KEY);
const [availableDbs, getAvailableDbs] = useAvailableDatabases();
- const [validationErrors, getValidation] = useDatabaseValidation();
+ const [
+ validationErrors,
+ getValidation,
+ setValidationErrors,
+ ] = useDatabaseValidation();
const [hasConnectedDb, setHasConnectedDb] = useState<boolean>(false);
const [dbName, setDbName] = useState('');
const [isLoading, setLoading] = useState<boolean>(false);
@@ -340,6 +344,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
const onClose = () => {
setDB({ type: ActionType.reset });
setHasConnectedDb(false);
+ setValidationErrors(null); // reset validation errors on close
onHide();
};
diff --git a/superset-frontend/src/views/CRUD/hooks.ts b/superset-frontend/src/views/CRUD/hooks.ts
index d229315..3132422 100644
--- a/superset-frontend/src/views/CRUD/hooks.ts
+++ b/superset-frontend/src/views/CRUD/hooks.ts
@@ -687,5 +687,5 @@ export function useDatabaseValidation() {
[setValidationErrors],
);
- return [validationErrors, getValidation] as const;
+ return [validationErrors, getValidation, setValidationErrors] as const;
}