-
Notifications
You must be signed in to change notification settings - Fork 0
feat(aci): redirect alerts nav to monitors #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Redirect Implements an on-click redirect from the Key Changes• Created Affected Areas• This summary was automatically generated by @propel-code-bot |
| <SecondaryNav.Item | ||
| to={`${baseUrl}/alerts/rules/`} | ||
| activeTo={`${baseUrl}/alerts/`} | ||
| to={alertsLink} | ||
| activeTo={alertsLink} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[BestPractice]
The activeTo prop is set to the same value as to, which may cause navigation issues. When redirecting to the workflow engine UI, users will be taken to a different base path (/organizations/${org}/monitors), but activeTo will still reference that path. This means the nav item will show as active even when users navigate to sub-routes under /issues/alerts/ (the original path). Consider using a more specific pattern:
Suggested Change
| <SecondaryNav.Item | |
| to={`${baseUrl}/alerts/rules/`} | |
| activeTo={`${baseUrl}/alerts/`} | |
| to={alertsLink} | |
| activeTo={alertsLink} | |
| <SecondaryNav.Item | |
| to={alertsLink} | |
| activeTo={shouldRedirectToWorkflowEngineUI ? alertsLink : `${baseUrl}/alerts/`} | |
| analyticsItemName="issues_alerts" | |
| > |
This ensures the active state matches the actual navigation behavior for both redirect and non-redirect scenarios.
⚡ Committable suggestion
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
Context for Agents
[**BestPractice**]
The `activeTo` prop is set to the same value as `to`, which may cause navigation issues. When redirecting to the workflow engine UI, users will be taken to a different base path (`/organizations/${org}/monitors`), but `activeTo` will still reference that path. This means the nav item will show as active even when users navigate to sub-routes under `/issues/alerts/` (the original path). Consider using a more specific pattern:
<details>
<summary>Suggested Change</summary>
```suggestion
<SecondaryNav.Item
to={alertsLink}
activeTo={shouldRedirectToWorkflowEngineUI ? alertsLink : `${baseUrl}/alerts/`}
analyticsItemName="issues_alerts"
>
```
This ensures the active state matches the actual navigation behavior for both redirect and non-redirect scenarios.
⚡ **Committable suggestion**
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
</details>
File: static/app/views/nav/secondary/sections/issues/issuesSecondaryNav.tsx
Line: 107
similar to getsentry#103129, redirects users with the
workflow-engine-uiflag who click on Issues > Alerts to the All Monitors list with a bannerCopied from getsentry#103325
Original PR: getsentry#103325