diff --git a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.stories.tsx b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.stories.tsx index e69199ac7281d..1c28235a6575d 100644 --- a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.stories.tsx +++ b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.stories.tsx @@ -32,8 +32,28 @@ export default { ], }; -export const Example: Story = () => { - const [params, setParams] = useState({ +export const CreatingInApmServiceOverview: Story = ({ + ruleParams, + metadata, +}) => { + const [params, setParams] = useState(ruleParams); + + function setRuleParams(property: string, value: any) { + setParams({ ...params, [property]: value }); + } + + return ( + {}} + /> + ); +}; + +CreatingInApmServiceOverview.args = { + ruleParams: { aggregationType: AggregationType.Avg, environment: 'testEnvironment', serviceName: 'testServiceName', @@ -42,7 +62,15 @@ export const Example: Story = () => { transactionName: 'GET /api/customer/:id', windowSize: 5, windowUnit: 'm', - }); + }, + metadata: undefined, +}; + +export const CreatingInStackManagement: Story = ({ + ruleParams, + metadata, +}) => { + const [params, setParams] = useState(ruleParams); function setRuleParams(property: string, value: any) { setParams({ ...params, [property]: value }); @@ -51,8 +79,14 @@ export const Example: Story = () => { return ( {}} /> ); }; + +CreatingInStackManagement.args = { + ruleParams: {}, + metadata: undefined, +}; diff --git a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx index d5a62bdd8d956..febe1e3fdc6d2 100644 --- a/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx +++ b/x-pack/plugins/apm/public/components/alerting/rule_types/transaction_duration_rule_type/index.tsx @@ -39,10 +39,10 @@ import { PopoverExpression } from '../../ui_components/popover_expression'; export interface RuleParams { aggregationType: AggregationType; environment: string; - serviceName: string; threshold: number; - transactionType: string; - transactionName: string; + transactionType?: string; + transactionName?: string; + serviceName?: string; windowSize: number; windowUnit: string; } diff --git a/x-pack/plugins/apm/public/components/alerting/utils/fields.tsx b/x-pack/plugins/apm/public/components/alerting/utils/fields.tsx index e2c1be9e2a362..78437f2ea027b 100644 --- a/x-pack/plugins/apm/public/components/alerting/utils/fields.tsx +++ b/x-pack/plugins/apm/public/components/alerting/utils/fields.tsx @@ -40,7 +40,7 @@ export function ServiceField({ > void; serviceName?: string; }) { @@ -115,7 +115,7 @@ export function TransactionNameField({ return (