feat(Monitor): add monitorId prop to MonitorStep and MonitorSteps components for secret population during testing

This commit is contained in:
Nawaz Dhandala
2026-01-21 14:58:09 +00:00
parent 4f7d3ed2be
commit 4115deadc4
3 changed files with 6 additions and 0 deletions

View File

@@ -60,6 +60,7 @@ import MonitorStepTraceMonitor, {
import CheckboxElement from "Common/UI/Components/Checkbox/Checkbox";
import MonitorTestForm from "./MonitorTest";
import MonitorSteps from "Common/Types/Monitor/MonitorSteps";
import ObjectID from "Common/Types/ObjectID";
import Probe from "Common/Models/DatabaseModels/Probe";
import MetricMonitorStepForm from "./MetricMonitor/MetricMonitorStepForm";
import MonitorStepMetricMonitor, {
@@ -82,6 +83,7 @@ export interface ComponentProps {
monitorType: MonitorType;
allMonitorSteps: MonitorSteps;
probes: Array<Probe>;
monitorId?: ObjectID | undefined; // this is used to populate secrets when testing the monitor.
}
const MonitorStepElement: FunctionComponent<ComponentProps> = (
@@ -824,6 +826,7 @@ return {
{/** Monitor Test Form */}
<div className="mt-5 mb-2">
<MonitorTestForm
monitorId={props.monitorId}
monitorSteps={props.allMonitorSteps}
monitorType={props.monitorType}
probes={props.probes}

View File

@@ -32,6 +32,7 @@ export interface ComponentProps extends CustomElementProps {
initialValue?: MonitorSteps;
monitorType: MonitorType;
monitorName?: string | undefined; // this is used to prefill incident title and description. If not provided then it will be empty.
monitorId?: ObjectID | undefined; // this is used to populate secrets when testing the monitor.
}
const MonitorStepsElement: FunctionComponent<ComponentProps> = (
@@ -236,6 +237,7 @@ const MonitorStepsElement: FunctionComponent<ComponentProps> = (
onCallPolicyDropdownOptions={onCallPolicyDropdownOptions}
value={i}
probes={probes}
monitorId={props.monitorId}
/*
* onDelete={() => {
* // remove the criteria filter

View File

@@ -163,6 +163,7 @@ const MonitorCriteria: FunctionComponent<
<MonitorStepsForm
{...props}
monitorType={monitorType || MonitorType.Manual}
monitorId={modelId}
/>
);
},