Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 35 additions & 29 deletions static/app/router/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ import {translateSentryRoute} from 'sentry/utils/reactRouter6Compat/router';
import withDomainRedirect from 'sentry/utils/withDomainRedirect';
import withDomainRequired from 'sentry/utils/withDomainRequired';
import {
WorkflowEngineRedirectToAutomationDetails,
WorkflowEngineRedirectToAutomationEdit,
withAutomationDetailsRedirect,
withAutomationEditRedirect,
withDetectorCreateRedirect,
withDetectorDetailsRedirect,
withDetectorEditRedirect,
} from 'sentry/views/alerts/workflowEngineRedirects';
import App from 'sentry/views/app';
import {AppBodyContent} from 'sentry/views/app/appBodyContent';
Expand Down Expand Up @@ -1475,7 +1478,9 @@ function buildRoutes(): RouteObject[] {
},
{
path: 'details/:ruleId/',
component: make(() => import('sentry/views/alerts/rules/metric/details')),
component: withDetectorDetailsRedirect(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this isn't completely lazy, you need to make a new file with a default export that is export default withDetectorDetailsRedirect(MetricDetails)

make(() => import('sentry/views/alerts/rules/metric/details'))
),
deprecatedRouteProps: true,
},
{
Expand All @@ -1491,31 +1496,19 @@ function buildRoutes(): RouteObject[] {
},
{
path: ':ruleId/',
component: WorkflowEngineRedirectToAutomationEdit,
component: withAutomationEditRedirect(
make(() => import('sentry/views/alerts/edit'))
),
deprecatedRouteProps: true,
children: [
{
index: true,
component: make(() => import('sentry/views/alerts/edit')),
deprecatedRouteProps: true,
},
],
},
],
},
{
path: ':projectId/:ruleId/details/',
component: WorkflowEngineRedirectToAutomationDetails,
component: withAutomationDetailsRedirect(
make(() => import('sentry/views/alerts/rules/issue/details/ruleDetails'))
),
deprecatedRouteProps: true,
children: [
{
index: true,
component: make(
() => import('sentry/views/alerts/rules/issue/details/ruleDetails')
),
deprecatedRouteProps: true,
},
],
},
{
path: 'uptime/',
Expand All @@ -1524,12 +1517,15 @@ function buildRoutes(): RouteObject[] {
children: [
{
path: ':projectId/:detectorId/details/',
component: make(() => import('sentry/views/alerts/rules/uptime/details')),
component: withDetectorDetailsRedirect(
make(() => import('sentry/views/alerts/rules/uptime/details'))
),
deprecatedRouteProps: true,
},
{
path: 'existing-or-create/',
component: make(
() => import('sentry/views/alerts/rules/uptime/existingOrCreate')
component: withDetectorCreateRedirect(
make(() => import('sentry/views/alerts/rules/uptime/existingOrCreate'))
),
},
],
Expand Down Expand Up @@ -1570,7 +1566,9 @@ function buildRoutes(): RouteObject[] {
},
{
path: ':ruleId/',
component: make(() => import('sentry/views/alerts/edit')),
component: withDetectorEditRedirect(
make(() => import('sentry/views/alerts/edit'))
),
deprecatedRouteProps: true,
},
],
Expand All @@ -1587,7 +1585,9 @@ function buildRoutes(): RouteObject[] {
children: [
{
path: ':ruleId/',
component: make(() => import('sentry/views/alerts/edit')),
component: withDetectorEditRedirect(
make(() => import('sentry/views/alerts/edit'))
),
deprecatedRouteProps: true,
},
],
Expand All @@ -1613,7 +1613,9 @@ function buildRoutes(): RouteObject[] {
},
{
path: 'wizard/',
component: make(() => import('sentry/views/alerts/builder/projectProvider')),
component: withDetectorCreateRedirect(
make(() => import('sentry/views/alerts/builder/projectProvider'))
),
children: [
{
index: true,
Expand All @@ -1636,7 +1638,9 @@ function buildRoutes(): RouteObject[] {
},
{
path: ':alertType/',
component: make(() => import('sentry/views/alerts/create')),
component: withDetectorCreateRedirect(
make(() => import('sentry/views/alerts/create'))
),
deprecatedRouteProps: true,
},
],
Expand All @@ -1647,7 +1651,9 @@ function buildRoutes(): RouteObject[] {
},
{
path: ':projectId/',
component: make(() => import('sentry/views/alerts/builder/projectProvider')),
component: withDetectorCreateRedirect(
make(() => import('sentry/views/alerts/builder/projectProvider'))
),
deprecatedRouteProps: true,
children: [
{
Expand Down
3 changes: 2 additions & 1 deletion static/app/utils/useParams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {useTestRouteContext} from './useRouteContext';
*/
type ParamKeys =
| 'alertId'
| 'alertType'
| 'apiKey'
| 'appId'
| 'appSlug'
Expand All @@ -22,7 +23,6 @@ type ParamKeys =
| 'dataForwarderId'
| 'dataExportId'
| 'detectorId'
| 'detectorId'
| 'docIntegrationSlug'
| 'eventId'
| 'eventSlug'
Expand All @@ -42,6 +42,7 @@ type ParamKeys =
| 'release'
| 'relocationUuid'
| 'replaySlug'
| 'ruleId'
| 'scrubbingId'
| 'searchId'
| 'sentryAppSlug'
Expand Down
Loading
Loading