({
{filterable && (
({
)}
{!loading && rows.length === 0 && (
- }
- description={emptyState.message || t('No Data')}
- >
- {emptyState.slot || null}
-
+ {query.filters ? (
+ handleClearFilterControls()}
+ buttonText={t('clear all filters')}
+ />
+ ) : (
+
+ )}
)}
diff --git a/superset-frontend/src/components/ListView/utils.ts b/superset-frontend/src/components/ListView/utils.ts
index 0cbd6db2bcdc9..7a7f97d142a85 100644
--- a/superset-frontend/src/components/ListView/utils.ts
+++ b/superset-frontend/src/components/ListView/utils.ts
@@ -378,6 +378,7 @@ export function useListViewState({
toggleAllRowsSelected,
applyFilterValue,
setViewMode,
+ query,
};
}
diff --git a/superset-frontend/src/views/CRUD/alert/AlertList.tsx b/superset-frontend/src/views/CRUD/alert/AlertList.tsx
index 803566cf356b7..a27e441ae9e79 100644
--- a/superset-frontend/src/views/CRUD/alert/AlertList.tsx
+++ b/superset-frontend/src/views/CRUD/alert/AlertList.tsx
@@ -22,7 +22,6 @@ import { useHistory } from 'react-router-dom';
import { makeApi, styled, SupersetClient, t } from '@superset-ui/core';
import moment from 'moment';
import ActionsBar, { ActionProps } from 'src/components/ListView/ActionsBar';
-import Button from 'src/components/Button';
import FacePile from 'src/components/FacePile';
import { Tooltip } from 'src/components/Tooltip';
import ListView, {
@@ -367,15 +366,15 @@ function AlertList({
});
}
- const EmptyStateButton = (
-
- );
-
const emptyState = {
- message: t('No %s yet', titlePlural),
- slot: canCreate ? EmptyStateButton : null,
+ title: t('No %s yet', titlePlural),
+ image: 'filter-results.svg',
+ buttonAction: () => handleAlertEdit(null),
+ buttonText: canCreate ? (
+ <>
+ {title}{' '}
+ >
+ ) : null,
};
const filters: Filters = useMemo(
diff --git a/superset-frontend/src/views/CRUD/annotation/AnnotationList.tsx b/superset-frontend/src/views/CRUD/annotation/AnnotationList.tsx
index aa018418802b1..44f99039cf646 100644
--- a/superset-frontend/src/views/CRUD/annotation/AnnotationList.tsx
+++ b/superset-frontend/src/views/CRUD/annotation/AnnotationList.tsx
@@ -24,7 +24,6 @@ import moment from 'moment';
import rison from 'rison';
import ActionsBar, { ActionProps } from 'src/components/ListView/ActionsBar';
-import Button from 'src/components/Button';
import ConfirmStatusChange from 'src/components/ConfirmStatusChange';
import DeleteModal from 'src/components/DeleteModal';
import ListView, { ListViewProps } from 'src/components/ListView';
@@ -241,22 +240,17 @@ function AnnotationList({
hasHistory = false;
}
- const EmptyStateButton = (
-
- );
-
- const emptyState = {
- message: t('No annotation yet'),
- slot: EmptyStateButton,
+ ),
};
return (
diff --git a/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayersList.tsx b/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayersList.tsx
index 26b3072fd7f0c..9443eb2f7452c 100644
--- a/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayersList.tsx
+++ b/superset-frontend/src/views/CRUD/annotationlayers/AnnotationLayersList.tsx
@@ -32,7 +32,6 @@ import ListView, {
Filters,
ListViewProps,
} from 'src/components/ListView';
-import Button from 'src/components/Button';
import DeleteModal from 'src/components/DeleteModal';
import ConfirmStatusChange from 'src/components/ConfirmStatusChange';
import AnnotationLayerModal from './AnnotationLayerModal';
@@ -323,22 +322,15 @@ function AnnotationLayersList({
[],
);
- const EmptyStateButton = (
-
- );
-
- const emptyState = {
- message: t('No annotation layers yet'),
- slot: EmptyStateButton,
+ ),
};
const onLayerAdd = (id?: number) => {