Skip to content

Commit

Permalink
fix(alert): 'View Alert Rules' now preserves the project from setting…
Browse files Browse the repository at this point in the history
…s. (#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.
  • Loading branch information
davidenwang authored Sep 17, 2020
1 parent 276db2c commit d69b18a
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,20 @@ class ProjectAlertSettings extends AsyncView {
params: {orgId, projectId},
} = this.props;

const {project} = this.state;

return (
<React.Fragment>
<SettingsPageHeader
title={t('Alerts Settings')}
action={
<Button to={`/organizations/${orgId}/alerts/rules/`} size="small">
<Button
to={{
pathname: `/organizations/${orgId}/alerts/rules/`,
query: {project: project.id},
}}
size="small"
>
{t('View Alert Rules')}
</Button>
}
Expand Down

0 comments on commit d69b18a

Please sign in to comment.