This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new f0c0d74 chore: Reverts reset form in native filters (#15644)
f0c0d74 is described below
commit f0c0d7492c770b32cad6701081ce8edbd56a36f0
Author: Michael S. Molina <[email protected]>
AuthorDate: Tue Jul 13 08:38:32 2021 -0300
chore: Reverts reset form in native filters (#15644)
---
.../nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git
a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx
b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx
index bde38f2..fe248e0 100644
---
a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx
+++
b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx
@@ -164,6 +164,15 @@ export function FiltersConfigModal({
addFilter,
);
+ // After this, it should be as if the modal was just opened fresh.
+ // Called when the modal is closed.
+ const resetForm = () => {
+ setNewFilterIds([]);
+ setCurrentFilterId(initialCurrentFilterId);
+ setRemovedFilters({});
+ setSaveAlertVisible(false);
+ };
+
const getFilterTitle = (id: string) =>
formValues.filters[id]?.name ??
filterConfigMap[id]?.name ??
@@ -208,6 +217,7 @@ export function FiltersConfigModal({
};
const handleConfirmCancel = () => {
+ resetForm();
onCancel();
};