diff --git a/static/app/views/alerts/rules/metric/ruleConditionsForm.tsx b/static/app/views/alerts/rules/metric/ruleConditionsForm.tsx index 08455e1fdf2d20..1f2dec42561afb 100644 --- a/static/app/views/alerts/rules/metric/ruleConditionsForm.tsx +++ b/static/app/views/alerts/rules/metric/ruleConditionsForm.tsx @@ -490,7 +490,15 @@ class RuleConditionsForm extends PureComponent { } renderInterval() { - const {organization, disabled, alertType, project, isForLlmMetric} = this.props; + const { + organization, + timeWindow, + disabled, + alertType, + project, + isForLlmMetric, + onTimeWindowChange, + } = this.props; return ( @@ -518,6 +526,16 @@ class RuleConditionsForm extends PureComponent { required /> )} + onTimeWindowChange(value)} + inline={false} + flexibleControlStateSize + /> ); diff --git a/static/app/views/alerts/rules/metric/ruleForm.spec.tsx b/static/app/views/alerts/rules/metric/ruleForm.spec.tsx index b1a50d37daefc9..4c777a1ec78e5a 100644 --- a/static/app/views/alerts/rules/metric/ruleForm.spec.tsx +++ b/static/app/views/alerts/rules/metric/ruleForm.spec.tsx @@ -142,6 +142,12 @@ describe('Incident Rules Form', () => { expect(screen.queryByText(permissionAlertText)).not.toBeInTheDocument(); }); + it('renders time window', async () => { + createWrapper({rule}); + + expect(await screen.findByText('1 hour interval')).toBeInTheDocument(); + }); + it('is enabled with project-level alerts:write', async () => { organization.access = []; project.access = ['alerts:write'];