Skip to content

Commit

Permalink
[SLO] Prevent users from picking date fields for the group-by selector (
Browse files Browse the repository at this point in the history
elastic#177830)

## Summary

This PR prevents users from picking a date field for the group by
selector.
  • Loading branch information
simianhacker committed Feb 28, 2024
1 parent 1cd5cee commit 02e5011
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import { getGroupKeysProse } from '../../../../utils/slo/groupings';
export function GroupByField({ dataView, isLoading }: { dataView?: DataView; isLoading: boolean }) {
const { watch } = useFormContext<CreateSLOForm>();

const groupByFields = dataView?.fields?.filter((field) => field.aggregatable) ?? [];
const groupByFields =
dataView?.fields?.filter((field) => field.aggregatable && field.type !== 'date') ?? [];
const index = watch('indicator.params.index');
const timestampField = watch('indicator.params.timestampField');
const groupByField = watch('groupBy');
Expand Down

0 comments on commit 02e5011

Please sign in to comment.