DefaultAlertingDialog()
Beta API. Mostly stable, but details may change in a minor release, outside SemVer. See API maturity.
Default implementation of the alerting create/edit dialog.
export declare function DefaultAlertingDialog(props: IDefaultAlertingDialogProps): ReactElement;
Parameters
Parameter | Type | Description |
|---|---|---|
props |
Returns
ReactElement
Remarks
This component is a pure consumer of AutomationsContext, AlertingDialogContext, and the alerting dialog state contexts: it reads org/workspace data, per-dialog state, and the alert draft’s state from those contexts rather than from the dashboard store. It must therefore be rendered within an AutomationsContextProvider, an AlertingDialogContextProvider (for the create/edit flow), and an AlertingDialogStateProvider. Inside a Dashboard, the alerting connector supplies the first two providers above the AlertingDialogComponent slot, and mounts AlertingDialogStateProvider around the resolved slot component — its state model establishes itself once useAlertingDialogContext().isLoading is false for the first time and stays mounted from then on — so the default component, and any wholesale slot replacement, inherit all three contexts automatically and require no extra wiring.
The providers are intentionally hoisted above the slot rather than built inside this component: that is what lets a wholesale replacement receive the same contexts. Rendering this component outside those providers throws at runtime.
The dialog is AlertingDialogShell() — the chrome: overlay, frame, header row, action bar, the dialog’s messages, the stale-filters and delete confirmation steps, the loading skeleton — around the exported region renders (DefaultAlertingDialogFilters(), DefaultAlertingDialogDestination(), DefaultAlertingDialogRecipients(), fed by useAlertingDialogFiltersProps() and siblings; the header and action bar are the shell’s) and the connected field blocks — AlertingDialogMeasure(), AlertingDialogAttribute(), AlertingDialogComparisonOperator(), AlertingDialogThreshold(), AlertingDialogComparisonPeriod(), AlertingDialogSensitivity(), AlertingDialogGranularity(), AlertingDialogTriggerMode(), AlertingDialogTriggerInterval() — grouped under the “When” and “Do” headings by AlertingDialogFormFieldGroup(); each field is a labelled AutomationDialogFormField() row and the conditional ones gate themselves on the draft. A custom AlertingDialogComponent that keeps this chrome but owns the arrangement renders AlertingDialogShell() around the blocks it wants (see its example); one that owns the chrome too places the blocks in its own markup and reads or writes the same draft through useAlertDraft() and useAlertActions().
Slots render only in the fully rendered dialog: not while the dialog context reports loading, and not while the stale-filters confirmation step is shown.