diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx index 803d07e193d86..30c28e6fcad06 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx @@ -16,7 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useCallback, useMemo, useState, useRef } from 'react'; +import React, { + useEffect, + useCallback, + useMemo, + useState, + useRef, +} from 'react'; import { uniq, isEqual, sortBy, debounce } from 'lodash'; import { t, styled, SLOW_DEBOUNCE } from '@superset-ui/core'; import { Form } from 'src/common/components'; @@ -391,6 +397,12 @@ export function FiltersConfigModal({ [handleFilterHierarchyChange, handleErroredFilters], ); + useEffect(() => { + setErroredFilters(prevErroredFilters => + prevErroredFilters.filter(f => !removedFilters[f]), + ); + }, [removedFilters]); + return ( setSaveAlertVisible(false)} onCancel={handleCancel} handleSave={handleSave} + canSave={!erroredFilters.length} saveAlertVisible={saveAlertVisible} onConfirmCancel={handleConfirmCancel} /> diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/Footer.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/Footer.tsx index a55a87c25ea49..4c2f774a62758 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/Footer.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/Footer/Footer.tsx @@ -27,9 +27,11 @@ type FooterProps = { onConfirmCancel: OnClickHandler; onDismiss: OnClickHandler; saveAlertVisible: boolean; + canSave?: boolean; }; const Footer: FC = ({ + canSave = true, onCancel, handleSave, onDismiss, @@ -60,6 +62,7 @@ const Footer: FC = ({ {t('Cancel')}