mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-17 15:36:48 +00:00
chore: fix edit alerts page crashing (#9025)
This commit is contained in:
parent
e8035b7dd2
commit
ff8ac96d37
@ -163,12 +163,11 @@ export const GroupByFilter = memo(function GroupByFilter({
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const currentValues: SelectOption<string, string>[] = query.groupBy.map(
|
||||
(item) => ({
|
||||
const currentValues: SelectOption<string, string>[] =
|
||||
query.groupBy?.map((item) => ({
|
||||
label: `${item.key}`,
|
||||
value: `${item.id}`,
|
||||
}),
|
||||
);
|
||||
})) || [];
|
||||
|
||||
setLocalValues(currentValues);
|
||||
}, [query]);
|
||||
@ -191,7 +190,7 @@ export const GroupByFilter = memo(function GroupByFilter({
|
||||
notFoundContent={isFetching ? <Spin size="small" /> : null}
|
||||
onChange={handleChange}
|
||||
data-testid="group-by"
|
||||
placeholder={localValues.length === 0 ? 'Everything (no breakdown)' : ''}
|
||||
placeholder={localValues?.length === 0 ? 'Everything (no breakdown)' : ''}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
@ -34,16 +34,18 @@ export const convertBuilderQueryToIBuilderQuery = (
|
||||
queryName: builderQuery.name,
|
||||
dataSource,
|
||||
legend: builderQuery.legend,
|
||||
groupBy: builderQuery.groupBy?.map((group) => ({
|
||||
groupBy:
|
||||
builderQuery.groupBy?.map((group) => ({
|
||||
key: group?.name,
|
||||
dataType: group?.fieldDataType,
|
||||
type: group?.fieldContext,
|
||||
id: `${group?.name}--${group?.fieldDataType}--${group?.fieldContext}`,
|
||||
})),
|
||||
orderBy: builderQuery.order?.map((order) => ({
|
||||
})) || [],
|
||||
orderBy:
|
||||
builderQuery.order?.map((order) => ({
|
||||
columnName: order?.key?.name,
|
||||
order: order?.direction,
|
||||
})),
|
||||
})) || [],
|
||||
} as unknown) as IBuilderQuery;
|
||||
|
||||
return result;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user