diff --git a/packages/app/src/DBSearchPageAlertModal.tsx b/packages/app/src/DBSearchPageAlertModal.tsx index 8df2ef45f..4faac045c 100644 --- a/packages/app/src/DBSearchPageAlertModal.tsx +++ b/packages/app/src/DBSearchPageAlertModal.tsx @@ -9,7 +9,8 @@ import { AlertIntervalSchema, AlertSource, AlertThresholdType, - SavedSearch, + SearchCondition, + SearchConditionLanguage, zAlertChannel, } from '@hyperdx/common-utils/dist/types'; import { TextInput } from '@mantine/core'; @@ -58,23 +59,29 @@ const CHANNEL_ICONS = { }; const AlertForm = ({ - savedSearch, + sourceId, + where, + whereLanguage, defaultValues, loading, deleteLoading, + hasSavedSearch, onDelete, onSubmit, onClose, }: { - savedSearch?: SavedSearch; + sourceId?: string | null; + where?: SearchCondition | null; + whereLanguage?: SearchConditionLanguage | null; defaultValues?: null | Alert; loading?: boolean; deleteLoading?: boolean; + hasSavedSearch?: boolean; onDelete: (id: string) => void; onSubmit: (data: Alert) => void; onClose: () => void; }) => { - const { data: source } = useSource({ id: savedSearch?.source }); + const { data: source } = useSource({ id: sourceId }); const databaseName = source?.from.databaseName; const tableName = source?.from.tableName; @@ -159,24 +166,24 @@ const AlertForm = ({ - {savedSearch && ( - - - }> - Threshold chart - - - - - - - )} + + + }> + Threshold chart + + + + + +
@@ -199,9 +206,9 @@ const AlertForm = ({ @@ -390,8 +397,11 @@ export const DBSearchPageAlertModal = ({ { - const { data: source } = useSource({ id: savedSearch?.source }); + const { data: source } = useSource({ id: sourceId }); - if (!savedSearch || !source) { + if (!sourceId || !source) { return null; } return (