- {/* make the area above components droppable */}
- {editMode && (
-
- {renderDraggableContentBottom}
-
- )}
-
- {gridComponent?.children?.map((id, index) => (
-
- ))}
-
- {/* make the area below components droppable */}
- {editMode && gridComponent?.children?.length > 0 && (
-
- {renderDraggableContentTop}
-
- )}
-
- {isResizing &&
- Array(GRID_COLUMN_COUNT)
- .fill(null)
- .map((_, i) => (
-
- ))}
-
- {isResizing && rowGuideTop && (
-
+ {editMode && gridComponent?.children?.length === 0 && (
+
+
+
+ {t('Create a new chart')}
+ >
+ }
+ buttonAction={() => {
+ window.location.assign('/chart/add');
}}
+ image="chart.svg"
/>
- )}
+
+ )}
+
+
+ {/* make the area above components droppable */}
+ {editMode && (
+
+ {renderDraggableContentBottom}
+
+ )}
+ {gridComponent?.children?.map((id, index) => (
+
+ ))}
+ {/* make the area below components droppable */}
+ {editMode && gridComponent?.children?.length > 0 && (
+
+ {renderDraggableContentTop}
+
+ )}
+ {isResizing &&
+ Array(GRID_COLUMN_COUNT)
+ .fill(null)
+ .map((_, i) => (
+
+ ))}
+ {isResizing && rowGuideTop && (
+
+ )}
+
-
+ >
);
}
}
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
index 6b07c2c7234ab..b8d5a4b6dc43c 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
@@ -44,6 +44,7 @@ import Loading from 'src/components/Loading';
import { getInitialDataMask } from 'src/dataMask/reducer';
import { URL_PARAMS } from 'src/constants';
import { getUrlParam } from 'src/utils/urlUtils';
+import { EmptyStateSmall } from 'src/components/EmptyState';
import { checkIsApplyDisabled, TabIds } from './utils';
import FilterSets from './FilterSets';
import {
@@ -57,6 +58,7 @@ import { createFilterKey, updateFilterKey } from './keyValue';
import EditSection from './FilterSets/EditSection';
import Header from './Header';
import FilterControls from './FilterControls/FilterControls';
+import { RootState } from '../../../types';
export const FILTER_BAR_TEST_ID = 'filter-bar';
export const getFilterBarTestId = testWithId(FILTER_BAR_TEST_ID);
@@ -135,6 +137,10 @@ const StyledTabs = styled(Tabs)`
}
`;
+const FilterBarEmptyStateContainer = styled.div`
+ margin-top: ${({ theme }) => theme.gridUnit * 8}px;
+`;
+
export interface FiltersBarProps {
filtersOpen: boolean;
toggleFiltersBar: any;
@@ -168,6 +174,9 @@ const FilterBar: React.FC
= ({
const dashboardId = useSelector(
({ dashboardInfo }) => dashboardInfo?.id,
);
+ const canEdit = useSelector(
+ ({ dashboardInfo }) => dashboardInfo.dash_edit_perm,
+ );
const handleFilterSelectionChange = useCallback(
(
@@ -382,11 +391,26 @@ const FilterBar: React.FC = ({
) : (
-
+ {filterValues.length === 0 ? (
+
+
+
+ ) : (
+
+ )}
)}