fix(ui) - dashboard card select all restrict to 30

This commit is contained in:
Shekar Siri 2023-03-29 17:50:27 +02:00
parent d290cd8276
commit 1da8e12a30
2 changed files with 2 additions and 2 deletions

View file

@ -19,7 +19,7 @@ interface IProps {
}
type Props = IProps & RouteComponentProps;
const MAX_CARDS = 30
const MAX_CARDS = 29;
function DashboardHeader(props: Props) {
const { siteId, dashboardId } = props;
const { dashboardStore } = useStore();

View file

@ -73,7 +73,7 @@ function MetricsList({
toggleSelection={toggleMetricSelection}
allSelected={cards.length === selectedMetrics.length}
toggleAll={({ target: { checked, name } }) =>
setSelectedMetrics(checked ? cards.map((i: any) => i.metricId) : [])
setSelectedMetrics(checked ? cards.map((i: any) => i.metricId).slice(0, 30 - existingCardIds!.length) : [])
}
/>
) : (