Skip to content

Commit d69b18a

Browse files
authored
fix(alert): 'View Alert Rules' now preserves the project from settings. (#20842)
Previously when clicking View Alert Rules on the settings page, the user would be redirected to the alert rule page with the project shown being preserved from global selection. This can cause users to click on View Alert Rules from settings and then view the alert rules from a completely separate project. This code adds the project query parameter into the url to override global selection.
1 parent 276db2c commit d69b18a

File tree

1 file changed

+9
-1
lines changed
  • src/sentry/static/sentry/app/views/settings/projectAlerts

1 file changed

+9
-1
lines changed

src/sentry/static/sentry/app/views/settings/projectAlerts/settings.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,20 @@ class ProjectAlertSettings extends AsyncView {
7777
params: {orgId, projectId},
7878
} = this.props;
7979

80+
const {project} = this.state;
81+
8082
return (
8183
<React.Fragment>
8284
<SettingsPageHeader
8385
title={t('Alerts Settings')}
8486
action={
85-
<Button to={`/organizations/${orgId}/alerts/rules/`} size="small">
87+
<Button
88+
to={{
89+
pathname: `/organizations/${orgId}/alerts/rules/`,
90+
query: {project: project.id},
91+
}}
92+
size="small"
93+
>
8694
{t('View Alert Rules')}
8795
</Button>
8896
}

0 commit comments

Comments
 (0)