({
{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 346bde0982fc3..78873f51f14a0 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 2d84cb0b976df..f0f9d7423b24b 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 { t, SupersetClient, makeApi, styled } 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, {
@@ -366,15 +365,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 c91099a6d59cd..a4599b9ff5dfb 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';
@@ -239,22 +238,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 b93e31d38017b..0265682dc7e6c 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,
FilterOperator,
} 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';
@@ -311,22 +310,15 @@ function AnnotationLayersList({
[],
);
- const EmptyStateButton = (
-
- );
-
- const emptyState = {
- message: t('No annotation layers yet'),
- slot: EmptyStateButton,
+ ),
};
const onLayerAdd = (id?: number) => {